diff options
author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2019-08-15 14:52:56 +0900 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-08-15 08:02:23 +0200 |
commit | c47ef9115e9f527b2b3758153283af48c3c68b92 (patch) | |
tree | 27424d75740b0e8ee9902e13d8ca3455e5a0b08b | |
parent | e42bd8a204e4db9320bf5b020c799b8e10b3b93d (diff) | |
download | curl-c47ef9115e9f527b2b3758153283af48c3c68b92.tar.gz |
ngtcp2: deal with stream close
-rw-r--r-- | lib/vquic/ngtcp2.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c index c26e80670..38bea4520 100644 --- a/lib/vquic/ngtcp2.c +++ b/lib/vquic/ngtcp2.c @@ -1217,12 +1217,16 @@ static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id, uint64_t app_error_code, void *user_data, void *stream_user_data) { + struct Curl_easy *data = stream_user_data; + struct HTTP *stream = data->req.protop; (void)conn; (void)stream_id; (void)app_error_code; (void)user_data; - (void)stream_user_data; fprintf(stderr, "cb_h3_stream_close CALLED\n"); + + stream->closed = TRUE; + return 0; } @@ -1481,6 +1485,11 @@ static ssize_t ngh3_stream_recv(struct connectdata *conn, return stream->memlen; } + if(stream->closed) { + *curlcode = CURLE_OK; + return 0; + } + infof(conn->data, "ngh3_stream_recv returns 0 bytes and EAGAIN\n"); *curlcode = CURLE_AGAIN; return -1; |