diff options
author | Anders Bakken <agbakken@gmail.com> | 2015-08-10 17:26:36 -0700 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-08-11 08:16:33 +0200 |
commit | 5778e6f526e2399ca7d01e6599381ab83d6b3021 (patch) | |
tree | 3437a1dcc359aa345ddca72c11da36796c92dded /lib/http.c | |
parent | c8a656d3c774fa7556a298e707484b9b62274765 (diff) | |
download | curl-5778e6f526e2399ca7d01e6599381ab83d6b3021.tar.gz |
http2: discard frames with no SessionHandle
Return 0 instead of NGHTTP2_ERR_CALLBACK_FAILURE if we can't locate the
SessionHandle. Apparently mod_h2 will sometimes send a frame for a
stream_id we're finished with.
Use nghttp2_session_get_stream_user_data and
nghttp2_session_set_stream_user_data to identify SessionHandles instead
of a hash.
Closes #372
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c index 8d5b9a408..9817d72af 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1443,7 +1443,10 @@ CURLcode Curl_http_done(struct connectdata *conn, CURLcode status, bool premature) { struct SessionHandle *data = conn->data; - struct HTTP *http =data->req.protop; + struct HTTP *http = data->req.protop; +#ifdef USE_NGHTTP2 + struct http_conn *httpc = &conn->proto.httpc; +#endif Curl_unencode_cleanup(conn); @@ -1482,6 +1485,10 @@ CURLcode Curl_http_done(struct connectdata *conn, free(http->push_headers); http->push_headers = NULL; } + if(http->stream_id) { + nghttp2_session_set_stream_user_data(httpc->h2, http->stream_id, 0); + http->stream_id = 0; + } #endif if(HTTPREQ_POST_FORM == data->set.httpreq) { |