GH-47 Server crash in c.on('data')
This commit is contained in:
parent
0cee804daf
commit
040dfa51fa
|
@ -423,7 +423,17 @@ function Server(options) {
|
|||
c.on('data', function(data) {
|
||||
if (log.isTraceEnabled())
|
||||
log.trace('data on %s: %s', c.ldap.id, util.inspect(data));
|
||||
c.parser.write(data);
|
||||
|
||||
try {
|
||||
c.parser.write(data);
|
||||
} catch (e) {
|
||||
log.warn('Unable to parse message [c.on(\'data\')]: %s', e.stack);
|
||||
c.end(new LDAPResult({
|
||||
status: 0x02,
|
||||
errorMessage: e.toString(),
|
||||
connection: c
|
||||
}).toBer());
|
||||
}
|
||||
});
|
||||
|
||||
}; // end newConnection
|
||||
|
|
Loading…
Reference in New Issue