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:
14
lib/http.c
14
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user