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

Function lua_ap_get_active_config

modules/lua/lua_request.c:2657–2679  ·  view source on GitHub ↗

Hack, hack, hack...! TODO: Make this actually work properly */

Source from the content-addressed store, hash-verified

2655
2656/* Hack, hack, hack...! TODO: Make this actually work properly */
2657static int lua_ap_get_active_config(lua_State *L) {
2658 ap_directive_t *subdir;
2659 ap_directive_t *dir = ap_conftree;
2660 request_rec *r = ap_lua_check_request_rec(L, 1);
2661
2662 for (dir = ap_conftree; dir; dir = dir->next) {
2663 if (ap_strcasestr(dir->directive, "<virtualhost") && dir->first_child) {
2664 for (subdir = dir->first_child; subdir; subdir = subdir->next) {
2665 if (ap_strcasecmp_match(subdir->directive, "servername") &&
2666 !ap_strcasecmp_match(r->hostname, subdir->args)) {
2667 read_cfg_tree(L, r, dir->first_child);
2668 return 1;
2669 }
2670 if (ap_strcasecmp_match(subdir->directive, "serveralias") &&
2671 !ap_strcasecmp_match(r->hostname, subdir->args)) {
2672 read_cfg_tree(L, r, dir->first_child);
2673 return 1;
2674 }
2675 }
2676 }
2677 }
2678 return 0;
2679}
2680
2681
2682

Callers

nothing calls this directly

Calls 4

ap_strcasestrFunction · 0.85
ap_strcasecmp_matchFunction · 0.85
read_cfg_treeFunction · 0.85
ap_lua_check_request_recFunction · 0.70

Tested by

no test coverage detected