mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
net_uv: Don't add listenerCallback when null
This commit is contained in:
parent
5c38163787
commit
d0a9e64245
@ -359,20 +359,19 @@ function Server(/* [ options, ] listener */) {
|
||||
|
||||
var self = this;
|
||||
|
||||
var options, listenerCallback;
|
||||
var options;
|
||||
|
||||
if (typeof arguments[0] == 'function') {
|
||||
options = {};
|
||||
listenerCallback = arguments[0];
|
||||
self.on('connection', arguments[0]);
|
||||
} else {
|
||||
options = arguments[0];
|
||||
|
||||
if (typeof arguments[1] == 'function') {
|
||||
listenerCallback = arguments[1];
|
||||
self.on('connection', arguments[1]);
|
||||
}
|
||||
}
|
||||
|
||||
this.on('connection', listenerCallback);
|
||||
this.connections = 0;
|
||||
this.allowHalfOpen = options.allowHalfOpen || false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user