| 28 | static ACL_DLL_ENV __dll_env; |
| 29 | |
| 30 | void http_plugin_init(ACL_DLL_ENV *dll_env, const char *cfg_dir) |
| 31 | { |
| 32 | ACL_XINETD_CFG_PARSER *cfg; |
| 33 | char *filepath; |
| 34 | |
| 35 | if (dll_env) |
| 36 | memcpy(&__dll_env, dll_env, sizeof(ACL_DLL_ENV)); |
| 37 | else |
| 38 | memset(&__dll_env, 0, sizeof(ACL_DLL_ENV)); |
| 39 | |
| 40 | if (__dll_env.logfp) { |
| 41 | acl_msg_open2(__dll_env.logfp, "http-access"); |
| 42 | acl_msg_info("%s(%d): logger opened, %s", __FUNCTION__, |
| 43 | __LINE__, ACL_VSTREAM_PATH(__dll_env.logfp)); |
| 44 | } |
| 45 | |
| 46 | /* ��� mem_slice �ǿ��������ڴ���������Ƭ���䷽ʽ */ |
| 47 | if (__dll_env.mem_slice) |
| 48 | acl_mem_slice_set(__dll_env.mem_slice); |
| 49 | |
| 50 | filepath = acl_concatenate((cfg_dir && *cfg_dir) |
| 51 | ? cfg_dir : "/tmp", "/http_access.cf", NULL); |
| 52 | cfg = acl_xinetd_cfg_load(filepath); |
| 53 | if (cfg == NULL) |
| 54 | acl_msg_warn("load cfg(%s) error(%s)", |
| 55 | filepath, acl_last_serror()); |
| 56 | |
| 57 | acl_xinetd_params_str_table(cfg, __conf_str_tab); |
| 58 | acl_xinetd_params_bool_table(cfg, __conf_bool_tab); |
| 59 | |
| 60 | if (cfg) |
| 61 | acl_xinetd_cfg_free(cfg); |
| 62 | acl_myfree(filepath); |
| 63 | |
| 64 | /* ��Դ���ģʽ����ʼ�������б� */ |
| 65 | http_access_init(); |
| 66 | |
| 67 | /* ��ʼ���й��ض����б� */ |
| 68 | http_redirect_init(); |
| 69 | |
| 70 | /* �Ƿ���Բ�����ڴ������� */ |
| 71 | if (var_cfg_debug_mem == 1) { |
| 72 | acl_memory_debug_start(); |
| 73 | acl_memory_debug_stack(1); |
| 74 | } else if (var_cfg_debug_mem == 2) { |
| 75 | __dll_env.mmd = acl_debug_malloc_init(__dll_env.mmd, "access_log.txt"); |
| 76 | } else if (var_cfg_debug_mem == 3) { |
| 77 | __dll_env.mmd = acl_debug_malloc_init(__dll_env.mmd, "access_log.txt"); |
| 78 | acl_memory_debug_start(); |
| 79 | acl_memory_debug_stack(1); |
| 80 | } |
| 81 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…