From 2f1bf340d3b39f941cc97fefbc6b1e4bc30ba8f9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 19 Apr 2016 18:18:57 +0200 Subject: net.server_event: Fix traceback if event re-added during starttls --- net/server_event.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'net') 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 -- cgit v1.2.3 From 2ba51125520664a26eec48325f1b3b041359bb24 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 19 Apr 2016 18:20:39 +0200 Subject: net.server_event: Return the correct value as timeout --- net/server_event.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/server_event.lua b/net/server_event.lua index 9da2e910..59bd269a 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -549,7 +549,7 @@ do -- data possibly written from ondrain return EV_WRITE, cfg.WRITE_TIMEOUT elseif interface.eventreadtimeout then - return EV_WRITE, EV_TIMEOUT + return EV_WRITE, cfg.WRITE_TIMEOUT end interface.eventwrite = nil return -1 -- cgit v1.2.3