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 ea1c9e9 commit d1babf8
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 d1babf8

Please sign in to comment.