aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-05 15:22:59 +0200
committerKim Alvefur <zash@zash.se>2019-10-05 15:22:59 +0200
commit430f8a05a8a258e1007dcd00bd51fd86b615572d (patch)
treedd9f53de3893640b9e956274d4780ac085e0fcd4 /net
parent63025ea426cd94f62ae6ad25e258230e1a4e63d4 (diff)
downloadprosody-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')
-rw-r--r--net/server_epoll.lua6
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