agentkeepalive
Advanced tools
Comparing version 2.0.2 to 2.0.3
2.0.3 / 2015-08-03 | ||
================== | ||
* fix: add default error handler to avoid Unhandled error event throw | ||
2.0.2 / 2015-04-25 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -260,2 +260,10 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
// Add a default error handler to avoid Unhandled 'error' event throw | ||
// https://github.com/node-modules/agentkeepalive/issues/25 | ||
function onError(err) { | ||
debug('CLIENT socket onError: %s', err); | ||
self.emit('error', err); | ||
} | ||
s.on('error', onError); | ||
function onRemove() { | ||
@@ -270,2 +278,3 @@ // We need this function for cases like HTTP 'upgrade' | ||
s.removeListener('agentRemove', onRemove); | ||
s.removeListener('error', onError); | ||
// remove timer | ||
@@ -272,0 +281,0 @@ s.setTimeout(0, onTimeout); |
@@ -11,2 +11,3 @@ /**! | ||
* Copyright(c) 2012 - 2014 fengmk2 <fengmk2@gmail.com> | ||
* Copyright(c) node-modules | ||
* MIT Licensed | ||
@@ -61,2 +62,4 @@ */ | ||
self.closeSocketCount = 0; | ||
// socket error event count | ||
self.errorSocketCount = 0; | ||
self.requestCount = 0; | ||
@@ -73,2 +76,5 @@ self.timeoutSocketCount = 0; | ||
}); | ||
self.on('error', function () { | ||
self.errorSocketCount++; | ||
}); | ||
} | ||
@@ -93,2 +99,3 @@ | ||
closeSocketCount: this.closeSocketCount, | ||
errorSocketCount: this.errorSocketCount, | ||
timeoutSocketCount: this.timeoutSocketCount, | ||
@@ -95,0 +102,0 @@ requestCount: this.requestCount, |
{ | ||
"name": "agentkeepalive", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Missing keepalive http.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
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
24688
418