Comparison

net/server_event.lua @ 7392:c774622ad9db

net.server_event: Fix traceback if event re-added during starttls
author Kim Alvefur <zash@zash.se>
date Tue, 19 Apr 2016 18:18:57 +0200
parent 7384:65abd9d7bf88
child 7393:1909bde0e79f
comparison
equal deleted inserted replaced
7384:65abd9d7bf88 7392:c774622ad9db
543 debug "closing client after writing" 543 debug "closing client after writing"
544 interface:_close() -- close interface if needed 544 interface:_close() -- close interface if needed
545 elseif interface.startsslcallback then -- start ssl connection if needed 545 elseif interface.startsslcallback then -- start ssl connection if needed
546 debug "starting ssl handshake after writing" 546 debug "starting ssl handshake after writing"
547 interface.eventstarthandshake = addevent( base, nil, EV_TIMEOUT, interface.startsslcallback, 0 ) 547 interface.eventstarthandshake = addevent( base, nil, EV_TIMEOUT, interface.startsslcallback, 0 )
548 elseif interface.writebuffer ~= 0 then
549 -- data possibly written from ondrain
550 return EV_WRITE, cfg.WRITE_TIMEOUT
548 elseif interface.eventreadtimeout then 551 elseif interface.eventreadtimeout then
549 return EV_WRITE, EV_TIMEOUT 552 return EV_WRITE, EV_TIMEOUT
550 end
551 if interface.writebuffer ~= 0 then
552 -- data possibly written from ondrain
553 return EV_WRITE, cfg.WRITE_TIMEOUT
554 end 553 end
555 interface.eventwrite = nil 554 interface.eventwrite = nil
556 return -1 555 return -1
557 elseif byte and (err == "timeout" or err == "wantwrite") then -- want write again 556 elseif byte and (err == "timeout" or err == "wantwrite") then -- want write again
558 --vdebug( "writebuffer is not empty:", err ) 557 --vdebug( "writebuffer is not empty:", err )