Comparing version 1.0.0 to 1.0.1
13
http.js
@@ -69,3 +69,3 @@ 'use strict'; | ||
if (!socket.destroyed && self.requests[name] && self.requests[name].length) { | ||
if (!self.isSocketDestroyed(socket) && self.requests[name] && self.requests[name].length) { | ||
self.requests[name].shift().onSocket(socket); | ||
@@ -81,3 +81,3 @@ if (self.requests[name].length === 0) { | ||
var req = socket._httpMessage; | ||
if (req && req.shouldKeepAlive && !socket.destroyed && self.options.keepAlive) { | ||
if (req && req.shouldKeepAlive && !self.isSocketDestroyed(socket) && self.options.keepAlive) { | ||
var freeSockets = self.freeSockets[name]; | ||
@@ -138,2 +138,7 @@ var freeLen = freeSockets ? freeSockets.length : 0; | ||
Agent.prototype.isSocketDestroyed = function(socket) { | ||
// Different Node versions have different names for the property | ||
return socket.destroyed || socket._destroyed; | ||
}; | ||
// Get the key for a given set of request options | ||
@@ -270,3 +275,3 @@ Agent.prototype.getName = function(options) { | ||
var name = this.getName(options); | ||
debug('removeSocket', name, 'destroyed:', s.destroyed); | ||
debug('removeSocket', name, 'destroyed:', this.isSocketDestroyed(s)); | ||
var sets = [this.sockets]; | ||
@@ -277,3 +282,3 @@ | ||
// If the socket was destroyed, remove it from the free buffers too. | ||
if (s.destroyed) | ||
if (this.isSocketDestroyed(s)) | ||
sets.push(this.freeSockets); | ||
@@ -280,0 +285,0 @@ |
{ | ||
"name": "yakaa", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Yet Another Keep-Alive Agent", | ||
@@ -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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
26373
496
5