diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-12-05 19:50:34 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-12-05 19:50:34 +0000 |
commit | fe6e46a55f68f566290250655247cd1393ae6d2c (patch) | |
tree | 1cf6e6e0fad1a9efd467895c02e748522dc2ca06 /net | |
parent | b2afc52730ae023a4fa3c4da525b3d1f92e5f1b9 (diff) | |
parent | c016526d9d5b57c8b6157cba7eee4bb268e1e9b4 (diff) | |
download | prosody-fe6e46a55f68f566290250655247cd1393ae6d2c.tar.gz prosody-fe6e46a55f68f566290250655247cd1393ae6d2c.zip |
Merge
Diffstat (limited to 'net')
-rw-r--r-- | net/server.lua | 15 | ||||
-rw-r--r-- | net/xmppclient_listener.lua | 2 |
2 files changed, 3 insertions, 14 deletions
diff --git a/net/server.lua b/net/server.lua index 7fdb3275..e01ddfb7 100644 --- a/net/server.lua +++ b/net/server.lua @@ -501,24 +501,13 @@ wraptlsclient = function( listener, socket, ip, serverport, clientport, mode, ss handler.starttls = function (now) if not now then out_put("server.lua: we need to do tls, but delaying until later"); handler.need_tls = true; return; end out_put( "server.lua: attempting to start tls on "..tostring(socket) ) - local oldsocket = socket; socket, err = ssl_wrap( socket, sslctx ) -- wrap socket out_put("sslwrapped socket is "..tostring(socket)); if err then out_put( "server.lua: ssl error: ", err ) return nil, nil, err -- fatal error end - socket:settimeout(0); - - -- Add the new socket to our system - socketlist[ socket ] = handler - readlen = readlen + 1 - readlist[ readlen ] = socket - - -- Remove traces of the old socket - readlen = removesocket( readlist, oldsocket, readlen ) - socketlist [ oldsocket ] = nil; - + socket:settimeout( 1 ) send = socket.send receive = socket.receive close = socket.close @@ -543,7 +532,7 @@ wraptlsclient = function( listener, socket, ip, serverport, clientport, mode, ss out_put( "server.lua: ssl handshake done" ) writelen = ( wrote and removesocket( writelist, socket, writelen ) ) or writelen handler.receivedata = handler._receivedata -- when handshake is done, replace the handshake function with regular functions - handler.dispatchdata = handler._dispatchdata + handler.dispatchdata = handler._dispatchdata; return true; else out_put( "server.lua: error during ssl handshake: ", err ) diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua index fe6ec57b..22af2de4 100644 --- a/net/xmppclient_listener.lua +++ b/net/xmppclient_listener.lua @@ -113,7 +113,7 @@ function xmppclient.listener(conn, data) if not session then session = sm_new_session(conn); sessions[conn] = session; - + -- Logging functions -- local mainlog, log = log; |