aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-04-19 18:18:57 +0200
committerKim Alvefur <zash@zash.se>2016-04-19 18:18:57 +0200
commit49aa55a51d8a0485aa673f1d821db2bca0ce2dba (patch)
treea1f799286dc962072a3c4841728c49548cdb46d5 /net
parent2bf3239f769a9ea49d8aa7cfaa62bc034ddc4773 (diff)
downloadprosody-49aa55a51d8a0485aa673f1d821db2bca0ce2dba.tar.gz
prosody-49aa55a51d8a0485aa673f1d821db2bca0ce2dba.zip
net.server_event: Fix traceback if event re-added during starttls
Diffstat (limited to 'net')
-rw-r--r--net/server_event.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index 1c6f1547..9da2e910 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -545,12 +545,11 @@ do
elseif interface.startsslcallback then -- start ssl connection if needed
debug "starting ssl handshake after writing"
interface.eventstarthandshake = addevent( base, nil, EV_TIMEOUT, interface.startsslcallback, 0 )
- elseif interface.eventreadtimeout then
- return EV_WRITE, EV_TIMEOUT
- end
- if interface.writebuffer ~= 0 then
+ elseif interface.writebuffer ~= 0 then
-- data possibly written from ondrain
return EV_WRITE, cfg.WRITE_TIMEOUT
+ elseif interface.eventreadtimeout then
+ return EV_WRITE, EV_TIMEOUT
end
interface.eventwrite = nil
return -1