]> granicus.if.org Git - curl/commitdiff
http: a stream hash for h2 multiplexing
authorDaniel Stenberg <daniel@haxx.se>
Tue, 28 Apr 2015 11:10:04 +0000 (13:10 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 May 2015 06:57:17 +0000 (08:57 +0200)
lib/http.h
lib/http2.c

index fb924c609443f98fefad687db288025eaf4de5bc..1fa85f76b0effa3cfcd00bb4b20b03df136e04b1 100644 (file)
@@ -191,6 +191,9 @@ struct http_conn {
   size_t upload_len; /* size of the buffer 'upload_mem' points to */
   size_t upload_left; /* number of bytes left to upload */
   int status_code; /* HTTP status code */
+
+  /* this is a hash of all individual streams (SessionHandle structs) */
+  struct curl_hash streamsh;
 #else
   int unused; /* prevent a compiler warning */
 #endif
index 7a2f032079272f62b142c719a9366463807b34d4..9e9d86a9b8b022067ffeef7a9404105552e1b5ae 100644 (file)
@@ -623,6 +623,11 @@ CURLcode Curl_http2_init(struct connectdata *conn)
       failf(conn->data, "Couldn't initialize nghttp2!");
       return CURLE_OUT_OF_MEMORY; /* most likely at least */
     }
+
+    rc = Curl_hash_init(&conn->proto.httpc.streamsh, 7, Curl_hash_str,
+                        Curl_str_key_compare, NULL);
+    if(rc)
+      return CURLE_OUT_OF_MEMORY; /* most likely at least */
   }
   return CURLE_OK;
 }