aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-18 16:33:12 +0200
committerKim Alvefur <zash@zash.se>2016-08-18 16:33:12 +0200
commit4125f016e0bff612daa481931790cfa0f1c13b5b (patch)
treea019b0565929ca8de6e27bb601aa8d2ec983325b /net
parent61a9eab50c3c483711eaa85f5117f67f6b45f1a0 (diff)
downloadprosody-4125f016e0bff612daa481931790cfa0f1c13b5b.tar.gz
prosody-4125f016e0bff612daa481931790cfa0f1c13b5b.zip
net.server_epoll: Additional logging of connects and TLS
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 99561c18..62fb9863 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -337,7 +337,7 @@ function interface:close()
log("debug", "Close %s after writing", tostring(self));
self._toclose = true;
else
- log("debug", "Close %s", tostring(self));
+ log("debug", "Close %s now", tostring(self));
self.close = noop;
self:on("disconnect");
self:destroy();
@@ -359,8 +359,10 @@ end
function interface:starttls(ctx)
if ctx then self.tls = ctx; end
if self.writebuffer and self.writebuffer[1] then
+ log("debug", "Start TLS on %s after write", tostring(self));
self._starttls = true;
else
+ log("debug", "Start TLS on %s now", tostring(self));
self:setflags(false, false);
local conn, err = luasec.wrap(self.conn, ctx or self.tls);
if not conn then
@@ -379,6 +381,7 @@ end
function interface:tlshandskake()
local ok, err = self.conn:dohandshake();
if ok then
+ log("debug", "TLS handshake on %s complete", tostring(self));
self.onwriteable = nil;
self.onreadable = nil;
self:setflags(true, true);
@@ -391,14 +394,17 @@ function interface:tlshandskake()
self:on("status", "ssl-handshake-complete");
end
elseif err == "wantread" then
+ log("debug", "TLS handshake on %s to wait until readable", tostring(self));
self:setflags(true, false);
self:setwritetimeout(false);
self:setreadtimeout(cfg.handshake_timeout);
elseif err == "wantwrite" then
+ log("debug", "TLS handshake on %s to wait until writable", tostring(self));
self:setflags(false, true);
self:setreadtimeout(false);
self:setwritetimeout(cfg.handshake_timeout);
else
+ log("debug", "TLS handshake error on %s: %s", tostring(self), err);
self:on("disconnect", err);
self:destroy();
end
@@ -436,6 +442,7 @@ function interface:onacceptable()
return;
end
local client = wrapsocket(conn, self, nil, self.listeners, self.tls);
+ log("debug", "New connection %s", tostring(client));
if self.tls then
client._tls = false;
client:starttls();