Changeset

10280:6b8b255f1d10

net.server_epoll: Add debug logging for various connection events
author Kim Alvefur <zash@zash.se>
date Sun, 29 Sep 2019 15:02:05 +0200
parents 10279:0e1701197722
children 10281:f90abf142d53
files net/server_epoll.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Sun Sep 29 15:00:28 2019 +0200
+++ b/net/server_epoll.lua	Sun Sep 29 15:02:05 2019 +0200
@@ -630,10 +630,12 @@
 end
 
 function interface:pause()
+	self:debug("Pause reading");
 	return self:set(false);
 end
 
 function interface:resume()
+	self:debug("Resume reading");
 	return self:set(true);
 end
 
@@ -663,12 +665,14 @@
 end
 
 function interface:pause_writes()
+	self:debug("Pause writes");
 	self._write_lock = true;
 	self:setwritetimeout(false);
 	self:set(nil, false);
 end
 
 function interface:resume_writes()
+	self:debug("Resume writes");
 	self._write_lock = nil;
 	if self.writebuffer[1] then
 		self:setwritetimeout();
@@ -678,6 +682,7 @@
 
 -- Connected!
 function interface:onconnect()
+	self:debug("Connected");
 	self:updatenames();
 	self.onconnect = noop;
 	self:on("connect");
@@ -784,6 +789,7 @@
 
 -- Dump all data from one connection into another
 local function link(from, to)
+	from:debug("Linking to %s", to.id);
 	from.listeners = setmetatable({
 		onincoming = function (_, data)
 			from:pause();