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

Function ap_walk_config_sub

server/config.c:1298–1358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1296}
1297
1298static const char *ap_walk_config_sub(const ap_directive_t *current,
1299 cmd_parms *parms,
1300 ap_conf_vector_t *section_vector)
1301{
1302 const command_rec *cmd;
1303 ap_mod_list *ml;
1304 char *dir = apr_pstrdup(parms->temp_pool, current->directive);
1305
1306 ap_str_tolower(dir);
1307
1308 ml = apr_hash_get(ap_config_hash, dir, APR_HASH_KEY_STRING);
1309
1310 if (ml == NULL) {
1311 parms->err_directive = current;
1312 if (parms->override & NONFATAL_UNKNOWN) {
1313 ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->temp_pool,
1314 APLOGNO(02296) "Unknown directive %s "
1315 "perhaps misspelled or defined by a module "
1316 "not included in the server configuration", dir);
1317 return NULL;
1318 }
1319 else {
1320 return apr_pstrcat(parms->pool, "Invalid command '",
1321 current->directive,
1322 "', perhaps misspelled or defined by a module "
1323 "not included in the server configuration",
1324 NULL);
1325 }
1326 }
1327
1328 for ( ; ml != NULL; ml = ml->next) {
1329 void *dir_config = ap_set_config_vectors(parms->server,
1330 section_vector,
1331 parms->path,
1332 ml->m,
1333 parms->pool);
1334 const char *retval;
1335 cmd = ml->cmd;
1336
1337 /* Once was enough? */
1338 if (cmd->req_override & EXEC_ON_READ) {
1339 continue;
1340 }
1341
1342 retval = invoke_cmd(cmd, parms, dir_config, current->args);
1343
1344 if (retval != NULL && strcmp(retval, DECLINE_CMD) != 0) {
1345 /* If the directive in error has already been set, don't
1346 * replace it. Otherwise, an error inside a container
1347 * will be reported as occurring on the first line of the
1348 * container.
1349 */
1350 if (!parms->err_directive) {
1351 parms->err_directive = current;
1352 }
1353 return retval;
1354 }
1355 }

Callers 1

ap_walk_configFunction · 0.85

Calls 3

ap_str_tolowerFunction · 0.85
ap_set_config_vectorsFunction · 0.85
invoke_cmdFunction · 0.85

Tested by

no test coverage detected