diff options
author | Kim Alvefur <zash@zash.se> | 2019-03-24 20:12:22 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-03-24 20:12:22 +0100 |
commit | 8cb20bea8cbbcb0f8e2557738135511b617e79cf (patch) | |
tree | 73870fa3867e48618bdc885b39075f10f7d52937 /net | |
parent | ea52a16673127e4428efb59ab50d660a48b6f7e1 (diff) | |
download | prosody-8cb20bea8cbbcb0f8e2557738135511b617e79cf.tar.gz prosody-8cb20bea8cbbcb0f8e2557738135511b617e79cf.zip |
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.
Diffstat (limited to 'net')
-rw-r--r-- | net/server_select.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/server_select.lua b/net/server_select.lua index 4b156409..5d554655 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -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 |