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

Function ap_build_cont_config

server/config.c:1251–1296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1249#define VARBUF_MAX_LEN (16*1024*1024)
1250
1251AP_DECLARE(const char *) ap_build_cont_config(apr_pool_t *p,
1252 apr_pool_t *temp_pool,
1253 cmd_parms *parms,
1254 ap_directive_t **current,
1255 ap_directive_t **curr_parent,
1256 char *orig_directive)
1257{
1258 char *bracket;
1259 const char *retval;
1260 ap_directive_t *sub_tree = NULL;
1261 apr_status_t rc;
1262 struct ap_varbuf vb;
1263 apr_size_t max_len = VARBUF_MAX_LEN;
1264 if (p == temp_pool)
1265 max_len = HUGE_STRING_LEN; /* lower limit for .htaccess */
1266
1267 bracket = apr_pstrcat(temp_pool, orig_directive + 1, ">", NULL);
1268 ap_varbuf_init(temp_pool, &vb, VARBUF_INIT_LEN);
1269
1270 while ((rc = ap_varbuf_cfg_getline(&vb, parms->config_file, max_len))
1271 == APR_SUCCESS) {
1272 if (!memcmp(vb.buf, "</", 2)
1273 && (ap_cstr_casecmp(vb.buf + 2, bracket) == 0)
1274 && (*curr_parent == NULL)) {
1275 break;
1276 }
1277 retval = ap_build_config_sub(p, temp_pool, vb.buf, parms, current,
1278 curr_parent, &sub_tree);
1279 if (retval != NULL)
1280 return retval;
1281
1282 if (sub_tree == NULL) {
1283 sub_tree = *curr_parent;
1284 }
1285
1286 if (sub_tree == NULL) {
1287 sub_tree = *current;
1288 }
1289 }
1290 ap_varbuf_free(&vb);
1291 if (rc != APR_EOF && rc != APR_SUCCESS)
1292 return ap_pcfg_strerror(temp_pool, parms->config_file, rc);
1293
1294 *current = sub_tree;
1295 return NULL;
1296}
1297
1298static const char *ap_walk_config_sub(const ap_directive_t *current,
1299 cmd_parms *parms,

Callers 2

start_ifversionFunction · 0.85
start_cond_sectionFunction · 0.85

Calls 6

ap_varbuf_initFunction · 0.85
ap_varbuf_cfg_getlineFunction · 0.85
ap_cstr_casecmpFunction · 0.85
ap_build_config_subFunction · 0.85
ap_varbuf_freeFunction · 0.85
ap_pcfg_strerrorFunction · 0.85

Tested by

no test coverage detected