diff http/src/luan/modules/http/HttpServicer.java @ 504:dbdf4b8193a8

add Http.per_session()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 May 2015 01:09:35 -0600
parents ab9c2afefb47
children 7bc63886d4f2
line wrap: on
line diff
--- a/http/src/luan/modules/http/HttpServicer.java	Wed May 20 23:24:46 2015 -0600
+++ b/http/src/luan/modules/http/HttpServicer.java	Thu May 21 01:09:35 2015 -0600
@@ -47,13 +47,15 @@
 	{
 		LuanFunction fn;
 		synchronized(luan) {
+			LuanTable module = (LuanTable)PackageLuan.require(luan,"luan:http/Http");
+			LuanTable per_session_pages = (LuanTable)module.rawGet("per_session_pages");
 			Object mod = PackageLuan.load(luan,modName);
 			if( mod==null )
 				return false;
 			if( !(mod instanceof LuanTable) )
 				throw luan.exception( "module '"+modName+"' must return a table" );
 			LuanTable tbl = (LuanTable)mod;
-			if( Boolean.TRUE.equals(tbl.get(luan,"per_session")) ) {
+			if( Boolean.TRUE.equals(per_session_pages.rawGet(mod)) ) {
 				HttpSession session = request.getSession();
 				LuanState sessionLuan  = (LuanState)session.getValue("luan");
 				if( sessionLuan!=null ) {