Lines Matching refs:stream
303 static void h3_stream_hash_free(void *stream);
594 static void h3_stream_ctx_free(struct h3_stream_ctx *stream) in h3_stream_ctx_free() argument
596 cf_osslq_stream_cleanup(&stream->s); in h3_stream_ctx_free()
597 Curl_bufq_free(&stream->sendbuf); in h3_stream_ctx_free()
598 Curl_bufq_free(&stream->recvbuf); in h3_stream_ctx_free()
599 Curl_h1_req_parse_free(&stream->h1); in h3_stream_ctx_free()
600 free(stream); in h3_stream_ctx_free()
603 static void h3_stream_hash_free(void *stream) in h3_stream_hash_free() argument
605 DEBUGASSERT(stream); in h3_stream_hash_free()
606 h3_stream_ctx_free((struct h3_stream_ctx *)stream); in h3_stream_hash_free()
613 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_data_setup() local
618 if(stream) in h3_data_setup()
621 stream = calloc(1, sizeof(*stream)); in h3_data_setup()
622 if(!stream) in h3_data_setup()
625 stream->s.id = -1; in h3_data_setup()
627 Curl_bufq_initp(&stream->sendbuf, &ctx->stream_bufcp, in h3_data_setup()
629 stream->sendbuf_len_in_flight = 0; in h3_data_setup()
632 Curl_bufq_initp(&stream->recvbuf, &ctx->stream_bufcp, in h3_data_setup()
634 stream->recv_buf_nonflow = 0; in h3_data_setup()
635 Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); in h3_data_setup()
637 if(!Curl_hash_offt_set(&ctx->streams, data->mid, stream)) { in h3_data_setup()
638 h3_stream_ctx_free(stream); in h3_data_setup()
648 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_data_done() local
651 if(stream) { in h3_data_done()
653 stream->s.id); in h3_data_done()
654 if(ctx->h3.conn && !stream->closed) { 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()
659 stream->closed = TRUE; in h3_data_done()
671 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_osslq_get_qstream() local
673 if(stream && stream->s.id == stream_id) { in cf_osslq_get_qstream()
674 return &stream->s; in cf_osslq_get_qstream()
692 stream = H3_STREAM_CTX(ctx, sdata); 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()
705 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in h3_drain_stream() local
710 if(stream && stream->upload_left && !stream->send_closed) in h3_drain_stream()
737 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_stream_close() local
742 if(!stream) in cb_h3_stream_close()
745 stream->closed = TRUE; in cb_h3_stream_close()
746 stream->error3 = app_error_code; in cb_h3_stream_close()
747 if(stream->error3 != NGHTTP3_H3_NO_ERROR) { in cb_h3_stream_close()
748 stream->reset = TRUE; in cb_h3_stream_close()
749 stream->send_closed = TRUE; in cb_h3_stream_close()
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()
771 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in write_resp_raw() local
776 if(!stream) { in write_resp_raw()
779 nwritten = Curl_bufq_write(&stream->recvbuf, mem, memlen, &result); in write_resp_raw()
785 stream->recv_buf_nonflow += (size_t)nwritten; in write_resp_raw()
803 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_recv_data() local
809 if(!stream) in cb_h3_recv_data()
815 stream->s.id, buflen, result); in cb_h3_recv_data()
818 stream->download_recvd += (curl_off_t)buflen; in cb_h3_recv_data()
820 stream->s.id, buflen, stream->download_recvd); in cb_h3_recv_data()
832 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_deferred_consume() local
836 if(stream) in cb_h3_deferred_consume()
838 stream->s.id, consumed); in cb_h3_deferred_consume()
853 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_recv_header() local
862 if(!stream) in cb_h3_recv_header()
869 result = Curl_http_decode_status(&stream->status_code, in cb_h3_recv_header()
874 stream->status_code); in cb_h3_recv_header()
913 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_end_headers() local
920 if(!stream) in cb_h3_end_headers()
929 stream_id, stream->status_code); in cb_h3_end_headers()
930 if(stream->status_code / 100 != 1) { in cb_h3_end_headers()
931 stream->resp_hds_complete = TRUE; in cb_h3_end_headers()
945 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_stop_sending() local
949 if(!stream || !stream->s.ssl) in cb_h3_stop_sending()
953 cf_osslq_stream_close(&stream->s); in cb_h3_stop_sending()
964 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_reset_stream() local
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()
989 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_read_req_body() local
998 if(!stream) in cb_h3_read_req_body()
1007 if(stream->sendbuf_len_in_flight < Curl_bufq_len(&stream->sendbuf)) { in cb_h3_read_req_body()
1010 Curl_bufq_peek_at(&stream->sendbuf, in cb_h3_read_req_body()
1011 stream->sendbuf_len_in_flight, in cb_h3_read_req_body()
1014 stream->sendbuf_len_in_flight += vec[nvecs].len; in cb_h3_read_req_body()
1021 if(nwritten > 0 && stream->upload_left != -1) in cb_h3_read_req_body()
1022 stream->upload_left -= nwritten; in cb_h3_read_req_body()
1026 if(stream->upload_left == 0) { in cb_h3_read_req_body()
1028 stream->send_closed = TRUE; in cb_h3_read_req_body()
1033 stream->s.id); in cb_h3_read_req_body()
1039 stream->s.id, (int)nvecs, in cb_h3_read_req_body()
1041 nwritten, Curl_bufq_len(&stream->sendbuf), in cb_h3_read_req_body()
1042 stream->upload_left); in cb_h3_read_req_body()
1053 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cb_h3_acked_stream_data() local
1057 if(!stream) in cb_h3_acked_stream_data()
1062 if(datalen >= (uint64_t)stream->sendbuf_len_in_flight) in cb_h3_acked_stream_data()
1063 skiplen = stream->sendbuf_len_in_flight; in cb_h3_acked_stream_data()
1066 Curl_bufq_skip(&stream->sendbuf, skiplen); in cb_h3_acked_stream_data()
1067 stream->sendbuf_len_in_flight -= skiplen; in cb_h3_acked_stream_data()
1070 if(stream->sendbuf_len_in_flight < Curl_bufq_len(&stream->sendbuf)) { in cb_h3_acked_stream_data()
1439 struct h3_stream_ctx *stream; in cf_progress_ingress() local
1445 stream = H3_STREAM_CTX(ctx, sdata); in cf_progress_ingress()
1446 if(stream && !stream->closed && in cf_progress_ingress()
1447 !Curl_bufq_is_full(&stream->recvbuf)) { in cf_progress_ingress()
1448 result = cf_osslq_stream_recv(&stream->s, cf, sdata); in cf_progress_ingress()
1466 struct h3_stream_ctx *stream; in cf_osslq_check_and_unblock() local
1473 stream = H3_STREAM_CTX(ctx, sdata); in cf_osslq_check_and_unblock()
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()
1793 struct h3_stream_ctx *stream = NULL; in h3_stream_open() local
1808 stream = H3_STREAM_CTX(ctx, data); in h3_stream_open()
1809 DEBUGASSERT(stream); in h3_stream_open()
1810 if(!stream) { in h3_stream_open()
1815 nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, err); in h3_stream_open()
1818 if(!stream->h1.done) { in h3_stream_open()
1822 DEBUGASSERT(stream->h1.req); in h3_stream_open()
1824 *err = Curl_http_req_to_h2(&h2_headers, stream->h1.req, data); in h3_stream_open()
1830 Curl_h1_req_parse_free(&stream->h1); in h3_stream_open()
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()
1865 stream->upload_left = data->state.infilesize; in h3_stream_open()
1868 stream->upload_left = -1; /* unknown */ in h3_stream_open()
1872 stream->upload_left = 0; /* no request body */ in h3_stream_open()
1876 stream->send_closed = (stream->upload_left == 0); in h3_stream_open()
1877 if(!stream->send_closed) { 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()
1922 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_osslq_send() local
1948 if(!stream || stream->s.id < 0) { in cf_osslq_send()
1954 stream = H3_STREAM_CTX(ctx, data); in cf_osslq_send()
1956 else if(stream->closed) { in cf_osslq_send()
1957 if(stream->resp_hds_complete) { 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()
1976 nwritten = Curl_bufq_write(&stream->sendbuf, buf, len, err); 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()
2003 struct h3_stream_ctx *stream, in recv_closed_stream() argument
2009 if(stream->reset) { in recv_closed_stream()
2012 stream->s.id); in recv_closed_stream()
2016 else if(!stream->resp_hds_complete) { in recv_closed_stream()
2021 stream->s.id); in recv_closed_stream()
2036 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_osslq_recv() local
2049 if(!stream) { in cf_osslq_recv()
2054 if(!Curl_bufq_is_empty(&stream->recvbuf)) { in cf_osslq_recv()
2055 nread = Curl_bufq_read(&stream->recvbuf, in cf_osslq_recv()
2059 "-> %zd, %d", stream->s.id, len, nread, *err); in cf_osslq_recv()
2072 if(nread < 0 && !Curl_bufq_is_empty(&stream->recvbuf)) { in cf_osslq_recv()
2073 nread = Curl_bufq_read(&stream->recvbuf, in cf_osslq_recv()
2077 "-> %zd, %d", stream->s.id, len, nread, *err); in cf_osslq_recv()
2086 if(stream->closed) { in cf_osslq_recv()
2087 nread = recv_closed_stream(cf, data, stream, err); in cf_osslq_recv()
2107 stream ? stream->s.id : -1, len, nread, *err); in cf_osslq_recv()
2120 const struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_osslq_data_pending() local
2122 return stream && !Curl_bufq_is_empty(&stream->recvbuf); in cf_osslq_data_pending()
2149 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_osslq_data_event() local
2150 if(stream && !stream->send_closed) { in cf_osslq_data_event()
2151 stream->send_closed = TRUE; in cf_osslq_data_event()
2152 stream->upload_left = Curl_bufq_len(&stream->sendbuf) - in cf_osslq_data_event()
2153 stream->sendbuf_len_in_flight; in cf_osslq_data_event()
2154 (void)nghttp3_conn_resume_stream(ctx->h3.conn, stream->s.id); in cf_osslq_data_event()
2159 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); in cf_osslq_data_event() local
2161 if(stream && !stream->closed) { in cf_osslq_data_event()