Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Fix node-ldapjs#329
Browse files Browse the repository at this point in the history
  • Loading branch information
moghammed committed Dec 2, 2021
1 parent 1f85db9 commit 1abf39b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/client/client.js
Expand Up @@ -1273,11 +1273,18 @@ Client.prototype._sendSocket = function _sendSocket (message,
log.trace('sending request %j', message.json)

try {
return conn.write(message.toBer(), writeCallback)
if (expect === 'unbind') {
return conn.write(message.toBer(), writeCallback)
} else {
writeCallback()
return conn.write(message.toBer())
}
} catch (e) {
if (timer) { clearTimeout(timer) }

log.trace({ err: e }, 'Error writing message to socket')
emitter.emit('error', e)

return callback(e)
}
}
Expand Down

0 comments on commit 1abf39b

Please sign in to comment.