mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
http2: fix connection reuse when PING comes after last DATA
It turns out the google GFE HTTP/2 servers send a PING frame immediately after a stream ends and its last DATA has been received by curl. So if we don't drain that from the socket, it makes the socket readable in subsequent checks and libcurl then (wrongly) assumes the connection is dead when trying to reuse the connection. Reported-by: Joonas Kuorilehto Discussed in #750
This commit is contained in:
parent
e230044adf
commit
c8ab61312c
@ -1149,14 +1149,6 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
|
|||||||
|
|
||||||
(void)sockindex; /* we always do HTTP2 on sockindex 0 */
|
(void)sockindex; /* we always do HTTP2 on sockindex 0 */
|
||||||
|
|
||||||
/* If stream is closed, return 0 to signal the http routine to close
|
|
||||||
the connection. We need to handle stream closure here,
|
|
||||||
otherwise, we may be going to read from underlying connection,
|
|
||||||
and gets EAGAIN, and we will get stuck there. */
|
|
||||||
if(stream->memlen == 0 && stream->closed) {
|
|
||||||
return http2_handle_stream_close(conn, data, stream, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Nullify here because we call nghttp2_session_send() and they
|
/* Nullify here because we call nghttp2_session_send() and they
|
||||||
might refer to the old buffer. */
|
might refer to the old buffer. */
|
||||||
stream->upload_mem = NULL;
|
stream->upload_mem = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user