Ignore an EPIPE thrown after a transmission error.

This is a harmless error and nothing seems to suppress it, so we'll ignore it in the right circumstances.
This commit is contained in:
Andrew Naylor 2013-05-25 13:03:04 +01:00
Родитель 2a08286fe2
Коммит cdeb522064
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -290,6 +290,12 @@ Connection.prototype.initialisingConnection = function() {
*/
Connection.prototype.errorOccurred = function(socket, 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.socket == socket && this.deferredConnection && this.deferredConnection.promise.isPending()) {
this.deferredConnection.reject(err);
@ -452,6 +458,8 @@ Connection.prototype.handleTransmissionError = function (socket, data) {
this.bufferNotification(notification);
}
}
socket.transmissionErrorOccurred = true;
}
};