]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: Fix bug that associated stream canceled on PUSH_PROMISE
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Mon, 9 Feb 2015 13:30:24 +0000 (22:30 +0900)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 9 Feb 2015 14:52:56 +0000 (15:52 +0100)
Previously we don't ignore PUSH_PROMISE header fields in on_header
callback.  It makes header values mixed with following HEADERS,
resulting protocol error.

lib/http2.c

index dac9ab4a106f5abc8ffddb81181b2be7ad811b0f..31949413bb229b1d9bfce441efc2f937ab68e4a2 100644 (file)
@@ -424,6 +424,11 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
   (void)frame;
   (void)flags;
 
+  /* Ignore PUSH_PROMISE for now */
+  if(frame->hd.type != NGHTTP2_HEADERS) {
+    return 0;
+  }
+
   if(frame->hd.stream_id != c->stream_id) {
     return 0;
   }