mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:33:31 +03:00
http2: several cleanups
- separate easy handle from connections better - added asserts on a number of places - added sanity check of pipelines for debug builds Closes #2751
This commit is contained in:
parent
73af7bcd61
commit
7b9bc96c77
7 changed files with 43 additions and 70 deletions
|
|
@ -154,6 +154,11 @@ static void http2_stream_free(struct HTTP *http)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Disconnects *a* connection used for HTTP/2. It might be an old one from the
|
||||
* connection cache and not the "main" one. Don't touch the easy handle!
|
||||
*/
|
||||
|
||||
static CURLcode http2_disconnect(struct connectdata *conn,
|
||||
bool dead_connection)
|
||||
{
|
||||
|
|
@ -164,8 +169,6 @@ static CURLcode http2_disconnect(struct connectdata *conn,
|
|||
|
||||
nghttp2_session_del(c->h2);
|
||||
Curl_safefree(c->inbuf);
|
||||
http2_stream_free(conn->data->req.protop);
|
||||
conn->data->state.drain = 0;
|
||||
|
||||
H2BUGF(infof(conn->data, "HTTP/2 DISCONNECT done\n"));
|
||||
|
||||
|
|
@ -520,6 +523,7 @@ static int push_promise(struct Curl_easy *data,
|
|||
if(rv) {
|
||||
/* denied, kill off the new handle again */
|
||||
http2_stream_free(newhandle->req.protop);
|
||||
newhandle->req.protop = NULL;
|
||||
(void)Curl_close(newhandle);
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -535,6 +539,7 @@ static int push_promise(struct Curl_easy *data,
|
|||
if(rc) {
|
||||
infof(data, "failed to add handle to multi\n");
|
||||
http2_stream_free(newhandle->req.protop);
|
||||
newhandle->req.protop = NULL;
|
||||
Curl_close(newhandle);
|
||||
rv = 1;
|
||||
goto fail;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue