Comparison

net/server_event.lua @ 7395:97fe648176ab

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Tue, 19 Apr 2016 18:23:44 +0200
parent 7386:5a9af30d5737
parent 7394:a700d54c620a
child 7400:f1ff321178d4
comparison
equal deleted inserted replaced
7391:c381106173d0 7395:97fe648176ab
516 debug "closing client after writing" 516 debug "closing client after writing"
517 interface:_close() -- close interface if needed 517 interface:_close() -- close interface if needed
518 elseif interface.startsslcallback then -- start ssl connection if needed 518 elseif interface.startsslcallback then -- start ssl connection if needed
519 debug "starting ssl handshake after writing" 519 debug "starting ssl handshake after writing"
520 interface.eventstarthandshake = addevent( base, nil, EV_TIMEOUT, interface.startsslcallback, 0 ) 520 interface.eventstarthandshake = addevent( base, nil, EV_TIMEOUT, interface.startsslcallback, 0 )
521 elseif interface.writebuffer ~= 0 then
522 -- data possibly written from ondrain
523 return EV_WRITE, cfg.WRITE_TIMEOUT
521 elseif interface.eventreadtimeout then 524 elseif interface.eventreadtimeout then
522 return EV_WRITE, EV_TIMEOUT
523 end
524 if interface.writebuffer ~= 0 then
525 -- data possibly written from ondrain
526 return EV_WRITE, cfg.WRITE_TIMEOUT 525 return EV_WRITE, cfg.WRITE_TIMEOUT
527 end 526 end
528 interface.eventwrite = nil 527 interface.eventwrite = nil
529 return -1 528 return -1
530 elseif byte and (err == "timeout" or err == "wantwrite") then -- want write again 529 elseif byte and (err == "timeout" or err == "wantwrite") then -- want write again