Changeset

2726:55f3ab952d06

mod_secure_interfaces: Add debug log in non-secure case also
author Matthew Wild <mwild1@gmail.com>
date Thu, 06 Jul 2017 10:48:39 +0100
parents 2725:210c3a7644cb
children 2727:91cbeb6ad987
files mod_secure_interfaces/mod_secure_interfaces.lua
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_secure_interfaces/mod_secure_interfaces.lua	Thu Apr 27 12:41:53 2017 +0200
+++ b/mod_secure_interfaces/mod_secure_interfaces.lua	Thu Jul 06 10:48:39 2017 +0100
@@ -4,10 +4,15 @@
 	local session = event.origin;
 	if session.type ~= "c2s_unauthed" then return; end
 	local socket = session.conn:socket();
-	if not socket.getsockname then return; end
+	if not socket.getsockname then
+		module:log("debug", "Unable to determine local address of incoming connection");
+		return;
+	end
 	local localip = socket:getsockname();
 	if secure_interfaces:contains(localip) then
-		module:log("debug", "Marking session from %s as secure", session.ip or "[?]");
+		module:log("debug", "Marking session from %s to %s as secure", session.ip or "[?]", localip);
 		session.secure = true;
+	else
+		module:log("debug", "Not marking session from %s to %s as secure", session.ip or "[?]", localip);
 	end
 end, 2500);