Mercurial Hosting > luan
comparison http/src/luan/modules/http/HttpServicer.java @ 693:ca169567ce07
module URIs must now include ".luan"
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 19 Apr 2016 15:54:11 -0600 |
parents | cdc70de628b5 |
children | b21d82ee5756 |
comparison
equal
deleted
inserted
replaced
692:7bd97d642f37 | 693:ca169567ce07 |
---|---|
44 public static boolean service(LuanState luan,HttpServletRequest request,HttpServletResponse response,String modName) | 44 public static boolean service(LuanState luan,HttpServletRequest request,HttpServletResponse response,String modName) |
45 throws LuanException | 45 throws LuanException |
46 { | 46 { |
47 LuanFunction fn; | 47 LuanFunction fn; |
48 synchronized(luan) { | 48 synchronized(luan) { |
49 LuanTable module = (LuanTable)PackageLuan.require(luan,"luan:http/Http"); | 49 LuanTable module = (LuanTable)PackageLuan.require(luan,"luan:http/Http.luan"); |
50 LuanTable per_session_pages = (LuanTable)module.rawGet("per_session_pages"); | 50 LuanTable per_session_pages = (LuanTable)module.rawGet("per_session_pages"); |
51 Object mod = PackageLuan.load(luan,modName); | 51 Object mod = PackageLuan.load(luan,modName); |
52 if( mod==null ) | 52 if( mod==null ) |
53 return false; | 53 return false; |
54 if( !(mod instanceof LuanFunction) ) | 54 if( !(mod instanceof LuanFunction) ) |
69 luan = (LuanState)cloner.deepClone(luan); | 69 luan = (LuanState)cloner.deepClone(luan); |
70 fn = (LuanFunction)cloner.get(mod); | 70 fn = (LuanFunction)cloner.get(mod); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 LuanTable module = (LuanTable)PackageLuan.require(luan,"luan:http/Http"); | 74 LuanTable module = (LuanTable)PackageLuan.require(luan,"luan:http/Http.luan"); |
75 | 75 |
76 // request | 76 // request |
77 LuanFunction newRequestFn = (LuanFunction)module.rawGet("new_request"); | 77 LuanFunction newRequestFn = (LuanFunction)module.rawGet("new_request"); |
78 LuanTable requestTbl = (LuanTable)newRequestFn.call(luan); | 78 LuanTable requestTbl = (LuanTable)newRequestFn.call(luan); |
79 module.rawPut("request",requestTbl); | 79 module.rawPut("request",requestTbl); |