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
commitd2bbc414c21a171dbc57aa80deb69abf7d4af6ef (patch)
tree78f24fa221a09a4e8fb703a5ac9c9481a083d51e
parenta39eb7be8fa8d8242ae2a7ef70c858b836d336cf (diff)
downloadprosody-d2bbc414c21a171dbc57aa80deb69abf7d4af6ef.tar.gz
prosody-d2bbc414c21a171dbc57aa80deb69abf7d4af6ef.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);