| 1139 | return NULL; |
| 1140 | } |
| 1141 | static const char *register_mapped_file_function_hook(const char *pattern, |
| 1142 | cmd_parms *cmd, |
| 1143 | void *_cfg, |
| 1144 | const char *file, |
| 1145 | const char *function) |
| 1146 | { |
| 1147 | ap_lua_mapped_handler_spec *spec; |
| 1148 | ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg; |
| 1149 | ap_regex_t *regex = apr_pcalloc(cmd->pool, sizeof(ap_regex_t)); |
| 1150 | if (ap_regcomp(regex, pattern,0)) { |
| 1151 | return "Invalid regex pattern!"; |
| 1152 | } |
| 1153 | |
| 1154 | spec = apr_pcalloc(cmd->pool, sizeof(ap_lua_mapped_handler_spec)); |
| 1155 | spec->file_name = apr_pstrdup(cmd->pool, file); |
| 1156 | spec->function_name = apr_pstrdup(cmd->pool, function); |
| 1157 | spec->scope = cfg->vm_scope; |
| 1158 | spec->uri_pattern = regex; |
| 1159 | |
| 1160 | *(ap_lua_mapped_handler_spec **) apr_array_push(cfg->mapped_handlers) = spec; |
| 1161 | return NULL; |
| 1162 | } |
| 1163 | static const char *register_filter_function_hook(const char *filter, |
| 1164 | cmd_parms *cmd, |
| 1165 | void *_cfg, |
no test coverage detected