Lines Matching refs:s
223 static CURLcode cf_osslq_stream_open(struct cf_osslq_stream *s, in cf_osslq_stream_open() argument
229 DEBUGASSERT(!s->ssl); in cf_osslq_stream_open()
230 Curl_bufq_initp(&s->recvbuf, bufcp, 1, BUFQ_OPT_NONE); in cf_osslq_stream_open()
231 s->ssl = SSL_new_stream(conn, flags); in cf_osslq_stream_open()
232 if(!s->ssl) { in cf_osslq_stream_open()
235 s->id = (curl_int64_t)SSL_get_stream_id(s->ssl); in cf_osslq_stream_open()
236 SSL_set_app_data(s->ssl, user_data); in cf_osslq_stream_open()
240 static void cf_osslq_stream_cleanup(struct cf_osslq_stream *s) in cf_osslq_stream_cleanup() argument
242 if(s->ssl) { in cf_osslq_stream_cleanup()
243 SSL_set_app_data(s->ssl, NULL); in cf_osslq_stream_cleanup()
244 SSL_free(s->ssl); in cf_osslq_stream_cleanup()
246 Curl_bufq_free(&s->recvbuf); in cf_osslq_stream_cleanup()
247 memset(s, 0, sizeof(*s)); in cf_osslq_stream_cleanup()
250 static void cf_osslq_stream_close(struct cf_osslq_stream *s) in cf_osslq_stream_close() argument
252 if(s->ssl) { in cf_osslq_stream_close()
253 SSL_free(s->ssl); in cf_osslq_stream_close()
254 s->ssl = NULL; in cf_osslq_stream_close()
574 struct cf_osslq_stream s; member
596 cf_osslq_stream_cleanup(&stream->s); in h3_stream_ctx_free()
625 stream->s.id = -1; in h3_data_setup()
653 stream->s.id); in h3_data_done()
655 nghttp3_conn_shutdown_stream_read(ctx->h3.conn, stream->s.id); in h3_data_done()
656 nghttp3_conn_close_stream(ctx->h3.conn, stream->s.id, in h3_data_done()
658 nghttp3_conn_set_stream_user_data(ctx->h3.conn, stream->s.id, NULL); in h3_data_done()
673 if(stream && stream->s.id == stream_id) { in cf_osslq_get_qstream()
674 return &stream->s; in cf_osslq_get_qstream()
693 if(stream && stream->s.id == stream_id) { in cf_osslq_get_qstream()
694 return &stream->s; in cf_osslq_get_qstream()
751 stream->s.id, stream->error3); in cb_h3_stream_close()
754 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] CLOSED", stream->s.id); in cb_h3_stream_close()
815 stream->s.id, buflen, result); in cb_h3_recv_data()
820 stream->s.id, buflen, stream->download_recvd); in cb_h3_recv_data()
838 stream->s.id, consumed); in cb_h3_deferred_consume()
949 if(!stream || !stream->s.ssl) in cb_h3_stop_sending()
953 cf_osslq_stream_close(&stream->s); in cb_h3_stop_sending()
968 if(stream && stream->s.ssl) { in cb_h3_reset_stream()
971 rv = !SSL_stream_reset(stream->s.ssl, &args, sizeof(args)); in cb_h3_reset_stream()
1033 stream->s.id); in cb_h3_read_req_body()
1039 stream->s.id, (int)nvecs, in cb_h3_read_req_body()
1258 struct cf_osslq_stream *s; member
1270 rv = SSL_read_ex(x->s->ssl, buf, len, &nread); in h3_quic_recv()
1272 int detail = SSL_get_error(x->s->ssl, rv); in h3_quic_recv()
1279 x->s->id); in h3_quic_recv()
1280 x->s->recvd_eos = TRUE; in h3_quic_recv()
1283 else if(SSL_get_stream_read_state(x->s->ssl) == in h3_quic_recv()
1286 SSL_get_stream_read_error_code(x->s->ssl, &app_error_code); in h3_quic_recv()
1289 x->s->id, rv, (curl_uint64_t)app_error_code); in h3_quic_recv()
1291 x->s->reset = TRUE; in h3_quic_recv()
1293 x->s->recvd_eos = TRUE; in h3_quic_recv()
1304 static CURLcode cf_osslq_stream_recv(struct cf_osslq_stream *s, in cf_osslq_stream_recv() argument
1315 DEBUGASSERT(s); in cf_osslq_stream_recv()
1316 if(s->closed) in cf_osslq_stream_recv()
1321 x.s = s; in cf_osslq_stream_recv()
1322 while(s->ssl && !s->closed && !eagain && in cf_osslq_stream_recv()
1324 if(Curl_bufq_is_empty(&s->recvbuf) && !s->recvd_eos) { in cf_osslq_stream_recv()
1325 while(!eagain && !s->recvd_eos && !Curl_bufq_is_full(&s->recvbuf)) { in cf_osslq_stream_recv()
1326 nread = Curl_bufq_sipn(&s->recvbuf, 0, h3_quic_recv, &x, &result); in cf_osslq_stream_recv()
1337 if(!Curl_bufq_is_empty(&s->recvbuf)) { in cf_osslq_stream_recv()
1341 while(Curl_bufq_peek(&s->recvbuf, &buf, &blen)) { in cf_osslq_stream_recv()
1342 nread = nghttp3_conn_read_stream(ctx->h3.conn, s->id, in cf_osslq_stream_recv()
1345 "to nghttp3 -> %zd", s->id, blen, nread); in cf_osslq_stream_recv()
1355 Curl_bufq_skip(&s->recvbuf, blen); in cf_osslq_stream_recv()
1361 if(Curl_bufq_is_empty(&s->recvbuf) && !s->closed) { in cf_osslq_stream_recv()
1364 if(s->reset) { in cf_osslq_stream_recv()
1366 if(!SSL_get_stream_read_error_code(s->ssl, &app_error)) { in cf_osslq_stream_recv()
1371 rv = nghttp3_conn_close_stream(ctx->h3.conn, s->id, app_error); in cf_osslq_stream_recv()
1372 s->closed = TRUE; in cf_osslq_stream_recv()
1380 else if(s->recvd_eos) { in cf_osslq_stream_recv()
1381 rv = nghttp3_conn_close_stream(ctx->h3.conn, s->id, in cf_osslq_stream_recv()
1383 s->closed = TRUE; in cf_osslq_stream_recv()
1385 s->id, rv); in cf_osslq_stream_recv()
1398 s->id, result); in cf_osslq_stream_recv()
1448 result = cf_osslq_stream_recv(&stream->s, cf, sdata); in cf_progress_ingress()
1474 if(stream && stream->s.ssl && stream->s.send_blocked && in cf_osslq_check_and_unblock()
1475 !SSL_want_write(stream->s.ssl)) { in cf_osslq_check_and_unblock()
1476 nghttp3_conn_unblock_stream(ctx->h3.conn, stream->s.id); in cf_osslq_check_and_unblock()
1477 stream->s.send_blocked = FALSE; in cf_osslq_check_and_unblock()
1497 struct cf_osslq_stream *s = NULL; in h3_send_streams() local
1520 s = cf_osslq_get_qstream(cf, data, stream_id); in h3_send_streams()
1521 if(!s) { in h3_send_streams()
1528 DEBUGASSERT(s->id == stream_id); in h3_send_streams()
1537 ok = !s->ssl || SSL_write_ex2(s->ssl, vec[i].base, vec[i].len, flags, in h3_send_streams()
1545 s->id, vec[i].len); in h3_send_streams()
1549 int detail = SSL_get_error(s->ssl, 0); in h3_send_streams()
1555 "QUIC blocked", s->id, vec[i].len); in h3_send_streams()
1557 nghttp3_conn_block_stream(ctx->h3.conn, s->id); in h3_send_streams()
1558 s->send_blocked = blocked = TRUE; in h3_send_streams()
1562 s->id, vec[i].len, detail); in h3_send_streams()
1569 if(acked_len > 0 || (eos && !s->send_blocked)) { in h3_send_streams()
1573 rv = nghttp3_conn_add_write_offset(ctx->h3.conn, s->id, acked_len); in h3_send_streams()
1580 rv = nghttp3_conn_add_ack_offset(ctx->h3.conn, s->id, acked_len); in h3_send_streams()
1588 "to QUIC, eos=%d", s->id, acked_len, total_len, eos); in h3_send_streams()
1591 if(eos && !s->send_blocked && !eos_written) { in h3_send_streams()
1593 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] closing QUIC stream", s->id); in h3_send_streams()
1594 SSL_stream_conclude(s->ssl, 0); in h3_send_streams()
1849 DEBUGASSERT(stream->s.id == -1); in h3_stream_open()
1850 *err = cf_osslq_stream_open(&stream->s, ctx->tls.ossl.ssl, 0, in h3_stream_open()
1882 rc = nghttp3_conn_submit_request(ctx->h3.conn, stream->s.id, in h3_stream_open()
1888 "connection is closing", stream->s.id); in h3_stream_open()
1892 stream->s.id, rc, nghttp3_strerror(rc)); in h3_stream_open()
1902 stream->s.id, data->state.url); in h3_stream_open()
1905 stream->s.id, in h3_stream_open()
1948 if(!stream || stream->s.id < 0) { in cf_osslq_send()
1964 "on closed stream with response", stream->s.id); in cf_osslq_send()
1970 "-> stream closed", stream->s.id, len); in cf_osslq_send()
1979 stream->s.id, len, nwritten, *err); in cf_osslq_send()
1984 (void)nghttp3_conn_resume_stream(ctx->h3.conn, stream->s.id); in cf_osslq_send()
1996 stream ? stream->s.id : -1, len, nwritten, *err); in cf_osslq_send()
2012 stream->s.id); in recv_closed_stream()
2021 stream->s.id); in recv_closed_stream()
2059 "-> %zd, %d", stream->s.id, len, nread, *err); in cf_osslq_recv()
2077 "-> %zd, %d", stream->s.id, len, nread, *err); in cf_osslq_recv()
2107 stream ? stream->s.id : -1, len, nread, *err); in cf_osslq_recv()
2154 (void)nghttp3_conn_resume_stream(ctx->h3.conn, stream->s.id); in cf_osslq_data_event()