Software /
code /
prosody
Diff
net/server_select.lua @ 4347:4b5290dd4e58
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
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 20 Aug 2011 15:03:16 -0400 |
parent | 4346:28b9384c14fd |
child | 4348:5b240c6b5334 |
line wrap: on
line diff
--- a/net/server_select.lua Sat Aug 20 14:59:31 2011 -0400 +++ b/net/server_select.lua Sat Aug 20 15:03:16 2011 -0400 @@ -512,8 +512,7 @@ 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 @@ _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