Lines Matching refs:stream
118 static void h3_stream_hash_free(void *stream);
186 static void h3_stream_ctx_free(struct stream_ctx *stream) in h3_stream_ctx_free() argument
188 Curl_bufq_free(&stream->recvbuf); in h3_stream_ctx_free()
189 Curl_h1_req_parse_free(&stream->h1); in h3_stream_ctx_free()
190 free(stream); in h3_stream_ctx_free()
193 static void h3_stream_hash_free(void *stream) in h3_stream_hash_free() argument
195 DEBUGASSERT(stream); in h3_stream_hash_free()
196 h3_stream_ctx_free((struct stream_ctx *)stream); in h3_stream_hash_free()
209 struct stream_ctx *stream = H3_STREAM_CTX(ctx, sdata); in check_resumes() local
210 if(stream && stream->quic_flow_blocked) { in check_resumes()
211 stream->quic_flow_blocked = FALSE; in check_resumes()
213 CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] unblock", stream->id); in check_resumes()
223 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_data_setup() local
225 if(stream) in h3_data_setup()
228 stream = calloc(1, sizeof(*stream)); in h3_data_setup()
229 if(!stream) in h3_data_setup()
232 stream->id = -1; in h3_data_setup()
233 Curl_bufq_initp(&stream->recvbuf, &ctx->stream_bufcp, in h3_data_setup()
235 Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); in h3_data_setup()
237 if(!Curl_hash_offt_set(&ctx->streams, data->mid, stream)) { in h3_data_setup()
238 h3_stream_ctx_free(stream); in h3_data_setup()
248 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_data_done() local
252 if(stream) { in h3_data_done()
253 CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] easy handle is done", stream->id); in h3_data_done()
254 if(ctx->qconn && !stream->closed) { in h3_data_done()
255 quiche_conn_stream_shutdown(ctx->qconn, stream->id, in h3_data_done()
257 if(!stream->send_closed) { in h3_data_done()
258 quiche_conn_stream_shutdown(ctx->qconn, stream->id, in h3_data_done()
260 stream->send_closed = TRUE; in h3_data_done()
262 stream->closed = TRUE; in h3_data_done()
275 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_drain_stream() local
280 if(stream && !stream->send_closed) in h3_drain_stream()
294 struct stream_ctx *stream; in get_stream_easy() local
297 stream = H3_STREAM_CTX(ctx, data); in get_stream_easy()
298 if(stream && stream->id == stream_id) { in get_stream_easy()
299 *pstream = stream; in get_stream_easy()
309 stream = H3_STREAM_CTX(ctx, sdata); in get_stream_easy()
310 if(stream && stream->id == stream_id) { in get_stream_easy()
311 *pstream = stream; in get_stream_easy()
346 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in write_resp_raw() local
351 if(!stream) in write_resp_raw()
353 nwritten = Curl_bufq_write(&stream->recvbuf, mem, memlen, &result); in write_resp_raw()
377 struct stream_ctx *stream = H3_STREAM_CTX(ctx, x->data); in cb_each_header() local
380 if(!stream) in cb_each_header()
385 stream->id, (int)value_len, value); in cb_each_header()
394 stream->id, (int)name_len, name, in cb_each_header()
406 stream->id, result); in cb_each_header()
417 struct stream_ctx *stream = H3_STREAM_CTX(ctx, x->data); in stream_resp_read() local
420 if(!stream) { in stream_resp_read()
425 nread = quiche_h3_recv_body(ctx->h3c, ctx->qconn, stream->id, in stream_resp_read()
441 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_recv_body() local
446 if(!stream) in cf_recv_body()
449 if(!stream->resp_hds_complete) { in cf_recv_body()
453 stream->resp_hds_complete = TRUE; in cf_recv_body()
458 nwritten = Curl_bufq_slurp(&stream->recvbuf, in cf_recv_body()
463 stream->id, nwritten); in cf_recv_body()
465 result, stream->id); in cf_recv_body()
466 stream->closed = TRUE; in cf_recv_body()
467 stream->reset = TRUE; in cf_recv_body()
468 stream->send_closed = TRUE; in cf_recv_body()
499 struct stream_ctx *stream, in h3_process_event() argument
506 if(!stream) in h3_process_event()
510 stream->resp_got_header = TRUE; in h3_process_event()
516 FMT_PRIu64"]", rc, stream->id); in h3_process_event()
519 CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] <- [HEADERS]", stream->id); in h3_process_event()
523 if(!stream->closed) { in h3_process_event()
529 CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] RESET", stream->id); in h3_process_event()
530 stream->closed = TRUE; in h3_process_event()
531 stream->reset = TRUE; in h3_process_event()
532 stream->send_closed = TRUE; in h3_process_event()
537 CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] CLOSED", stream->id); in h3_process_event()
538 if(!stream->resp_hds_complete) { in h3_process_event()
542 stream->resp_hds_complete = TRUE; in h3_process_event()
544 stream->closed = TRUE; in h3_process_event()
549 CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] <- [GOAWAY]", stream->id); in h3_process_event()
554 stream->id, quiche_h3_event_type(ev)); in h3_process_event()
564 struct stream_ctx *stream = NULL; in cf_poll_events() local
580 sdata = get_stream_easy(cf, data, stream3_id, &stream); in cf_poll_events()
581 if(!sdata || !stream) { in cf_poll_events()
586 result = h3_process_event(cf, sdata, stream, ev); in cf_poll_events()
814 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in recv_closed_stream() local
817 DEBUGASSERT(stream); in recv_closed_stream()
818 if(stream->reset) { in recv_closed_stream()
820 "HTTP/3 stream %" FMT_PRIu64 " reset by server", stream->id); in recv_closed_stream()
823 stream->id, *err); in recv_closed_stream()
825 else if(!stream->resp_got_header) { in recv_closed_stream()
829 stream->id); in recv_closed_stream()
833 " -> %d", stream->id, *err); in recv_closed_stream()
846 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_quiche_recv() local
852 if(!stream) { in cf_quiche_recv()
857 if(!Curl_bufq_is_empty(&stream->recvbuf)) { in cf_quiche_recv()
858 nread = Curl_bufq_read(&stream->recvbuf, in cf_quiche_recv()
861 "-> %zd, %d", stream->id, len, nread, *err); in cf_quiche_recv()
874 if(nread < 0 && !Curl_bufq_is_empty(&stream->recvbuf)) { in cf_quiche_recv()
875 nread = Curl_bufq_read(&stream->recvbuf, in cf_quiche_recv()
878 "-> %zd, %d", stream->id, len, nread, *err); in cf_quiche_recv()
884 if(stream->closed) in cf_quiche_recv()
888 if(stream->closed) { in cf_quiche_recv()
913 stream->id, ctx->data_recvd, nread, *err); in cf_quiche_recv()
919 struct stream_ctx *stream, in cf_quiche_send_body() argument
926 nwritten = quiche_h3_send_body(ctx->h3c, ctx->qconn, stream->id, in cf_quiche_send_body()
931 if(!quiche_conn_stream_writable(ctx->qconn, stream->id, len)) { in cf_quiche_send_body()
933 "-> window exhausted", stream->id, len); in cf_quiche_send_body()
934 stream->quic_flow_blocked = TRUE; in cf_quiche_send_body()
941 "-> invalid stream state", stream->id, len); in cf_quiche_send_body()
947 "-> exceeds size", stream->id, len); in cf_quiche_send_body()
953 "-> quiche err %zd", stream->id, len, nwritten); in cf_quiche_send_body()
959 stream->send_closed = TRUE; in cf_quiche_send_body()
962 stream->id, len, stream->send_closed, nwritten); in cf_quiche_send_body()
978 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_open_stream() local
985 if(!stream) { in h3_open_stream()
990 stream = H3_STREAM_CTX(ctx, data); in h3_open_stream()
991 DEBUGASSERT(stream); in h3_open_stream()
996 DEBUGASSERT(stream); in h3_open_stream()
997 nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, err); in h3_open_stream()
1000 if(!stream->h1.done) { in h3_open_stream()
1004 DEBUGASSERT(stream->h1.req); in h3_open_stream()
1006 *err = Curl_http_req_to_h2(&h2_headers, stream->h1.req, data); in h3_open_stream()
1012 Curl_h1_req_parse_free(&stream->h1); in h3_open_stream()
1031 stream->send_closed = TRUE; in h3_open_stream()
1034 stream->send_closed); in h3_open_stream()
1039 CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] blocked", stream->id); in h3_open_stream()
1040 stream->quic_flow_blocked = TRUE; in h3_open_stream()
1054 DEBUGASSERT(!stream->opened); in h3_open_stream()
1056 stream->id = stream3_id; in h3_open_stream()
1057 stream->opened = TRUE; in h3_open_stream()
1058 stream->closed = FALSE; in h3_open_stream()
1059 stream->reset = FALSE; in h3_open_stream()
1063 stream->id, data->state.url); in h3_open_stream()
1065 infof(data, "[HTTP/3] [%" FMT_PRIu64 "] [%.*s: %.*s]", stream->id, in h3_open_stream()
1076 bwritten = cf_quiche_send_body(cf, data, stream, in h3_open_stream()
1098 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_quiche_send() local
1110 if(!stream || !stream->opened) { in cf_quiche_send()
1114 stream = H3_STREAM_CTX(ctx, data); in cf_quiche_send()
1116 else if(stream->closed) { in cf_quiche_send()
1117 if(stream->resp_hds_complete) { in cf_quiche_send()
1127 "on closed stream with response", stream->id); in cf_quiche_send()
1133 "-> stream closed", stream->id, len); in cf_quiche_send()
1139 nwritten = cf_quiche_send_body(cf, data, stream, buf, len, eos, err); in cf_quiche_send()
1149 stream ? stream->id : (curl_uint64_t)~0, len, nwritten, *err); in cf_quiche_send()
1157 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in stream_is_writeable() local
1159 return stream && (quiche_conn_stream_writable( in stream_is_writeable()
1160 ctx->qconn, (curl_uint64_t)stream->id, 1) > 0); in stream_is_writeable()
1175 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_quiche_adjust_pollset() local
1180 s_exhaust = want_send && stream && stream->opened && in cf_quiche_adjust_pollset()
1181 (stream->quic_flow_blocked || !stream_is_writeable(cf, data)); in cf_quiche_adjust_pollset()
1198 const struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_quiche_data_pending() local
1200 return stream && !Curl_bufq_is_empty(&stream->recvbuf); in cf_quiche_data_pending()
1238 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_quiche_data_event() local
1239 if(stream && !stream->send_closed) { in cf_quiche_data_event()
1243 stream->send_closed = TRUE; in cf_quiche_data_event()
1247 stream->id, sent, result); in cf_quiche_data_event()
1252 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_quiche_data_event() local
1253 if(stream && !stream->closed) { in cf_quiche_data_event()