net.server_select: Fix write pause/resume functions

Nothing would happen if the write buffer was empty.

Also simplified the code because it took too long to understand what
`if _sendlistlen ~= tmp then` did.
This commit is contained in:
Kim Alvefur 2019-03-24 20:12:22 +01:00
parent 20eaa5d17b
commit e8f72c6d4f

View file

@ -497,14 +497,12 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
local tmp = _sendlistlen
_sendlistlen = removesocket( _sendlist, socket, _sendlistlen )
_writetimes[ handler ] = nil
if _sendlistlen ~= tmp then
nosend = true
end
nosend = true
end
handler.resume_writes = function (self)
if nosend then
nosend = false
write( "" )
nosend = false
if bufferlen > 0 then
_sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
end
end