diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-08-05 00:42:52 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-08-05 00:44:01 +0200 |
commit | ea45b4334f45b4b51484e7728719143441bc3e2a (patch) | |
tree | 81ec84d63398cc25e6e3f56d5d95df2929a5e1aa | |
parent | 9803e832d9a31a7fa36fefe6e816ad60179d7e8d (diff) |
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
-rw-r--r-- | lib/http2.c | 5 |
1 files 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); |