]> granicus.if.org Git - curl/commitdiff
http2: Ignore if we have stream ID not in hash in on_stream_close
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Sat, 16 May 2015 09:13:10 +0000 (18:13 +0900)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 May 2015 07:33:48 +0000 (09:33 +0200)
We could get stream ID not in the hash in on_stream_close.  For
example, if we decided to reject stream (e.g., PUSH_PROMISE), then we
don't create stream and store it in hash with its stream ID.

lib/http2.c

index 951a0a8845578f4797ce0516873d3fc7eeb23ca6..d50f1731e309b8fbbc6789cdfea4ca1734de5355 100644 (file)
@@ -431,11 +431,13 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
     data_s = Curl_hash_pick(&conn->proto.httpc.streamsh, &stream_id,
                             sizeof(stream_id));
     if(!data_s) {
-      /* Receiving a Stream ID not in the hash should not happen, this is an
-         internal error more than anything else! */
-      failf(conn->data, "Received frame on Stream ID: %x not in stream hash!",
+      /* We could get stream ID not in the hash.  For example, if we
+         decided to reject stream (e.g., PUSH_PROMISE).  We call infof
+         as a debugging purpose for now. */
+      infof(conn->data,
+            "Received frame on Stream ID: %x not in stream hash!\n",
             stream_id);
-      return NGHTTP2_ERR_CALLBACK_FAILURE;
+      return 0;
     }
     stream = data_s->req.protop;