Skip to content
Permalink
Browse files

http2: move state-init from creation to pre-transfer

To make sure that the HTTP/2 state is initialized correctly for
duplicated handles. It would otherwise easily generate "spurious"
PRIORITY frames to get sent over HTTP/2 connections when duplicated easy
handles were used.

Reported-by: Daniel Silverstone
Fixes #4303
Closes #4442
  • Loading branch information...
bagder committed Sep 30, 2019
1 parent 02c6b98 commit 8a00560de2804fa8ab639c6e895ed3a7f1e75efc
Showing with 2 additions and 2 deletions.
  1. +1 −0 lib/http2.c
  2. +1 −0 lib/transfer.c
  3. +0 −2 lib/url.c
@@ -1537,6 +1537,7 @@ static int h2_session_send(struct Curl_easy *data,

H2BUGF(infof(data, "Queuing PRIORITY on stream %u (easy %p)\n",
stream->stream_id, data));
DEBUGASSERT(stream->stream_id != -1);
rv = nghttp2_submit_priority(h2, NGHTTP2_FLAG_NONE, stream->stream_id,
&pri_spec);
if(rv)
@@ -1510,6 +1510,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
}
}
#endif
Curl_http2_init_state(&data->state);
}

return result;
@@ -619,8 +619,6 @@ CURLcode Curl_open(struct Curl_easy **curl)

data->progress.flags |= PGRS_HIDE;
data->state.current_speed = -1; /* init to negative == impossible */

Curl_http2_init_state(&data->state);
}
}

0 comments on commit 8a00560

Please sign in to comment.
You can’t perform that action at this time.