Skip to content

Commit

Permalink
Merge branch 'w/7.7/bugfix/S3C-2623_Explicit_socket_destroyed_check' …
Browse files Browse the repository at this point in the history
…into tmp/octopus/w/8.1/bugfix/S3C-2623_Explicit_socket_destroyed_check
  • Loading branch information
bert-e committed Feb 23, 2020
2 parents bab9d5d + 80d231a commit fb18cba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/network/kmip/transport/TransportTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class TransportTemplate {

_doSend(logger, encodedMessage, cb) {
const socket = this.socket;
if (!socket) {
if (!socket || socket.destroyed) {
const error = new Error('Socket to server not available');
logger.error('TransportTemplate::_doSend', { error });
return cb(error);
Expand All @@ -138,7 +138,7 @@ class TransportTemplate {
return this.deferedRequests.push({ encodedMessage, cb });
}
assert(encodedMessage.length !== 0);
if (this.socket === null) {
if (this.socket === null || this.socket.destroyed) {
return this._createConversation(logger, err => {
if (err) {
return cb(err);
Expand Down

0 comments on commit fb18cba

Please sign in to comment.