connection router to accomodate multithreading

connection router hook added to accommodate multithreaded servers
This commit is contained in:
CoryGH 2021-05-19 14:36:51 -04:00 committed by GitHub
parent 010b472dd8
commit bca931a4cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -313,7 +313,7 @@ function Server (options) {
return c
}
function newConnection (conn) {
self.newConnection = function (conn) {
setupConnection(conn)
log.trace('new connection from %s', conn.ldap.id)
@ -438,9 +438,9 @@ function Server (options) {
this.routes = {}
if ((options.cert || options.certificate) && options.key) {
options.cert = options.cert || options.certificate
this.server = tls.createServer(options, newConnection)
this.server = tls.createServer(options, options.connectionRouter ? options.connectionRouter : self.newConnection)
} else {
this.server = net.createServer(newConnection)
this.server = net.createServer(options.connectionRouter ? options.connectionRouter : self.newConnection)
}
this.server.log = options.log
this.server.ldap = {