[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 43/264: http2: Fix erroneous debug message that h2 connection cl
From: |
gnunet |
Subject: |
[gnurl] 43/264: http2: Fix erroneous debug message that h2 connection closed |
Date: |
Thu, 30 Apr 2020 16:05:46 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 347a374c5608c6eba80cab2c0fa560975a3368ff
Author: Jay Satiro <address@hidden>
AuthorDate: Wed Mar 18 02:51:55 2020 -0400
http2: Fix erroneous debug message that h2 connection closed
Prior to this change in libcurl debug builds http2 stream closure was
erroneously referred to as connection closure.
Before:
* nread <= 0, server closed connection, bailing
After:
* nread == 0, stream closed, bailing
Closes https://github.com/curl/curl/pull/5118
---
lib/http2.c | 2 --
lib/transfer.c | 20 ++++++++++++++------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/lib/http2.c b/lib/http2.c
index 41d8db685..93dfbdb7d 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1727,8 +1727,6 @@ static ssize_t http2_recv(struct connectdata *conn, int
sockindex,
return retlen;
}
- /* If this stream is closed, return 0 to signal the http routine to close
- the connection */
if(stream->closed)
return 0;
*err = CURLE_AGAIN;
diff --git a/lib/transfer.c b/lib/transfer.c
index d02baa4c3..72168336a 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -568,17 +568,20 @@ static CURLcode readwrite_data(struct Curl_easy *data,
bool is_empty_data = FALSE;
size_t buffersize = data->set.buffer_size;
size_t bytestoread = buffersize;
+#ifdef USE_NGHTTP2
+ bool is_http2 = ((conn->handler->protocol & PROTO_FAMILY_HTTP) &&
+ (conn->httpversion == 20));
+#endif
if(
-#if defined(USE_NGHTTP2)
+#ifdef USE_NGHTTP2
/* For HTTP/2, read data without caring about the content
length. This is safe because body in HTTP/2 is always
segmented thanks to its framing layer. Meanwhile, we have to
call Curl_read to ensure that http2_handle_stream_close is
called when we read all incoming bytes for a particular
stream. */
- !((conn->handler->protocol & PROTO_FAMILY_HTTP) &&
- conn->httpversion == 20) &&
+ !is_http2 &&
#endif
k->size != -1 && !k->header) {
/* make sure we don't read too much */
@@ -621,9 +624,14 @@ static CURLcode readwrite_data(struct Curl_easy *data,
k->buf[nread] = 0;
}
else {
- /* if we receive 0 or less here, the server closed the connection
- and we bail out from this! */
- DEBUGF(infof(data, "nread <= 0, server closed connection, bailing\n"));
+ /* if we receive 0 or less here, either the http2 stream is closed or the
+ server closed the connection and we bail out from this! */
+#ifdef USE_NGHTTP2
+ if(is_http2 && !nread)
+ DEBUGF(infof(data, "nread == 0, stream closed, bailing\n"));
+ else
+#endif
+ DEBUGF(infof(data, "nread <= 0, server closed connection, bailing\n"));
k->keepon &= ~KEEP_RECV;
break;
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 47/264: tests: make Python-based servers compatible with Python 2 and 3, (continued)
- [gnurl] 47/264: tests: make Python-based servers compatible with Python 2 and 3, gnunet, 2020/04/30
- [gnurl] 45/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 48/264: openssl: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 49/264: gnutls: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 44/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 51/264: wolfssl: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 33/264: ci/tests: increase timeouts for torture builds on Azure Pipelines, gnunet, 2020/04/30
- [gnurl] 59/264: ci/tests: fix Azure Pipelines not running Windows containers, gnunet, 2020/04/30
- [gnurl] 54/264: secure transport: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 57/264: cmdline: fix handling of OperationConfig linked list (--next), gnunet, 2020/04/30
- [gnurl] 43/264: http2: Fix erroneous debug message that h2 connection closed,
gnunet <=
- [gnurl] 52/264: bearssl: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 64/264: CURLINFO_NUM_CONNECTS: improve accuracy, gnunet, 2020/04/30
- [gnurl] 66/264: getinfo: provide CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE override, gnunet, 2020/04/30
- [gnurl] 16/264: ci/tests: install test suite dependencies stunnel and impacket, gnunet, 2020/04/30
- [gnurl] 69/264: cirrus: make freebsd ignore the tests instead of skipping, gnunet, 2020/04/30
- [gnurl] 71/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 21/264: select: add 'timeout_ms' wrap-around precaution to Curl_select, gnunet, 2020/04/30
- [gnurl] 79/264: travis: update the ngtcp2 build to use the latest OpenSSL patch, gnunet, 2020/04/30
- [gnurl] 70/264: OS400: Update strings for ccsid-ifier, gnunet, 2020/04/30
- [gnurl] 73/264: packages: add OS400/chkstrings.c to the dist, gnunet, 2020/04/30