Identd + SSL fixes
authorDarren <darren@darrenwhitlen.com>
Thu, 23 Jan 2014 22:28:46 +0000 (22:28 +0000)
committerDarren <darren@darrenwhitlen.com>
Thu, 23 Jan 2014 22:28:46 +0000 (22:28 +0000)
server/kiwi.js

index 81dac34c4d1a3072175dbff11d54f1b34ea36fdf..cd2515579a4605da571c94657617fb90ade4d9c6 100755 (executable)
@@ -240,13 +240,16 @@ _.each(global.config.servers, function (server) {
         });
 
         serv.on('socket_connected', function(pipe) {
-            pipe.identd_pair = pipe.irc_socket.localPort.toString() + '_' + pipe.irc_socket.remotePort.toString();
-            console.log('[IDENTD] opened ' + pipe.identd_pair);
+            // SSL connections have the raw socket as a property
+            var socket = pipe.irc_socket.socket ?
+                    pipe.irc_socket.socket :
+                    pipe.irc_socket;
+
+            pipe.identd_pair = socket.localPort.toString() + '_' + socket.remotePort.toString();
             global.clients.port_pairs[pipe.identd_pair] = pipe.meta;
         });
 
         serv.on('connection_close', function(pipe) {
-            console.log('[IDENTD] closed ' + pipe.identd_pair);
             delete global.clients.port_pairs[pipe.identd_pair];
         });