From ea45b4334f45b4b51484e7728719143441bc3e2a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Aug 2016 00:42:52 +0200 Subject: [PATCH] http2: always wait for readable socket Since the server can at any time send a HTTP/2 frame to us, we need to wait for the socket to be readable during all transfers so that we can act on incoming frames even when uploading etc. Reminded-by: Tatsuhiro Tsujikawa --- lib/http2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/http2.c b/lib/http2.c index 5bed6fcdf..885208800 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -92,8 +92,9 @@ static int http2_perform_getsock(const struct connectdata *conn, because of renegotiation. */ sock[0] = conn->sock[FIRSTSOCKET]; - if(nghttp2_session_want_read(c->h2)) - bitmap |= GETSOCK_READSOCK(FIRSTSOCKET); + /* in a HTTP/2 connection we can basically always get a frame so we should + always be ready for one */ + bitmap |= GETSOCK_READSOCK(FIRSTSOCKET); if(nghttp2_session_want_write(c->h2)) bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET);