aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-15 14:24:09 +0200
committerKim Alvefur <zash@zash.se>2018-09-15 14:24:09 +0200
commitcff0c75139dd2086697d403f6bc5cc3d535589b2 (patch)
tree78f24fa221a09a4e8fb703a5ac9c9481a083d51e
parente4b4c42416ab9768d59251b350cdd3242cdac57e (diff)
downloadprosody-cff0c75139dd2086697d403f6bc5cc3d535589b2.tar.gz
prosody-cff0c75139dd2086697d403f6bc5cc3d535589b2.zip
net.server_epoll: Add back setflags API for compat
-rw-r--r--net/server_epoll.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index c8e24d6b..c2f9ffe7 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -310,6 +310,19 @@ function interface:del()
return true;
end
+function interface:setflags(r, w)
+ if not(self._wantread or self._wantwrite) then
+ if not(r or w) then
+ return true; -- no change
+ end
+ return self:add(r, w);
+ end
+ if not(r or w) then
+ return self:del();
+ end
+ return self:set(r, w);
+end
+
-- Called when socket is readable
function interface:onreadable()
local data, err, partial = self.conn:receive(self.read_size or cfg.read_size);