Comparison

net/server_event.lua @ 7398:206f9b0485ad

net.server_event: Check the buffer *length*, not the buffer itself (Fixes 100% cpu usage introduced in 65abd9d7bf88)
author Kim Alvefur <zash@zash.se>
date Tue, 19 Apr 2016 18:58:30 +0200
parent 7393:1909bde0e79f
child 7399:066a4dfdac18
comparison
equal deleted inserted replaced
7393:1909bde0e79f 7398:206f9b0485ad
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 548 elseif interface.writebufferlen ~= 0 then
549 -- data possibly written from ondrain 549 -- data possibly written from ondrain
550 return EV_WRITE, cfg.WRITE_TIMEOUT 550 return EV_WRITE, cfg.WRITE_TIMEOUT
551 elseif interface.eventreadtimeout then 551 elseif interface.eventreadtimeout then
552 return EV_WRITE, cfg.WRITE_TIMEOUT 552 return EV_WRITE, cfg.WRITE_TIMEOUT
553 end 553 end