aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-08-20 13:19:08 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-08-21 08:04:38 +0200
commite29ff2be2f4ae0dace025672e0289104d58adb2a (patch)
treebcb8ec5ea37dac606b1aac9c5cca87800f0f3d30
parent9dad3bd6652224aa9a1ce1994a082b000243e09c (diff)
http2: avoid set_stream_user_data() before stream is assigned
... before the stream is started, we have it set to -1. Fixes #2894 Closes #2898
-rw-r--r--lib/http2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 9380ca7cf..350642019 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1178,7 +1178,8 @@ void Curl_http2_done(struct connectdata *conn, bool premature)
httpc->pause_stream_id = 0;
}
}
- if(http->stream_id) {
+ /* -1 means unassigned and 0 means cleared */
+ if(http->stream_id > 0) {
int rv = nghttp2_session_set_stream_user_data(httpc->h2,
http->stream_id, 0);
if(rv) {