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

(-)mod_negotiation.c.old (-8 / +9 lines)
Lines 564-583 Link Here
564
564
565
static negotiation_state *parse_accept_headers(request_rec *r)
565
static negotiation_state *parse_accept_headers(request_rec *r)
566
{
566
{
567
    apr_pool_t *pool = r->main ? r->main->pool : r->pool;
567
    negotiation_state *new =
568
    negotiation_state *new =
568
        (negotiation_state *) apr_pcalloc(r->pool, sizeof(negotiation_state));
569
        (negotiation_state *) apr_pcalloc(pool, sizeof(negotiation_state));
569
    accept_rec *elts;
570
    accept_rec *elts;
570
    apr_table_t *hdrs = r->headers_in;
571
    apr_table_t *hdrs = r->headers_in;
571
    int i;
572
    int i;
572
573
573
    new->pool = r->pool;
574
    new->pool = pool;
574
    new->r = r;
575
    new->r = r;
575
    new->conf = (neg_dir_config *)ap_get_module_config(r->per_dir_config,
576
    new->conf = (neg_dir_config *)ap_get_module_config(r->per_dir_config,
576
                                                       &negotiation_module);
577
                                                       &negotiation_module);
577
578
578
    new->dir_name = ap_make_dirstr_parent(r->pool, r->filename);
579
    new->dir_name = ap_make_dirstr_parent(pool, r->filename);
579
580
580
    new->accepts = do_header_line(r->pool, apr_table_get(hdrs, "Accept"));
581
    new->accepts = do_header_line(pool, apr_table_get(hdrs, "Accept"));
581
582
582
    /* calculate new->accept_q value */
583
    /* calculate new->accept_q value */
583
    if (new->accepts) {
584
    if (new->accepts) {
Lines 591-607 Link Here
591
    }
592
    }
592
593
593
    new->accept_encodings =
594
    new->accept_encodings =
594
        do_header_line(r->pool, apr_table_get(hdrs, "Accept-Encoding"));
595
        do_header_line(pool, apr_table_get(hdrs, "Accept-Encoding"));
595
    new->accept_langs =
596
    new->accept_langs =
596
        do_header_line(r->pool, apr_table_get(hdrs, "Accept-Language"));
597
        do_header_line(pool, apr_table_get(hdrs, "Accept-Language"));
597
    new->accept_charsets =
598
    new->accept_charsets =
598
        do_header_line(r->pool, apr_table_get(hdrs, "Accept-Charset"));
599
        do_header_line(pool, apr_table_get(hdrs, "Accept-Charset"));
599
600
600
    /* This is possibly overkill for some servers, heck, we have
601
    /* This is possibly overkill for some servers, heck, we have
601
     * only 33 index.html variants in docs/docroot (today).
602
     * only 33 index.html variants in docs/docroot (today).
602
     * Make this configurable?
603
     * Make this configurable?
603
     */
604
     */
604
    new->avail_vars = apr_array_make(r->pool, 40, sizeof(var_rec));
605
    new->avail_vars = apr_array_make(pool, 40, sizeof(var_rec));
605
606
606
    return new;
607
    return new;
607
}
608
}

Return to bug 42548