# HG changeset patch # User Kim Alvefur # Date 1570281779 -7200 # Node ID 78f2a3a9c5375cea50069d2647176712e2ec74a8 # Parent fd94721186b84bf6c3763eafc8c0de5109427470 net.server_epoll: Return early when attepting to set write lock state to current state Reduces needless duplication of work and log messages.. diff -r fd94721186b8 -r 78f2a3a9c537 net/server_epoll.lua --- a/net/server_epoll.lua Thu Oct 03 16:38:46 2019 +0100 +++ b/net/server_epoll.lua Sat Oct 05 15:22:59 2019 +0200 @@ -668,6 +668,9 @@ 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 @@ 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