Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close the http2 connection when no more requests may be sent. #5643

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/http2.c
Expand Up @@ -1203,6 +1203,13 @@ void Curl_http2_done(struct Curl_easy *data, bool premature)
}
http->stream_id = 0;
}

if (0 == nghttp2_session_check_request_allowed(httpc->h2)) {
// No more requests are allowedi, indicating that this connection
// may no be reused. This is set when GOAWAY has been received or
// when no more stream identifiers can be allocated.
bagder marked this conversation as resolved.
Show resolved Hide resolved
connclose(data->conn, "http/2: No new requests allowed");
}
}

/*
Expand Down Expand Up @@ -2075,6 +2082,9 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex,

h2_pri_spec(conn->data, &pri_spec);

H2BUGF(infof(conn->data, "http2_send request allowed %d (easy handle %p)\n",
nghttp2_session_check_request_allowed(h2), (void*)conn->data));

switch(conn->data->state.httpreq) {
case HTTPREQ_POST:
case HTTPREQ_POST_FORM:
Expand Down