Skip to content

Commit

Permalink
fix: unref socket timer on dummy body line
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Jul 29, 2020
1 parent 9cefc90 commit e1227cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ class Parser extends HTTPParser {
[HTTPParser.kOnBody] (chunk, offset, length) {
const { client, socket, statusCode } = this

if (length === 1) {
// https://github.com/mcollina/undici/issues/269
this.socket._unrefTimer()
}

assert(statusCode >= 200)

const request = client[kQueue][client[kRunningIdx]]
Expand Down

0 comments on commit e1227cd

Please sign in to comment.