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 | 5cadccc68af00a5d2dcd2ea09c03e713e4fa4739 (patch) | |
tree | dd9f53de3893640b9e956274d4780ac085e0fcd4 | |
parent | 1f5a8b48df589796f7a817163df091bf7461840f (diff) | |
download | prosody-5cadccc68af00a5d2dcd2ea09c03e713e4fa4739.tar.gz prosody-5cadccc68af00a5d2dcd2ea09c03e713e4fa4739.zip |
net.server_epoll: Return early when attepting to set write lock state to current state
Reduces needless duplication of work and log messages..
-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 |