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.
This commit is contained in:
Daniel Stenberg
2015-04-29 14:19:39 +02:00
parent 5fe71975e4
commit 2c238ea1fc
3 changed files with 118 additions and 84 deletions

View File

@@ -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;
}