0.5.2 broke pooled SSL
This commit is contained in:
parent
0da050009b
commit
9d984b72fc
|
@ -703,12 +703,12 @@ Client.prototype._connect = function _connect() {
|
||||||
var socket = null;
|
var socket = null;
|
||||||
var timer = false;
|
var timer = false;
|
||||||
|
|
||||||
socket = proto.connect((this.port || this.socketPath), this.host);
|
function onConnect() {
|
||||||
|
if (timer)
|
||||||
socket.once('connect', function onConnect() {
|
|
||||||
if (timer)
|
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
|
|
||||||
|
socket.removeListener('connect', onConnect);
|
||||||
|
socket.removeListener('secureConnect', onConnect);
|
||||||
assert.ok(socket.ldap);
|
assert.ok(socket.ldap);
|
||||||
|
|
||||||
socket.ldap.id = nextClientId() + '__' + socket.ldap.id;
|
socket.ldap.id = nextClientId() + '__' + socket.ldap.id;
|
||||||
|
@ -718,8 +718,12 @@ Client.prototype._connect = function _connect() {
|
||||||
|
|
||||||
self.socket = socket;
|
self.socket = socket;
|
||||||
self.emit('connect', socket);
|
self.emit('connect', socket);
|
||||||
});
|
}
|
||||||
|
|
||||||
|
socket = proto.connect((this.port || this.socketPath), this.host);
|
||||||
|
|
||||||
|
socket.once('connect', onConnect);
|
||||||
|
socket.once('secureConnect', onConnect);
|
||||||
setupSocket(socket, this);
|
setupSocket(socket, this);
|
||||||
|
|
||||||
if (this.connectTimeout) {
|
if (this.connectTimeout) {
|
||||||
|
|
|
@ -76,11 +76,13 @@ function createPool(options) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
|
|
||||||
res.on('error', function (e) {
|
res.on('error', function (e) {
|
||||||
return callback(e);
|
removeAllListeners('end');
|
||||||
|
callback(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.on('end', function () {
|
res.on('end', function () {
|
||||||
return callback(null);
|
removeAllListeners('error');
|
||||||
|
callback(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"name": "ldapjs",
|
"name": "ldapjs",
|
||||||
"homepage": "http://ldapjs.org",
|
"homepage": "http://ldapjs.org",
|
||||||
"description": "LDAP client and server APIs",
|
"description": "LDAP client and server APIs",
|
||||||
"version": "0.5.2",
|
"version": "0.5.3",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/mcavage/node-ldapjs.git"
|
"url": "git://github.com/mcavage/node-ldapjs.git"
|
||||||
|
|
Loading…
Reference in New Issue