Changeset

6940:2be5e19485aa

util.session: How does a session relate do a connection?
author Kim Alvefur <zash@zash.se>
date Tue, 24 Nov 2015 19:26:27 +0100
parents 6939:a9ae0c6ac4f4
children 6941:33fbc835697d
files util/session.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/session.lua	Tue Nov 24 19:04:54 2015 +0100
+++ b/util/session.lua	Tue Nov 24 19:26:27 2015 +0100
@@ -19,8 +19,15 @@
 	return session;
 end
 
+local function set_conn(session, conn)
+	session.conn = conn;
+	session.ip = conn:ip();
+	return session;
+end
+
 return {
 	new = new_session;
 	set_id = set_id;
 	set_logger = set_logger;
+	set_conn = set_conn;
 }