disconnect: set conn->data for protocol disconnect 77/220577/1
authorDaniel Stenberg <daniel@haxx.se>
Thu, 19 Dec 2019 09:00:41 +0000 (14:30 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Thu, 19 Dec 2019 09:00:41 +0000 (14:30 +0530)
Follow-up to fb445a1e18d: Set conn->data explicitly to point out the
current transfer when invoking the protocol-specific disconnect function
so that it can work correctly.

Backported patch details:
https://github.com/curl/curl/commit/f3ce38739fa49008e36959aa8189c01ab1bad5b5

Change-Id: I0f86f4f9e086ebc0954f0d9935830bb93acb4090
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
lib/url.c

index f50a99b..68cbb65 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -785,6 +785,9 @@ CURLcode Curl_disconnect(struct Curl_easy *data,
   Curl_http_ntlm_cleanup(conn);
 #endif
 
+  /* the protocol specific disconnect handler needs a transfer for its
+     connection! */
+  conn->data = data;
   if(conn->handler->disconnect)
     /* This is set if protocol-specific cleanups should be made */
     conn->handler->disconnect(conn, dead_connection);