Diff

net/server.lua @ 2059:d4fb80b60c65

server.lua: Standardise on 'client' variable to refer to the socket, makes the code a bit cleaner
author Matthew Wild <mwild1@gmail.com>
date Mon, 26 Oct 2009 23:35:48 +0000
parent 2057:ee2929e620bb
child 2281:27441b099984
child 2764:6f5c30865ddf
line wrap: on
line diff
--- a/net/server.lua	Mon Oct 26 23:30:15 2009 +0000
+++ b/net/server.lua	Mon Oct 26 23:35:48 2009 +0000
@@ -537,8 +537,8 @@
         handshake = coroutine_wrap( function( client )    -- create handshake coroutine
                 local err
                 for i = 1, _maxsslhandshake do
-                    _sendlistlen = ( wrote and removesocket( _sendlist, socket, _sendlistlen ) ) or _sendlistlen
-                    _readlistlen = ( read and removesocket( _readlist, socket, _readlistlen ) ) or _readlistlen
+                    _sendlistlen = ( wrote and removesocket( _sendlist, client, _sendlistlen ) ) or _sendlistlen
+                    _readlistlen = ( read and removesocket( _readlist, client, _readlistlen ) ) or _readlistlen
                     read, wrote = nil, nil
                     _, err = client:dohandshake( )
                     if not err then
@@ -546,7 +546,7 @@
                         handler.readbuffer = _readbuffer    -- when handshake is done, replace the handshake function with regular functions
                         handler.sendbuffer = _sendbuffer
                         _ = status and status( handler, "ssl-handshake-complete" )
-                        _readlistlen = addsocket(_readlist, socket, _readlistlen)
+                        _readlistlen = addsocket(_readlist, client, _readlistlen)
                         return true
                     else
                        out_put( "server.lua: error during ssl handshake: ", tostring(err) )