diff options
author | Kim Alvefur <zash@zash.se> | 2023-11-21 22:06:28 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-11-21 22:06:28 +0100 |
commit | 07d2f9f2e8ccca52af4e297619e14c7524ef91a9 (patch) | |
tree | 2eb32fce7734c73f65922df2a2af022120a7ae6a /net | |
parent | da38e2af42c1b646a7435c9ff69771f3e5781f1d (diff) | |
download | prosody-07d2f9f2e8ccca52af4e297619e14c7524ef91a9.tar.gz prosody-07d2f9f2e8ccca52af4e297619e14c7524ef91a9.zip |
net.server_epoll: Avoid call to update socket watch flags when nothing changed
Should skip a syscall for each write when using epoll.
Diffstat (limited to 'net')
-rw-r--r-- | net/server_epoll.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index e6b69258..fe60dc78 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -400,6 +400,9 @@ function interface:set(r, w) end if r == nil then r = self._wantread; end if w == nil then w = self._wantwrite; end + if r == self._wantread and w == self._wantwrite then + return true + end local ok, err, errno = poll:set(fd, r, w); if not ok then self:debug("Could not update poller state: %s(%d)", err, errno); |