summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-11-30 00:11:42 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-11-30 00:11:42 +0100
commit8f281fb76d34d8d0ef54e591979a01e0f50a944c (patch)
treea51a8ff96cbd858748ead6f7b876bbd8b5e66fbb
parent8cbd80686e09fb74178d5474c4cac1412f646b88 (diff)
downloadgnurl-8f281fb76d34d8d0ef54e591979a01e0f50a944c.tar.gz
gnurl-8f281fb76d34d8d0ef54e591979a01e0f50a944c.tar.bz2
gnurl-8f281fb76d34d8d0ef54e591979a01e0f50a944c.zip
http2 push: add missing inits of new stream
- set the correct stream_id for pushed streams - init maxdownload and size properly
-rw-r--r--lib/http2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 877328207..0a68cbb05 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -329,12 +329,13 @@ static int push_promise(struct SessionHandle *data,
frame->promised_stream_id));
if(data->multi->push_cb) {
struct HTTP *stream;
+ struct HTTP *newstream;
struct curl_pushheaders heads;
CURLMcode rc;
struct http_conn *httpc;
size_t i;
/* clone the parent */
- CURL *newhandle = duphandle(data);
+ struct SessionHandle *newhandle = duphandle(data);
if(!newhandle) {
infof(data, "failed to duplicate handle\n");
rv = 1; /* FAIL HARD */
@@ -369,6 +370,11 @@ static int push_promise(struct SessionHandle *data,
goto fail;
}
+ newstream = newhandle->req.protop;
+ newstream->stream_id = frame->promised_stream_id;
+ newhandle->req.maxdownload = -1;
+ newhandle->req.size = -1;
+
/* approved, add to the multi handle and immediately switch to PERFORM
state with the given connection !*/
rc = Curl_multi_add_perform(data->multi, newhandle, conn);