This commit is contained in:
Tatsuhiro Tsujikawa 2017-01-24 22:59:01 +09:00
parent ba9f2c3ae2
commit becae65257
1 changed files with 12 additions and 5 deletions

View File

@ -1051,17 +1051,24 @@ nghttp2_stream *nghttp2_session_open_stream(nghttp2_session *session,
flags |= NGHTTP2_STREAM_FLAG_PUSH;
}
nghttp2_stream_init(stream, stream_id, flags, initial_state, pri_spec->weight,
if (stream_alloc) {
nghttp2_stream_init(stream, stream_id, flags, initial_state,
pri_spec->weight,
(int32_t)session->remote_settings.initial_window_size,
(int32_t)session->local_settings.initial_window_size,
stream_user_data, mem);
if (stream_alloc) {
rv = nghttp2_map_insert(&session->streams, &stream->map_entry);
if (rv != 0) {
nghttp2_stream_free(stream);
nghttp2_mem_free(mem, stream);
return NULL;
}
} else {
stream->flags = flags;
stream->state = initial_state;
stream->weight = pri_spec->weight;
stream->stream_user_data = stream_user_data;
}
switch (initial_state) {