diff options
author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2019-08-15 14:52:09 +0900 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-08-15 08:02:20 +0200 |
commit | e42bd8a204e4db9320bf5b020c799b8e10b3b93d (patch) | |
tree | 0a01f0e68114b64e72341b09ef0ceadc89937585 /lib/vquic/ngtcp2.c | |
parent | 887ebc384c5687a8e154b3b6feb74cdaa8df4adc (diff) |
ngtcp2: Consume QUIC STREAM data properly
Diffstat (limited to 'lib/vquic/ngtcp2.c')
-rw-r--r-- | lib/vquic/ngtcp2.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c index a2285e75e..c26e80670 100644 --- a/lib/vquic/ngtcp2.c +++ b/lib/vquic/ngtcp2.c @@ -859,8 +859,9 @@ static int cb_recv_stream_data(ngtcp2_conn *tconn, int64_t stream_id, return NGTCP2_ERR_CALLBACK_FAILURE; } - ngtcp2_conn_extend_max_stream_offset(tconn, stream_id, buflen); - ngtcp2_conn_extend_max_offset(tconn, buflen); + ngtcp2_conn_extend_max_stream_offset(tconn, stream_id, nconsumed); + ngtcp2_conn_extend_max_offset(tconn, nconsumed); + return 0; } @@ -1229,12 +1230,11 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream_id, const uint8_t *buf, size_t buflen, void *user_data, void *stream_user_data) { + struct quicsocket *qs = user_data; size_t ncopy; struct Curl_easy *data = stream_user_data; struct HTTP *stream = data->req.protop; (void)conn; - (void)stream_id; - (void)user_data; fprintf(stderr, "cb_h3_recv_data CALLED with %d bytes\n", buflen); /* TODO: this needs to be handled properly */ @@ -1246,6 +1246,9 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream_id, stream->memlen += ncopy; stream->mem += ncopy; + ngtcp2_conn_extend_max_stream_offset(qs->qconn, stream_id, buflen); + ngtcp2_conn_extend_max_offset(qs->qconn, buflen); + return 0; } @@ -1253,12 +1256,14 @@ static int cb_h3_deferred_consume(nghttp3_conn *conn, int64_t stream_id, size_t consumed, void *user_data, void *stream_user_data) { + struct quicsocket *qs = user_data; (void)conn; - (void)stream_id; - (void)consumed; - (void)user_data; (void)stream_user_data; fprintf(stderr, "cb_h3_deferred_consume CALLED\n"); + + ngtcp2_conn_extend_max_stream_offset(qs->qconn, stream_id, consumed); + ngtcp2_conn_extend_max_offset(qs->qconn, consumed); + return 0; } @@ -1394,7 +1399,7 @@ static int init_ngh3_conn(struct quicsocket *qs) &ngh3_callbacks, &qs->h3settings, nghttp3_mem_default(), - qs->conn->data); + qs); if(rc) { result = CURLE_OUT_OF_MEMORY; goto fail; |