http2: lazy init header_recvbuf
It makes us use less memory when not doing HTTP/2 and subsequently also makes us not have to cleanup HTTP/2 related data when not using HTTP/2!
This commit is contained in:
parent
783b3c7b42
commit
be4c8fd1ef
@ -163,7 +163,6 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
|
|||||||
|
|
||||||
conn->data->req.protop = http;
|
conn->data->req.protop = http;
|
||||||
|
|
||||||
http->header_recvbuf = Curl_add_buffer_init();
|
|
||||||
http->nread_header_recvbuf = 0;
|
http->nread_header_recvbuf = 0;
|
||||||
http->bodystarted = FALSE;
|
http->bodystarted = FALSE;
|
||||||
http->status_code = -1;
|
http->status_code = -1;
|
||||||
|
@ -1168,6 +1168,9 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
|
|||||||
|
|
||||||
stream->stream_id = -1;
|
stream->stream_id = -1;
|
||||||
|
|
||||||
|
if(!stream->header_recvbuf)
|
||||||
|
stream->header_recvbuf = Curl_add_buffer_init();
|
||||||
|
|
||||||
if((conn->handler == &Curl_handler_http2_ssl) ||
|
if((conn->handler == &Curl_handler_http2_ssl) ||
|
||||||
(conn->handler == &Curl_handler_http2))
|
(conn->handler == &Curl_handler_http2))
|
||||||
return CURLE_OK; /* already done */
|
return CURLE_OK; /* already done */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user