From 0a5d28fa2ec872de55c8d3f3b62675f17ca9cd45 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 22 Aug 2019 14:08:18 +0200 Subject: ngtcp2: accept upload via callback Closes #4256 --- lib/vquic/quiche.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib/vquic/quiche.c') diff --git a/lib/vquic/quiche.c b/lib/vquic/quiche.c index b84cc4779..43723a5f9 100644 --- a/lib/vquic/quiche.c +++ b/lib/vquic/quiche.c @@ -116,7 +116,7 @@ static CURLcode quiche_do(struct connectdata *conn, bool *done) return Curl_http(conn, done); } -static const struct Curl_handler Curl_handler_h3_quiche = { +static const struct Curl_handler Curl_handler_http3 = { "HTTPS", /* scheme */ ZERO_NULL, /* setup_connection */ quiche_do, /* do_it */ @@ -232,7 +232,7 @@ static CURLcode quiche_has_connected(struct connectdata *conn, conn->recv[sockindex] = h3_stream_recv; conn->send[sockindex] = h3_stream_send; - conn->handler = &Curl_handler_h3_quiche; + conn->handler = &Curl_handler_http3; conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ conn->httpversion = 30; conn->bundle->multiuse = BUNDLE_MULTIPLEX; @@ -750,5 +750,19 @@ fail: return result; } +/* + * Called from transfer.c:done_sending when we stop HTTP/3 uploading. + */ +CURLcode Curl_quic_done_sending(struct connectdata *conn) +{ + if(conn->handler == &Curl_handler_http3) { + /* only for HTTP/3 transfers */ + struct HTTP *stream = conn->data->req.protop; + fprintf(stderr, "!!! Curl_quic_done_sending\n"); + stream->upload_done = TRUE; + } + + return CURLE_OK; +} #endif -- cgit v1.2.3