Server: Correct IRC socket connect handler
authorDarren <darren@darrenwhitlen.com>
Fri, 2 Nov 2012 23:54:22 +0000 (23:54 +0000)
committerDarren <darren@darrenwhitlen.com>
Fri, 2 Nov 2012 23:54:22 +0000 (23:54 +0000)
server/irc/connection.js

index c68637d4e25a62a048c69ad28cfdd9facd5a108b..e7a4895a6621311b80d542ffffc4bdd815dba89c 100644 (file)
@@ -9,7 +9,13 @@ var IrcConnection = function (hostname, port, ssl, nick, user, pass) {
     events.EventEmitter.call(this);
     
     if (ssl) {
-        this.socket = tls.connect({host: hostname, port: port, rejectUnauthorized: global.config.reject_unauthorised_certificates}, connect_handler);
+        this.socket = tls.connect({
+            host: hostname,
+            port: port,
+            rejectUnauthorized: global.config.reject_unauthorised_certificates
+        }, function () {
+            connect_handler.apply(that, arguments);
+        });
     } else {
         this.socket = net.createConnection(port, hostname);
         this.socket.on('connect', function () {