Skip to content

Commit

Permalink
h2: do not emit data after goaway (#3811)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina authored Nov 8, 2024
1 parent 928bd10 commit a2f63e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/dispatcher/client-h2.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,18 @@ function writeH2 (client, request) {
})

stream.once('error', function (err) {
stream.removeAllListeners('data')
abort(err)
})

stream.once('frameError', (type, code) => {
stream.removeAllListeners('data')
abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`))
})

// stream.on('aborted', () => {
// // TODO(HTTP/2): Support aborted
// })
stream.on('aborted', () => {
stream.removeAllListeners('data')
})

// stream.on('timeout', () => {
// // TODO(HTTP/2): Support timeout
Expand Down

0 comments on commit a2f63e7

Please sign in to comment.