From 3533def3d556e09f178e52e37b89fe8015b907f9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 11 Aug 2016 14:00:23 +0200 Subject: http2: make sure stream errors don't needlessly close the connection With HTTP/2 each transfer is made in an indivial logical stream over the connection, making most previous errors that caused the connection to get forced-closed now instead just kill the stream and not the connection. Fixes #941 --- lib/url.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 29c32cfba..f355c7a22 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2830,6 +2830,17 @@ CURLcode Curl_disconnect(struct connectdata *conn, bool dead_connection) return CURLE_OK; } + /* + * If this connection isn't marked to force-close, leave it open if there + * are other users of it + */ + if(!conn->bits.close && + (conn->send_pipe->size + conn->recv_pipe->size)) { + DEBUGF(infof(data, "Curl_disconnect, usecounter: %d\n", + conn->send_pipe->size + conn->recv_pipe->size)); + return CURLE_OK; + } + if(conn->dns_entry != NULL) { Curl_resolv_unlock(data, conn->dns_entry); conn->dns_entry = NULL; -- cgit v1.2.3