Changeset

7586:846fdbbc62ba

net.server_epoll: Return something as FD when no connection exists
author Kim Alvefur <zash@zash.se>
date Thu, 18 Aug 2016 16:00:51 +0200
parents 7585:b64218c816de
children 7587:ff81a34bffb0
files net/server_epoll.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Thu Aug 18 15:57:22 2016 +0200
+++ b/net/server_epoll.lua	Thu Aug 18 16:00:51 2016 +0200
@@ -141,7 +141,10 @@
 end
 
 function interface:getfd()
-	return self.conn:getfd();
+	if self.conn then
+		return self.conn:getfd();
+	end
+	return -1;
 end
 
 function interface:ip()