diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-02-23 15:41:12 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-02-23 15:41:12 +0000 |
commit | 2727b7b72307c1f5e59f8b2e943074307010d262 (patch) | |
tree | 0d3ff277def1fdf82c68b4c87ec8dd87b8d2c371 /net | |
parent | 117211cdd664f127b48bfb24119bdaf6e00fb2bd (diff) | |
download | prosody-2727b7b72307c1f5e59f8b2e943074307010d262.tar.gz prosody-2727b7b72307c1f5e59f8b2e943074307010d262.zip |
net.server_event: Not every instantly-readable connection is an error, continue if possible
Diffstat (limited to 'net')
-rw-r--r-- | net/server_event.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/server_event.lua b/net/server_event.lua index bc1cc094..42b757d4 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -105,9 +105,13 @@ function interface_mt:_start_connection(plainssl) -- called from wrapclient self:ontimeout() -- call timeout listener self:_close() debug( "new connection failed. id:", self.id, "error:", self.fatalerror ) - elseif EV_READWRITE == event then - self.readcallback(event); else + if EV_READWRITE == event then + if self.readcallback(event) == -1 then + -- Fatal error occurred + return -1; + end + end if plainssl and has_luasec then -- start ssl session self:starttls(self._sslctx, true) else -- normal connection |