MCPcopy Create free account
hub / github.com/apache/httpd / ap_lua_map_handler

Function ap_lua_map_handler

modules/lua/lua_config.c:54–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54apr_status_t ap_lua_map_handler(ap_lua_dir_cfg *cfg,
55 const char *file,
56 const char *function,
57 const char *pattern,
58 const char *scope)
59{
60 ap_regex_t *uri_pattern;
61 apr_status_t rv;
62 ap_lua_mapped_handler_spec *handler =
63 apr_pcalloc(cfg->pool, sizeof(ap_lua_mapped_handler_spec));
64 handler->uri_pattern = NULL;
65 handler->function_name = NULL;
66
67 uri_pattern = apr_palloc(cfg->pool, sizeof(ap_regex_t));
68 if ((rv = ap_regcomp(uri_pattern, pattern, 0)) != APR_SUCCESS) {
69 return rv;
70 }
71 handler->file_name = apr_pstrdup(cfg->pool, file);
72 handler->uri_pattern = uri_pattern;
73 handler->scope = apl_toscope(scope);
74
75 handler->function_name = apr_pstrdup(cfg->pool, function);
76 *(const ap_lua_mapped_handler_spec **) apr_array_push(cfg->mapped_handlers) =
77 handler;
78 return APR_SUCCESS;
79}
80
81/* Change to use ap_lua_map_handler */
82static int cfg_lua_map_handler(lua_State *L)

Callers

nothing calls this directly

Calls 2

ap_regcompFunction · 0.85
apl_toscopeFunction · 0.85

Tested by

no test coverage detected