GH-18: Server not handling unknown message types gracefull
This commit is contained in:
parent
c57470804c
commit
e2cac51a29
|
@ -222,7 +222,8 @@ Parser.prototype._newMessage = function(ber) {
|
|||
default:
|
||||
var e = new Error('protocolOp 0x' + type.toString(16) + ' not supported');
|
||||
this.emit('error', e, new LDAPResult({
|
||||
messageID: messageID
|
||||
messageID: messageID,
|
||||
protocolOp: type
|
||||
}));
|
||||
this._reset();
|
||||
return false;
|
||||
|
|
|
@ -378,10 +378,13 @@ function Server(options) {
|
|||
c.ldap.id, err.stack);
|
||||
|
||||
var res = getResponse(message);
|
||||
|
||||
res.status = 0x02; // protocol error
|
||||
res.errorMessage = err.toString();
|
||||
c.end(res.toBer());
|
||||
if (res) {
|
||||
res.status = 0x02; // protocol error
|
||||
res.errorMessage = err.toString();
|
||||
c.end(res.toBer());
|
||||
} else {
|
||||
c.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
c.on('data', function(data) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "ldapjs",
|
||||
"homepage": "http://ldapjs.org",
|
||||
"description": "LDAP client and server APIs",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/mcavage/node-ldapjs.git"
|
||||
|
|
Loading…
Reference in New Issue