diff options
author | Kim Alvefur <zash@zash.se> | 2019-10-05 15:22:59 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-10-05 15:22:59 +0200 |
commit | 430f8a05a8a258e1007dcd00bd51fd86b615572d (patch) | |
tree | dd9f53de3893640b9e956274d4780ac085e0fcd4 /net/server_epoll.lua | |
parent | 63025ea426cd94f62ae6ad25e258230e1a4e63d4 (diff) | |
download | prosody-430f8a05a8a258e1007dcd00bd51fd86b615572d.tar.gz prosody-430f8a05a8a258e1007dcd00bd51fd86b615572d.zip |
net.server_epoll: Return early when attepting to set write lock state to current state
Reduces needless duplication of work and log messages..
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r-- | net/server_epoll.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index ab513e93..62db6c86 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -668,6 +668,9 @@ function interface:setlimit(Bps) end function interface:pause_writes() + if self._write_lock then + return + end self:debug("Pause writes"); self._write_lock = true; self:setwritetimeout(false); @@ -675,6 +678,9 @@ function interface:pause_writes() end function interface:resume_writes() + if not self._write_lock then + return + end self:debug("Resume writes"); self._write_lock = nil; if self.writebuffer[1] then |