summaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-04-29 14:19:39 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-18 08:57:17 +0200
commit2c238ea1fc3b0979ebe6a6088591198df5ea5415 (patch)
tree56eb7af6982c2cd880fd477b83249c90298d04c1 /lib/http.c
parent5fe71975e428f41f10bc367b1753ed7ebc4e5205 (diff)
downloadcurl-2c238ea1fc3b0979ebe6a6088591198df5ea5415.tar.gz
http2: move lots of state data to the 'stream' struct
... from the connection struct. The stream one being the 'struct HTTP' which is kept in the SessionHandle struct (easy handle). lookup streams for incoming frames in the stream hash, hashing is based on the stream id and we get the SessionHandle for the incoming stream that way.
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index b1e555cf6..aa1dcbf0e 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -153,12 +153,22 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
{
/* allocate the HTTP-specific struct for the SessionHandle, only to survive
during this request */
+ struct HTTP *http;
DEBUGASSERT(conn->data->req.protop == NULL);
- conn->data->req.protop = calloc(1, sizeof(struct HTTP));
- if(!conn->data->req.protop)
+ http = calloc(1, sizeof(struct HTTP));
+ if(!http)
return CURLE_OUT_OF_MEMORY;
+ conn->data->req.protop = http;
+
+ http->header_recvbuf = Curl_add_buffer_init();
+ http->nread_header_recvbuf = 0;
+ http->bodystarted = FALSE;
+ http->status_code = -1;
+ http->data = NULL;
+ http->datalen = 0;
+
return CURLE_OK;
}