Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow receipt of WINDOW_UPDATE on closed streams
https://httpwg.github.io/specs/rfc7540.html#StreamStates

'WINDOW_UPDATE or RST_STREAM frames can be received in this state for a
short period after a DATA or HEADERS frame containing an END_STREAM flag
is sent.'
  • Loading branch information
Tim Emiola committed Jan 18, 2016
commit 891464d9c14bb18430eaf26476180dfee21e925f
3 changes: 2 additions & 1 deletion lib/protocol/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,9 @@ Stream.prototype._transition = function transition(sending, frame) {
// can be used to close any of those streams.
case 'CLOSED':
if (PRIORITY || (sending && RST_STREAM) ||
(receiving && WINDOW_UPDATE) ||
(receiving && this._closedByUs &&
(this._closedWithRst || WINDOW_UPDATE || RST_STREAM || ALTSVC))) {
(this._closedWithRst || RST_STREAM || ALTSVC))) {
/* No state change */
} else {
streamError = 'STREAM_CLOSED';
Expand Down
2 changes: 1 addition & 1 deletion test/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe('stream.js', function() {
stream.headers({});
stream.end();
stream.upstream.write({ type: 'HEADERS', headers:{}, flags: { END_STREAM: true }, count_change: util.noop });
example_frames.slice(1).forEach(function(invalid_frame) {
example_frames.slice(2).forEach(function(invalid_frame) {
invalid_frame.count_change = util.noop;
expect(stream._transition.bind(stream, false, invalid_frame)).to.throw('Uncaught, unspecified "error" event.');
});
Expand Down