aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-18 16:00:51 +0200
committerKim Alvefur <zash@zash.se>2016-08-18 16:00:51 +0200
commitb87569cf946490e49e471ce7efaaf0f2779b0d8c (patch)
treebb94dc97aad01e20856c59311717259ce62c8b9a
parent0d62fa9d6938e623a693160f2a0fc32dda1e816d (diff)
downloadprosody-b87569cf946490e49e471ce7efaaf0f2779b0d8c.tar.gz
prosody-b87569cf946490e49e471ce7efaaf0f2779b0d8c.zip
net.server_epoll: Return something as FD when no connection exists
-rw-r--r--net/server_epoll.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index f4ec54f6..4dc43bfa 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -141,7 +141,10 @@ function interface:on(what, ...)
end
function interface:getfd()
- return self.conn:getfd();
+ if self.conn then
+ return self.conn:getfd();
+ end
+ return -1;
end
function interface:ip()