]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: Make HTTP Upgrade work
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Thu, 21 May 2015 16:21:59 +0000 (01:21 +0900)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 May 2015 07:31:19 +0000 (09:31 +0200)
This commit just add implicitly opened stream 1 to streams hash.

lib/http2.c

index 0e82a9f87d2b5eb5cb680e96e416748b1ca21a49..93182429554f0db6a0da77a96026be3e05471ef8 100644 (file)
@@ -1268,6 +1268,13 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
             nghttp2_strerror(rv), rv);
       return CURLE_HTTP2;
     }
+
+    /* put the SessionHandle in the hash with the stream->stream_id as key */
+    if(!Curl_hash_add(&httpc->streamsh, &stream->stream_id,
+                      sizeof(stream->stream_id), conn->data)) {
+      failf(conn->data, "Couldn't add stream to hash!");
+      return CURLE_OUT_OF_MEMORY;
+    }
   }
   else {
     /* stream ID is unknown at this point */