diff options
author | Kim Alvefur <zash@zash.se> | 2018-09-15 14:24:09 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-09-15 14:24:09 +0200 |
commit | d2bbc414c21a171dbc57aa80deb69abf7d4af6ef (patch) | |
tree | 78f24fa221a09a4e8fb703a5ac9c9481a083d51e /net/server_epoll.lua | |
parent | a39eb7be8fa8d8242ae2a7ef70c858b836d336cf (diff) | |
download | prosody-d2bbc414c21a171dbc57aa80deb69abf7d4af6ef.tar.gz prosody-d2bbc414c21a171dbc57aa80deb69abf7d4af6ef.zip |
net.server_epoll: Add back setflags API for compat
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r-- | net/server_epoll.lua | 13 |
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); |