Lines Matching refs:stream

133 static void h3_stream_hash_free(void *stream);
185 static void h3_stream_ctx_free(struct stream_ctx *stream) in h3_stream_ctx_free() argument
187 Curl_bufq_free(&stream->recvbuf); in h3_stream_ctx_free()
188 free(stream); in h3_stream_ctx_free()
191 static void h3_stream_hash_free(void *stream) in h3_stream_hash_free() argument
193 DEBUGASSERT(stream); in h3_stream_hash_free()
194 h3_stream_ctx_free((struct stream_ctx *)stream); in h3_stream_hash_free()
201 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_data_setup() local
203 if(stream) in h3_data_setup()
206 stream = calloc(1, sizeof(*stream)); in h3_data_setup()
207 if(!stream) in h3_data_setup()
210 stream->req = ZERO_NULL; in h3_data_setup()
211 msh3_lock_initialize(&stream->recv_lock); in h3_data_setup()
212 Curl_bufq_init2(&stream->recvbuf, H3_STREAM_CHUNK_SIZE, in h3_data_setup()
216 if(!Curl_hash_offt_set(&ctx->streams, data->mid, stream)) { in h3_data_setup()
217 h3_stream_ctx_free(stream); in h3_data_setup()
227 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_data_done() local
230 if(stream) { in h3_data_done()
237 struct stream_ctx *stream) in drain_stream_from_other_thread() argument
243 if(stream && !stream->upload_done) in drain_stream_from_other_thread()
255 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_drain_stream() local
260 if(stream && !stream->upload_done) in h3_drain_stream()
354 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in write_resp_raw() local
358 if(!stream) in write_resp_raw()
361 nwritten = Curl_bufq_write(&stream->recvbuf, mem, memlen, &result); in write_resp_raw()
381 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in msh3_header_received() local
385 DEBUGF(infof(data, "[MSH3] header received, stream=%d", !!stream)); in msh3_header_received()
386 if(!stream || stream->recv_header_complete) { in msh3_header_received()
390 msh3_lock_acquire(&stream->recv_lock); in msh3_header_received()
397 DEBUGASSERT(!stream->firstheader); in msh3_header_received()
398 stream->status_code = decode_status_code(hd->Value, hd->ValueLength); in msh3_header_received()
399 DEBUGASSERT(stream->status_code != -1); in msh3_header_received()
401 stream->status_code); in msh3_header_received()
404 stream->recv_error = result; in msh3_header_received()
405 stream->firstheader = TRUE; in msh3_header_received()
409 DEBUGASSERT(stream->firstheader); in msh3_header_received()
418 stream->recv_error = result; in msh3_header_received()
422 drain_stream_from_other_thread(data, stream); in msh3_header_received()
423 msh3_lock_release(&stream->recv_lock); in msh3_header_received()
432 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in msh3_data_received() local
442 if(!stream) in msh3_data_received()
445 msh3_lock_acquire(&stream->recv_lock); in msh3_data_received()
447 if(!stream->recv_header_complete) { in msh3_data_received()
450 stream->recv_error = result; in msh3_data_received()
453 stream->recv_header_complete = TRUE; in msh3_data_received()
458 stream->recv_error = result; in msh3_data_received()
463 msh3_lock_release(&stream->recv_lock); in msh3_data_received()
472 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in msh3_complete() local
475 if(!stream) in msh3_complete()
477 msh3_lock_acquire(&stream->recv_lock); in msh3_complete()
478 stream->closed = TRUE; in msh3_complete()
479 stream->recv_header_complete = TRUE; in msh3_complete()
481 stream->error3 = error; in msh3_complete()
483 stream->reset = TRUE; in msh3_complete()
484 msh3_lock_release(&stream->recv_lock); in msh3_complete()
492 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in msh3_shutdown_complete() local
494 if(!stream) in msh3_shutdown_complete()
497 (void)stream; in msh3_shutdown_complete()
505 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in msh3_data_sent() local
506 if(!stream) in msh3_data_sent()
509 (void)stream; in msh3_data_sent()
518 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in recv_closed_stream() local
521 if(!stream) { in recv_closed_stream()
526 if(stream->reset) { in recv_closed_stream()
532 else if(stream->error3) { in recv_closed_stream()
534 (ssize_t)stream->error3); in recv_closed_stream()
552 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in set_quic_expire() local
558 if(stream && stream->req && !stream->closed) { in set_quic_expire()
570 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_msh3_recv() local
574 CURL_TRC_CF(data, cf, "cf_recv(len=%zu), stream=%d", len, !!stream); in cf_msh3_recv()
575 if(!stream) { in cf_msh3_recv()
581 msh3_lock_acquire(&stream->recv_lock); in cf_msh3_recv()
583 if(stream->recv_error) { in cf_msh3_recv()
585 *err = stream->recv_error; in cf_msh3_recv()
591 if(!Curl_bufq_is_empty(&stream->recvbuf)) { in cf_msh3_recv()
592 nread = Curl_bufq_read(&stream->recvbuf, in cf_msh3_recv()
598 if(stream->closed) in cf_msh3_recv()
601 else if(stream->closed) { in cf_msh3_recv()
611 msh3_lock_release(&stream->recv_lock); in cf_msh3_recv()
622 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_msh3_send() local
636 DEBUGASSERT(stream); in cf_msh3_send()
639 if(!stream->req) { in cf_msh3_send()
672 stream->req = MsH3RequestOpen(ctx->qconn, &msh3_request_if, data, in cf_msh3_send()
676 if(!stream->req) { in cf_msh3_send()
692 if(!MsH3RequestSend(stream->req, MSH3_REQUEST_FLAG_NONE, buf, in cf_msh3_send()
693 (uint32_t)len, stream)) { in cf_msh3_send()
718 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_msh3_adjust_pollset() local
722 if(stream && ctx->sock[SP_LOCAL] != CURL_SOCKET_BAD) { in cf_msh3_adjust_pollset()
723 if(stream->recv_error) { in cf_msh3_adjust_pollset()
727 else if(stream->req) { in cf_msh3_adjust_pollset()
738 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_msh3_data_pending() local
745 if(stream && stream->req) { in cf_msh3_data_pending()
746 msh3_lock_acquire(&stream->recv_lock); in cf_msh3_data_pending()
748 Curl_bufq_len(&stream->recvbuf)); in cf_msh3_data_pending()
749 pending = !Curl_bufq_is_empty(&stream->recvbuf); in cf_msh3_data_pending()
750 msh3_lock_release(&stream->recv_lock); in cf_msh3_data_pending()
775 struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_msh3_data_event() local
795 if(stream) { in cf_msh3_data_event()
796 stream->upload_done = TRUE; in cf_msh3_data_event()
797 if(stream->req) { in cf_msh3_data_event()
799 if(!MsH3RequestSend(stream->req, MSH3_REQUEST_FLAG_FIN, in cf_msh3_data_event()