@@ -129,7 +129,6 @@ static int lua_handler(request_rec *r)
129129 spec -> scope = dcfg -> vm_scope ;
130130 spec -> pool = spec -> scope == APL_SCOPE_SERVER ? cfg -> pool : r -> pool ;
131131 spec -> file = r -> filename ;
132- spec -> code_cache_style = dcfg -> code_cache_style ;
133132 spec -> package_paths = cfg -> package_paths ;
134133 spec -> package_cpaths = cfg -> package_cpaths ;
135134 spec -> vm_server_pool_min = cfg -> vm_server_pool_min ;
@@ -141,9 +140,8 @@ static int lua_handler(request_rec *r)
141140 }
142141
143142 ap_log_rerror (APLOG_MARK , APLOG_DEBUG , 0 , r ,
144- "request details scope:%u, cache:%u, filename:%s, function:%s" ,
143+ "request details scope:%u, filename:%s, function:%s" ,
145144 d -> spec -> scope ,
146- d -> spec -> code_cache_style ,
147145 d -> spec -> file ,
148146 d -> function_name );
149147 L = ap_lua_get_lua_state (r -> pool ,
@@ -200,7 +198,6 @@ static int lua_alias_munger(request_rec *r)
200198 spec -> file = ap_pregsub (r -> pool , cnd -> file_name , r -> uri ,
201199 AP_MAX_REG_MATCH , matches );
202200 spec -> scope = cnd -> scope ;
203- spec -> code_cache_style = cnd -> code_cache_style ;
204201 spec -> bytecode = cnd -> bytecode ;
205202 spec -> bytecode_len = cnd -> bytecode_len ;
206203 if (spec -> scope == APL_SCOPE_ONCE ) {
@@ -253,7 +250,6 @@ static int lua_request_rec_hook_harness(request_rec *r, const char *name, int ap
253250 spec = apr_pcalloc (r -> pool , sizeof (ap_lua_vm_spec ));
254251
255252 spec -> file = hook_spec -> file_name ;
256- spec -> code_cache_style = hook_spec -> code_cache_style ;
257253 spec -> scope = hook_spec -> scope ;
258254 spec -> vm_server_pool_min = cfg -> vm_server_pool_min ;
259255 spec -> vm_server_pool_max = cfg -> vm_server_pool_max ;
@@ -502,7 +498,6 @@ static const char *register_named_block_function_hook(const char *name,
502498 else {
503499 function = NULL ;
504500 }
505- spec -> code_cache_style = APL_CODE_CACHE_FOREVER ;
506501
507502 ctx .cmd = cmd ;
508503 tmp = apr_pstrdup (cmd -> pool , cmd -> err_directive -> directive + 1 );
@@ -580,20 +575,13 @@ static const char *register_named_file_function_hook(const char *name,
580575 spec -> file_name = apr_pstrdup (cmd -> pool , file );
581576 spec -> function_name = apr_pstrdup (cmd -> pool , function );
582577 spec -> scope = cfg -> vm_scope ;
583- spec -> code_cache_style = APL_CODE_CACHE_STAT ;
584- /*
585- int code_cache_style;
586- char *function_name;
587- char *file_name;
588- int scope;
589- */
578+
590579 * (ap_lua_mapped_handler_spec * * ) apr_array_push (hook_specs ) = spec ;
591580 return NULL ;
592581}
593582
594583static int lua_check_user_id_harness_first (request_rec * r )
595584{
596-
597585 return lua_request_rec_hook_harness (r , "check_user_id" , AP_LUA_HOOK_FIRST );
598586}
599587static int lua_check_user_id_harness (request_rec * r )
@@ -905,43 +893,20 @@ static const char *register_package_dir(cmd_parms *cmd, void *_cfg,
905893 * Called for config directive which looks like
906894 * LuaPackageCPath /lua/package/path/mapped/thing/like/this/?.so
907895 */
908- static const char * register_package_cdir (cmd_parms * cmd , void * _cfg ,
896+ static const char * register_package_cdir (cmd_parms * cmd ,
897+ void * _cfg ,
909898 const char * arg )
910899{
911900 ap_lua_dir_cfg * cfg = (ap_lua_dir_cfg * ) _cfg ;
912901
913902 return register_package_helper (cmd , arg , cfg -> package_cpaths );
914903}
915904
916- /**
917- * Called for config directive which looks like
918- * LuaCodeCache
919- */
920- static const char * register_code_cache (cmd_parms * cmd , void * _cfg ,
921- const char * arg )
922- {
923- ap_lua_dir_cfg * cfg = (ap_lua_dir_cfg * ) _cfg ;
924- if (strcmp ("stat" , arg ) == 0 ) {
925- cfg -> code_cache_style = APL_CODE_CACHE_STAT ;
926- }
927- else if (strcmp ("forever" , arg ) == 0 ) {
928- cfg -> code_cache_style = APL_CODE_CACHE_FOREVER ;
929- }
930- else if (strcmp ("never" , arg ) == 0 ) {
931- cfg -> code_cache_style = APL_CODE_CACHE_NEVER ;
932- }
933- else {
934- return apr_psprintf (cmd -> pool ,
935- "Invalid value for LuaCodeCache, '%s', "
936- "acceptable values are 'stat', 'forever', and "
937- "'never'" ,
938- arg );
939- }
940- return NULL ;
941- }
942905
943- static const char * register_lua_scope (cmd_parms * cmd , void * _cfg ,
944- const char * scope , const char * min ,
906+ static const char * register_lua_scope (cmd_parms * cmd ,
907+ void * _cfg ,
908+ const char * scope ,
909+ const char * min ,
945910 const char * max )
946911{
947912 ap_lua_dir_cfg * cfg = (ap_lua_dir_cfg * ) _cfg ;
@@ -1090,10 +1055,6 @@ command_rec lua_commands[] = {
10901055 OR_ALL ,
10911056 "Provide a hook for the insert_filter phase of request processing" ),
10921057
1093- AP_INIT_TAKE1 ("LuaCodeCache" , register_code_cache , NULL , OR_ALL ,
1094- "Configure the compiled code cache. \
1095- Default is to stat the file each time, options are stat|forever|never" ),
1096-
10971058 AP_INIT_TAKE123 ("LuaScope" , register_lua_scope , NULL , OR_ALL ,
10981059 "One of once, request, conn, server -- default is once" ),
10991060
@@ -1116,7 +1077,6 @@ static void *create_dir_config(apr_pool_t *p, char *dir)
11161077 cfg -> package_cpaths = apr_array_make (p , 2 , sizeof (char * ));
11171078 cfg -> mapped_handlers =
11181079 apr_array_make (p , 1 , sizeof (ap_lua_mapped_handler_spec * ));
1119- cfg -> code_cache_style = APL_CODE_CACHE_STAT ;
11201080 cfg -> pool = p ;
11211081 cfg -> hooks = apr_hash_make (p );
11221082 cfg -> dir = apr_pstrdup (p , dir );
@@ -1137,12 +1097,8 @@ static void *create_server_config(apr_pool_t *p, server_rec *s)
11371097{
11381098
11391099 ap_lua_server_cfg * cfg = apr_pcalloc (p , sizeof (ap_lua_server_cfg ));
1140- cfg -> code_cache = apr_pcalloc (p , sizeof (ap_lua_code_cache ));
1141- apr_thread_rwlock_create (& cfg -> code_cache -> compiled_files_lock , p );
1142- cfg -> code_cache -> compiled_files = apr_hash_make (p );
11431100 cfg -> vm_reslists = apr_hash_make (p );
11441101 apr_thread_rwlock_create (& cfg -> vm_reslists_lock , p );
1145- cfg -> code_cache -> pool = p ;
11461102 cfg -> root_path = NULL ;
11471103
11481104 return cfg ;
0 commit comments