View | Details | Raw Unified | Return to bug 50002
Collapse All | Expand All

(-)a/include/util_cfgtree.h (+8 lines)
Lines 64-69 struct ap_directive_t { Link Here
64
    const char *filename;
64
    const char *filename;
65
    /** The line number the directive was on */
65
    /** The line number the directive was on */
66
    int line_num;
66
    int line_num;
67
68
	/** GDR!'s hack
69
	 *  This is supposed to act as a cache for ap_build_config
70
	 *  in the first node on a given tree leaf, it keeps last known
71
	 *  non-NULL list element. This way we don't have to traverse
72
	 *  whole tree
73
	 */
74
	struct ap_directive_t *last;
67
};
75
};
68
76
69
/**
77
/**
(-)a/server/config.c (+23 lines)
Lines 1285-1296 AP_DECLARE(const char *) ap_build_config(cmd_parms *parms, Link Here
1285
    char *l = apr_palloc (temp_pool, MAX_STRING_LEN);
1285
    char *l = apr_palloc (temp_pool, MAX_STRING_LEN);
1286
    const char *errmsg;
1286
    const char *errmsg;
1287
1287
1288
	/** GDR!'s hack
1289
	 *  Instead of iterating whole level of leafs, jump to 
1290
	 *  last known non-NULL leaf
1291
	 */
1292
	ap_directive_t **leaf_cache = NULL;
1293
1294
	if(current) {
1295
		leaf_cache = &(current->last);		
1296
			
1297
		if(leaf_cache && *leaf_cache) {
1298
			current = *leaf_cache;
1299
		}
1300
	}
1301
	/* End hack */
1302
1288
    if (current != NULL) {
1303
    if (current != NULL) {
1289
        while (current->next) {
1304
        while (current->next) {
1290
            current = current->next;
1305
            current = current->next;
1291
        }
1306
        }
1292
    }
1307
    }
1293
1308
1309
	/** GDR!'s hack
1310
	 *  Update last known leaf
1311
	 */
1312
	if(leaf_cache) {
1313
		*leaf_cache = current;
1314
	}
1315
	/* End hack */
1316
1294
    while (!(ap_cfg_getline(l, MAX_STRING_LEN, parms->config_file))) {
1317
    while (!(ap_cfg_getline(l, MAX_STRING_LEN, parms->config_file))) {
1295
        errmsg = ap_build_config_sub(p, temp_pool, l, parms,
1318
        errmsg = ap_build_config_sub(p, temp_pool, l, parms,
1296
                                     &current, &curr_parent, conftree);
1319
                                     &current, &curr_parent, conftree);

Return to bug 50002