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 | 2c3a869e6d2ed0948e5954af8d03eda62338565b (patch) | |
tree | 0d3ff277def1fdf82c68b4c87ec8dd87b8d2c371 | |
parent | 184e6e34f0c0942ed6d3779c644a715973234b15 (diff) | |
download | prosody-2c3a869e6d2ed0948e5954af8d03eda62338565b.tar.gz prosody-2c3a869e6d2ed0948e5954af8d03eda62338565b.zip |
net.server_event: Not every instantly-readable connection is an error, continue if possible
-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 |