net.server_epoll: Avoid call to update socket watch flags when nothing changed

Should skip a syscall for each write when using epoll.
pull/27/head
Kim Alvefur 2 years ago
parent da38e2af42
commit 07d2f9f2e8
  1. 3
      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);

Loading…
Cancel
Save