Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit bca931a

Browse files
authored
connection router to accomodate multithreading
connection router hook added to accommodate multithreaded servers
1 parent 010b472 commit bca931a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function Server (options) {
313313
return c
314314
}
315315

316-
function newConnection (conn) {
316+
self.newConnection = function (conn) {
317317
setupConnection(conn)
318318
log.trace('new connection from %s', conn.ldap.id)
319319

@@ -438,9 +438,9 @@ function Server (options) {
438438
this.routes = {}
439439
if ((options.cert || options.certificate) && options.key) {
440440
options.cert = options.cert || options.certificate
441-
this.server = tls.createServer(options, newConnection)
441+
this.server = tls.createServer(options, options.connectionRouter ? options.connectionRouter : self.newConnection)
442442
} else {
443-
this.server = net.createServer(newConnection)
443+
this.server = net.createServer(options.connectionRouter ? options.connectionRouter : self.newConnection)
444444
}
445445
this.server.log = options.log
446446
this.server.ldap = {

0 commit comments

Comments
 (0)