|
|
be9feb |
From affcd7c5dfde7af4558601518c033725b83068bc Mon Sep 17 00:00:00 2001
|
|
|
be9feb |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
be9feb |
Date: Fri, 22 May 2020 15:12:15 +0200
|
|
|
be9feb |
Subject: [PATCH] http: free protocol-specific struct in setup_connection
|
|
|
be9feb |
callback
|
|
|
be9feb |
|
|
|
be9feb |
... so that it can be setup properly later on
|
|
|
be9feb |
---
|
|
|
be9feb |
lib/http.c | 11 +++++++++--
|
|
|
be9feb |
1 file changed, 9 insertions(+), 2 deletions(-)
|
|
|
be9feb |
|
|
|
be9feb |
diff --git a/lib/http.c b/lib/http.c
|
|
|
be9feb |
index 46734c4..996106f 100644
|
|
|
be9feb |
--- a/lib/http.c
|
|
|
be9feb |
+++ b/lib/http.c
|
|
|
be9feb |
@@ -98,12 +98,19 @@ static int https_getsock(struct connectdata *conn,
|
|
|
be9feb |
#define https_connecting(x,y) CURLE_COULDNT_CONNECT
|
|
|
be9feb |
#endif
|
|
|
be9feb |
|
|
|
be9feb |
+static CURLcode Curl_http_setup_conn(struct connectdata *conn)
|
|
|
be9feb |
+{
|
|
|
be9feb |
+ /* free protocol-specific struct so that it can be setup properly later on */
|
|
|
be9feb |
+ Curl_safefree(conn->data->state.proto.http);
|
|
|
be9feb |
+ return CURLE_OK;
|
|
|
be9feb |
+}
|
|
|
be9feb |
+
|
|
|
be9feb |
/*
|
|
|
be9feb |
* HTTP handler interface.
|
|
|
be9feb |
*/
|
|
|
be9feb |
const struct Curl_handler Curl_handler_http = {
|
|
|
be9feb |
"HTTP", /* scheme */
|
|
|
be9feb |
- ZERO_NULL, /* setup_connection */
|
|
|
be9feb |
+ Curl_http_setup_conn, /* setup_connection */
|
|
|
be9feb |
Curl_http, /* do_it */
|
|
|
be9feb |
Curl_http_done, /* done */
|
|
|
be9feb |
ZERO_NULL, /* do_more */
|
|
|
be9feb |
@@ -127,7 +134,7 @@ const struct Curl_handler Curl_handler_http = {
|
|
|
be9feb |
*/
|
|
|
be9feb |
const struct Curl_handler Curl_handler_https = {
|
|
|
be9feb |
"HTTPS", /* scheme */
|
|
|
be9feb |
- ZERO_NULL, /* setup_connection */
|
|
|
be9feb |
+ Curl_http_setup_conn, /* setup_connection */
|
|
|
be9feb |
Curl_http, /* do_it */
|
|
|
be9feb |
Curl_http_done, /* done */
|
|
|
be9feb |
ZERO_NULL, /* do_more */
|
|
|
be9feb |
--
|
|
|
be9feb |
1.8.3.1
|
|
|
be9feb |
|