http: a stream hash for h2 multiplexing

This commit is contained in:
Daniel Stenberg 2015-04-28 13:10:04 +02:00
parent 47caff7bdf
commit 7957d2eb92
2 changed files with 8 additions and 0 deletions

View File

@ -191,6 +191,9 @@ struct http_conn {
size_t upload_len; /* size of the buffer 'upload_mem' points to */ size_t upload_len; /* size of the buffer 'upload_mem' points to */
size_t upload_left; /* number of bytes left to upload */ size_t upload_left; /* number of bytes left to upload */
int status_code; /* HTTP status code */ int status_code; /* HTTP status code */
/* this is a hash of all individual streams (SessionHandle structs) */
struct curl_hash streamsh;
#else #else
int unused; /* prevent a compiler warning */ int unused; /* prevent a compiler warning */
#endif #endif

View File

@ -623,6 +623,11 @@ CURLcode Curl_http2_init(struct connectdata *conn)
failf(conn->data, "Couldn't initialize nghttp2!"); failf(conn->data, "Couldn't initialize nghttp2!");
return CURLE_OUT_OF_MEMORY; /* most likely at least */ 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; return CURLE_OK;
} }