]> granicus.if.org Git - curl/commitdiff
Curl_disconnect: treat all CONNECT_ONLY connections as "dead"
authorDaniel Stenberg <daniel@haxx.se>
Fri, 19 Apr 2019 14:58:27 +0000 (16:58 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 20 Apr 2019 10:40:45 +0000 (12:40 +0200)
Since the connection has been used by the "outside" we don't know the
state of it anymore and curl should not use it anymore.

Bug: https://curl.haxx.se/mail/lib-2019-04/0052.html

Closes #3795

lib/url.c

index 75de68f3c64cf909748748c8fd5de4268ec7c884..8aefd15831a98f766cb3a6383a5d5315314cc6b1 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -809,6 +809,10 @@ CURLcode Curl_disconnect(struct Curl_easy *data,
      for the connection! */
   conn->data = data;
 
+  if(conn->bits.connect_only)
+    /* treat the connection as dead in CONNECT_ONLY situations */
+    dead_connection = TRUE;
+
   if(conn->handler->disconnect)
     /* This is set if protocol-specific cleanups should be made */
     conn->handler->disconnect(conn, dead_connection);