http2 push: add missing inits of new stream
- set the correct stream_id for pushed streams - init maxdownload and size properly
This commit is contained in:
@@ -329,12 +329,13 @@ static int push_promise(struct SessionHandle *data,
|
|||||||
frame->promised_stream_id));
|
frame->promised_stream_id));
|
||||||
if(data->multi->push_cb) {
|
if(data->multi->push_cb) {
|
||||||
struct HTTP *stream;
|
struct HTTP *stream;
|
||||||
|
struct HTTP *newstream;
|
||||||
struct curl_pushheaders heads;
|
struct curl_pushheaders heads;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
struct http_conn *httpc;
|
struct http_conn *httpc;
|
||||||
size_t i;
|
size_t i;
|
||||||
/* clone the parent */
|
/* clone the parent */
|
||||||
CURL *newhandle = duphandle(data);
|
struct SessionHandle *newhandle = duphandle(data);
|
||||||
if(!newhandle) {
|
if(!newhandle) {
|
||||||
infof(data, "failed to duplicate handle\n");
|
infof(data, "failed to duplicate handle\n");
|
||||||
rv = 1; /* FAIL HARD */
|
rv = 1; /* FAIL HARD */
|
||||||
@@ -369,6 +370,11 @@ static int push_promise(struct SessionHandle *data,
|
|||||||
goto fail;
|
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
|
/* approved, add to the multi handle and immediately switch to PERFORM
|
||||||
state with the given connection !*/
|
state with the given connection !*/
|
||||||
rc = Curl_multi_add_perform(data->multi, newhandle, conn);
|
rc = Curl_multi_add_perform(data->multi, newhandle, conn);
|
||||||
|
Reference in New Issue
Block a user