Comparing version 1.3.3 to 1.3.4
## Changelog | ||
1.3.4: | ||
* Fixed #101: TypeError: Cannot call method 'resolve' of null | ||
1.3.3: | ||
@@ -4,0 +8,0 @@ |
@@ -82,2 +82,4 @@ var Errors = require('./errors'); | ||
this.socketId = 0; | ||
events.EventEmitter.call(this); | ||
@@ -226,2 +228,3 @@ } | ||
this.connect().then(function () { | ||
this.socket.socketId = this.socketId++; | ||
this.socket.currentId = 0; | ||
@@ -291,5 +294,11 @@ this.socket.cachedNotifications = []; | ||
Connection.prototype.errorOccurred = function(socket, err) { | ||
debug("Socket error occurred", err); | ||
debug("Socket error occurred", socket.socketId, err); | ||
if(socket.transmissionErrorOccurred && err.code == 'EPIPE') { | ||
debug("EPIPE occurred after a transmission error which we can ignore"); | ||
return; | ||
} | ||
this.emit('socketError', err); | ||
if(this.deferredConnection && this.deferredConnection.promise.isPending()) { | ||
if(this.socket == socket && this.deferredConnection && this.deferredConnection.promise.isPending()) { | ||
this.deferredConnection.reject(err); | ||
@@ -317,3 +326,3 @@ } | ||
Connection.prototype.socketDrained = function(socket, serviceBuffer) { | ||
debug("Socket drained"); | ||
debug("Socket drained", socket.socketId); | ||
socket.busy = false; | ||
@@ -344,3 +353,3 @@ if(this.options.enhanced) { | ||
Connection.prototype.socketTimeout = function(socket) { | ||
debug("Socket timeout"); | ||
debug("Socket timeout", socket.socketId); | ||
this.emit('timeout'); | ||
@@ -354,3 +363,3 @@ socket.end(); | ||
Connection.prototype.destroyConnection = function(socket) { | ||
debug("Destroying connection"); | ||
debug("Destroying connection", socket.socketId); | ||
if (socket) { | ||
@@ -365,3 +374,3 @@ socket.destroy(); | ||
Connection.prototype.socketClosed = function(socket) { | ||
debug("Socket closed"); | ||
debug("Socket closed", socket.socketId); | ||
@@ -459,2 +468,4 @@ if (socket === this.socket && !this.deferredConnection.promise.isPending()) { | ||
} | ||
socket.transmissionErrorOccurred = true; | ||
} | ||
@@ -461,0 +472,0 @@ }; |
@@ -16,2 +16,3 @@ /** | ||
'invalidToken': 8, | ||
'apnsShutdown': 10, | ||
'none': 255 | ||
@@ -18,0 +19,0 @@ }; |
{ | ||
"name": "apn", | ||
"description": "An interface to the Apple Push Notification service for Node.js", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"author": "Andrew Naylor <argon@mkbot.net>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
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
73190
1103