connection router to accomodate multithreading
connection router hook added to accommodate multithreaded servers
This commit is contained in:
parent
010b472dd8
commit
bca931a4cd
|
@ -313,7 +313,7 @@ function Server (options) {
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
function newConnection (conn) {
|
self.newConnection = function (conn) {
|
||||||
setupConnection(conn)
|
setupConnection(conn)
|
||||||
log.trace('new connection from %s', conn.ldap.id)
|
log.trace('new connection from %s', conn.ldap.id)
|
||||||
|
|
||||||
|
@ -438,9 +438,9 @@ function Server (options) {
|
||||||
this.routes = {}
|
this.routes = {}
|
||||||
if ((options.cert || options.certificate) && options.key) {
|
if ((options.cert || options.certificate) && options.key) {
|
||||||
options.cert = options.cert || options.certificate
|
options.cert = options.cert || options.certificate
|
||||||
this.server = tls.createServer(options, newConnection)
|
this.server = tls.createServer(options, options.connectionRouter ? options.connectionRouter : self.newConnection)
|
||||||
} else {
|
} else {
|
||||||
this.server = net.createServer(newConnection)
|
this.server = net.createServer(options.connectionRouter ? options.connectionRouter : self.newConnection)
|
||||||
}
|
}
|
||||||
this.server.log = options.log
|
this.server.log = options.log
|
||||||
this.server.ldap = {
|
this.server.ldap = {
|
||||||
|
|
Loading…
Reference in New Issue