aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-08-20 15:03:16 -0400
committerMatthew Wild <mwild1@gmail.com>2011-08-20 15:03:16 -0400
commit7915c70e13765f700b48e2f71f0f9a0efe7c15fb (patch)
treef44ef46e0944b0d78f0481e3679aec5b3b8d19db
parent2757058cd20fa0d70c222adf24c006d03680b81f (diff)
downloadprosody-7915c70e13765f700b48e2f71f0f9a0efe7c15fb.tar.gz
prosody-7915c70e13765f700b48e2f71f0f9a0efe7c15fb.zip
net.server_select: Small fix to SSL handshake logic, read/wrote were being checked despite it not being possible for them to be other than nil
-rw-r--r--net/server_select.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index 96c73fde..bb3b12c9 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -512,8 +512,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
local handshake;
function handler.set_sslctx(self, new_sslctx)
sslctx = new_sslctx;
- local wrote
- local read
+ local read, wrote
handshake = coroutine_wrap( function( client ) -- create handshake coroutine
local err
for i = 1, _maxsslhandshake do
@@ -529,10 +528,10 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
_readlistlen = addsocket(_readlist, client, _readlistlen)
return true
else
- if err == "wantwrite" and not wrote then
+ if err == "wantwrite" then
_sendlistlen = addsocket(_sendlist, client, _sendlistlen)
wrote = true
- elseif err == "wantread" and not read then
+ elseif err == "wantread" then
_readlistlen = addsocket(_readlist, client, _readlistlen)
read = true
else