aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-07-17 00:29:11 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-07-20 22:58:42 +0200
commit7b9bc96c7716f34dbd1f525aefb77d74b8b0f528 (patch)
tree3815a1f09eb5c3fcf6ea1fb81aa1cceb1b28d197 /lib/http.c
parent73af7bcd617a8c0312bd8a083daa5a8fad2c794e (diff)
http2: several cleanups
- separate easy handle from connections better - added asserts on a number of places - added sanity check of pipelines for debug builds Closes #2751
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/http.c b/lib/http.c
index 4ec5f2be6..9bbf59b79 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -158,18 +158,20 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
/* allocate the HTTP-specific struct for the Curl_easy, only to survive
during this request */
struct HTTP *http;
- DEBUGASSERT(conn->data->req.protop == NULL);
+ struct Curl_easy *data = conn->data;
+ DEBUGASSERT(data->req.protop == NULL);
http = calloc(1, sizeof(struct HTTP));
if(!http)
return CURLE_OUT_OF_MEMORY;
Curl_mime_initpart(&http->form, conn->data);
- conn->data->req.protop = http;
-
- Curl_http2_setup_conn(conn);
- Curl_http2_setup_req(conn->data);
+ data->req.protop = http;
+ if(!CONN_INUSE(conn))
+ /* if not alredy multi-using, setup connection details */
+ Curl_http2_setup_conn(conn);
+ Curl_http2_setup_req(data);
return CURLE_OK;
}
@@ -1913,6 +1915,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
}
http = data->req.protop;
+ DEBUGASSERT(http);
if(!data->state.this_is_a_follow) {
/* Free to avoid leaking memory on multiple requests*/