From 7eebf9a3fb7058ca95038450184ec44609a0daa7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 9 Feb 2015 22:30:24 +0900 Subject: http2: Fix bug that associated stream canceled on PUSH_PROMISE 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/http2.c b/lib/http2.c index dac9ab4a1..31949413b 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -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; } -- cgit v1.2.3