# HG changeset patch # User Kim Alvefur # Date 1553454742 -3600 # Node ID 72501e3c1427ce9f6b38b2c938b1e2169fbd2c06 # Parent 9fe7b18bca15651f5b1287be187c7e39da48d3ba 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. diff -r 9fe7b18bca15 -r 72501e3c1427 net/server_select.lua --- a/net/server_select.lua Sun Mar 24 19:07:39 2019 +0100 +++ b/net/server_select.lua Sun Mar 24 20:12:22 2019 +0100 @@ -497,14 +497,12 @@ 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