aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-24 20:12:22 +0100
committerKim Alvefur <zash@zash.se>2019-03-24 20:12:22 +0100
commite8f72c6d4f6bc28e54f93702eb4825de8c81229e (patch)
tree73870fa3867e48618bdc885b39075f10f7d52937
parent20eaa5d17bcff2a0f861b48f23ec3b3d4290f583 (diff)
downloadprosody-e8f72c6d4f6bc28e54f93702eb4825de8c81229e.tar.gz
prosody-e8f72c6d4f6bc28e54f93702eb4825de8c81229e.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.
-rw-r--r--net/server_select.lua10
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