aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
commit346458a5c35ff6433da210a7a24f7590f9f501a9 (patch)
treef44ef46e0944b0d78f0481e3679aec5b3b8d19db /net
parent7752f416f06c108576f48226d4c0929834e1c2ad (diff)
downloadprosody-346458a5c35ff6433da210a7a24f7590f9f501a9.tar.gz
prosody-346458a5c35ff6433da210a7a24f7590f9f501a9.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
Diffstat (limited to 'net')
-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