From 7915c70e13765f700b48e2f71f0f9a0efe7c15fb Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 20 Aug 2011 15:03:16 -0400 Subject: 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 --- net/server_select.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'net') 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 -- cgit v1.2.3