From: Daniel Stenberg Date: Thu, 4 Aug 2016 22:42:52 +0000 (+0200) Subject: http2: always wait for readable socket X-Git-Tag: curl-7_50_2~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea45b4334f45b4b51484e7728719143441bc3e2a;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/http2.c b/lib/http2.c index 5bed6fcdf1..8852088005 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);