Comparing version 2.0.5 to 2.0.6
@@ -624,3 +624,3 @@ 'use strict' | ||
util.destroy(socket, new InformationalError('reset')) | ||
} else if (client[kReset]) { | ||
} else if (client[kReset] && !client.running) { | ||
// Destroy socket once all requests have completed. | ||
@@ -630,5 +630,3 @@ // The request at the tail of the pipeline is the one | ||
// have been queued since then. | ||
if (!client.running) { | ||
util.destroy(socket, new InformationalError('reset')) | ||
} | ||
util.destroy(socket, new InformationalError('reset')) | ||
} else { | ||
@@ -803,3 +801,6 @@ socket[kResume]() | ||
this._handle.reading = false | ||
this._handle.readStop() | ||
const err = this._handle.readStop() | ||
if (err) { | ||
this.destroy(util.errnoException(err, 'read')) | ||
} | ||
} | ||
@@ -812,3 +813,6 @@ } | ||
this._handle.reading = true | ||
this._handle.readStart() | ||
const err = this._handle.readStart() | ||
if (err) { | ||
this.destroy(util.errnoException(err, 'read')) | ||
} | ||
} | ||
@@ -935,2 +939,7 @@ } | ||
if (client.running && !client[kKeepAlive]) { | ||
// Don't schedule more if we know connection will reset. | ||
return | ||
} | ||
if (client.running && !request.idempotent) { | ||
@@ -937,0 +946,0 @@ // Non-idempotent request cannot be retried. |
@@ -6,2 +6,3 @@ 'use strict' | ||
const { IncomingMessage } = require('http') | ||
const util = require('util') | ||
@@ -80,4 +81,16 @@ function nop () {} | ||
function errnoException (code, syscall) { | ||
const name = util.getSystemErrorName(code) | ||
const err = new Error(`${syscall} ${name}`) | ||
err.errno = err | ||
err.code = code | ||
err.syscall = syscall | ||
return err | ||
} | ||
module.exports = { | ||
nop, | ||
errnoException, | ||
isStream, | ||
@@ -84,0 +97,0 @@ isDestroyed, |
{ | ||
"name": "undici", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "An HTTP/1.1 client, written from scratch for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
355596
11626