diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2018-05-17 23:03:15 +0400 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2018-05-22 11:42:33 +0400 |
commit | b11e19e8eed059ddf473657c28c357987ca0015e (patch) | |
tree | 60bdfb764feb1c62ff6326ef1532ef567d5a42d4 /src/node_http2.h | |
parent | 4f0ab76b6c29da74b29125a3ec83bb06e77c2aad (diff) | |
download | android-node-v8-b11e19e8eed059ddf473657c28c357987ca0015e.tar.gz android-node-v8-b11e19e8eed059ddf473657c28c357987ca0015e.tar.bz2 android-node-v8-b11e19e8eed059ddf473657c28c357987ca0015e.zip |
http2: fix several serious bugs
Currently http2 does not properly submit GOAWAY frames when a session
is being destroyed. It also doesn't properly handle when the other
party severs the connection after sending a GOAWAY frame, even though
it should.
Edge, IE & Safari are currently unable to handle empty TRAILERS
frames despite them being correctly to spec. Instead send an empty
DATA frame with END_STREAM flag in those situations.
Fix and adjust several flaky and/or incorrect tests.
PR-URL: https://github.com/nodejs/node/pull/20772
Fixes: https://github.com/nodejs/node/issues/20705
Fixes: https://github.com/nodejs/node/issues/20750
Fixes: https://github.com/nodejs/node/issues/20850
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r-- | src/node_http2.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/node_http2.h b/src/node_http2.h index f473e30286..043449624f 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -433,7 +433,8 @@ enum session_state_flags { SESSION_STATE_HAS_SCOPE = 0x1, SESSION_STATE_WRITE_SCHEDULED = 0x2, SESSION_STATE_CLOSED = 0x4, - SESSION_STATE_SENDING = 0x8, + SESSION_STATE_CLOSING = 0x8, + SESSION_STATE_SENDING = 0x10, }; // This allows for 4 default-sized frames with their frame headers @@ -619,7 +620,7 @@ class Http2Stream : public AsyncWrap, inline bool IsClosed() const { return flags_ & NGHTTP2_STREAM_FLAG_CLOSED; - } + } inline bool HasTrailers() const { return flags_ & NGHTTP2_STREAM_FLAG_TRAILERS; @@ -827,6 +828,9 @@ class Http2Session : public AsyncWrap, public StreamListener { // Schedule a write if nghttp2 indicates it wants to write to the socket. void MaybeScheduleWrite(); + // Stop reading if nghttp2 doesn't want to anymore. + void MaybeStopReading(); + // Returns pointer to the stream, or nullptr if stream does not exist inline Http2Stream* FindStream(int32_t id); |