aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-05-08 15:53:18 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-18 08:57:18 +0200
commitbe4c8fd1ef11a565fcfceed48d40aa9889f095d4 (patch)
treef789720c908f7119cf1c6abf4b7222798e503a13 /lib/http2.c
parent783b3c7b427dce4b1906709cef350af5e9623673 (diff)
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!
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 7070df511..b492e286a 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1168,6 +1168,9 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
stream->stream_id = -1;
+ if(!stream->header_recvbuf)
+ stream->header_recvbuf = Curl_add_buffer_init();
+
if((conn->handler == &Curl_handler_http2_ssl) ||
(conn->handler == &Curl_handler_http2))
return CURLE_OK; /* already done */