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

(-)httpd-2.2.17/modules/http/http_filters.c (-7 / +7 lines)
Lines 312-318 Link Here
312
         * proxied *response*, proxy responses MUST be exempt.
312
         * proxied *response*, proxy responses MUST be exempt.
313
         */
313
         */
314
        if (ctx->state == BODY_NONE && f->r->proxyreq != PROXYREQ_RESPONSE) {
314
        if (ctx->state == BODY_NONE && f->r->proxyreq != PROXYREQ_RESPONSE) {
315
            e = apr_bucket_eos_create(f->c->bucket_alloc);
315
            e = apr_bucket_eos_create(b->bucket_alloc);
316
            APR_BRIGADE_INSERT_TAIL(b, e);
316
            APR_BRIGADE_INSERT_TAIL(b, e);
317
            ctx->eos_sent = 1;
317
            ctx->eos_sent = 1;
318
            return APR_SUCCESS;
318
            return APR_SUCCESS;
Lines 339-345 Link Here
339
                e = apr_bucket_pool_create(tmp, len, f->r->pool,
339
                e = apr_bucket_pool_create(tmp, len, f->r->pool,
340
                                           f->c->bucket_alloc);
340
                                           f->c->bucket_alloc);
341
                APR_BRIGADE_INSERT_HEAD(bb, e);
341
                APR_BRIGADE_INSERT_HEAD(bb, e);
342
                e = apr_bucket_flush_create(f->c->bucket_alloc);
342
                e = apr_bucket_flush_create(b->bucket_alloc);
343
                APR_BRIGADE_INSERT_TAIL(bb, e);
343
                APR_BRIGADE_INSERT_TAIL(bb, e);
344
344
345
                ap_pass_brigade(f->c->output_filters, bb);
345
                ap_pass_brigade(f->c->output_filters, bb);
Lines 389-395 Link Here
389
                /* Handle trailers by calling ap_get_mime_headers again! */
389
                /* Handle trailers by calling ap_get_mime_headers again! */
390
                ctx->state = BODY_NONE;
390
                ctx->state = BODY_NONE;
391
                ap_get_mime_headers(f->r);
391
                ap_get_mime_headers(f->r);
392
                e = apr_bucket_eos_create(f->c->bucket_alloc);
392
                e = apr_bucket_eos_create(b->bucket_alloc);
393
                APR_BRIGADE_INSERT_TAIL(b, e);
393
                APR_BRIGADE_INSERT_TAIL(b, e);
394
                ctx->eos_sent = 1;
394
                ctx->eos_sent = 1;
395
                return APR_SUCCESS;
395
                return APR_SUCCESS;
Lines 401-407 Link Here
401
    }
401
    }
402
402
403
    if (ctx->eos_sent) {
403
    if (ctx->eos_sent) {
404
        e = apr_bucket_eos_create(f->c->bucket_alloc);
404
        e = apr_bucket_eos_create(b->bucket_alloc);
405
        APR_BRIGADE_INSERT_TAIL(b, e);
405
        APR_BRIGADE_INSERT_TAIL(b, e);
406
        return APR_SUCCESS;
406
        return APR_SUCCESS;
407
    }
407
    }
Lines 411-417 Link Here
411
        case BODY_NONE:
411
        case BODY_NONE:
412
            break;
412
            break;
413
        case BODY_LENGTH:
413
        case BODY_LENGTH:
414
            e = apr_bucket_eos_create(f->c->bucket_alloc);
414
            e = apr_bucket_eos_create(b->bucket_alloc);
415
            APR_BRIGADE_INSERT_TAIL(b, e);
415
            APR_BRIGADE_INSERT_TAIL(b, e);
416
            ctx->eos_sent = 1;
416
            ctx->eos_sent = 1;
417
            return APR_SUCCESS;
417
            return APR_SUCCESS;
Lines 491-497 Link Here
491
                    /* Handle trailers by calling ap_get_mime_headers again! */
491
                    /* Handle trailers by calling ap_get_mime_headers again! */
492
                    ctx->state = BODY_NONE;
492
                    ctx->state = BODY_NONE;
493
                    ap_get_mime_headers(f->r);
493
                    ap_get_mime_headers(f->r);
494
                    e = apr_bucket_eos_create(f->c->bucket_alloc);
494
                    e = apr_bucket_eos_create(b->bucket_alloc);
495
                    APR_BRIGADE_INSERT_TAIL(b, e);
495
                    APR_BRIGADE_INSERT_TAIL(b, e);
496
                    ctx->eos_sent = 1;
496
                    ctx->eos_sent = 1;
497
                    return APR_SUCCESS;
497
                    return APR_SUCCESS;
Lines 535-541 Link Here
535
     * save the callter a roundtrip to discover EOS.
535
     * save the callter a roundtrip to discover EOS.
536
     */
536
     */
537
    if (ctx->state == BODY_LENGTH && ctx->remaining == 0) {
537
    if (ctx->state == BODY_LENGTH && ctx->remaining == 0) {
538
        e = apr_bucket_eos_create(f->c->bucket_alloc);
538
        e = apr_bucket_eos_create(b->bucket_alloc);
539
        APR_BRIGADE_INSERT_TAIL(b, e);
539
        APR_BRIGADE_INSERT_TAIL(b, e);
540
    }
540
    }
541
541
(-)httpd-2.2.17/modules/proxy/mod_proxy_http.c (-1 / +1 lines)
Lines 701-707 Link Here
701
    int force10, rv;
701
    int force10, rv;
702
    apr_table_t *headers_in_copy;
702
    apr_table_t *headers_in_copy;
703
703
704
    header_brigade = apr_brigade_create(p, origin->bucket_alloc);
704
    header_brigade = apr_brigade_create(p, bucket_alloc);
705
705
706
    /*
706
    /*
707
     * Send the HTTP/1.1 request to the remote server
707
     * Send the HTTP/1.1 request to the remote server
(-)httpd-2.2.17/modules/proxy/proxy_util.c (-8 / +10 lines)
Lines 344-359 Link Here
344
344
345
PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r)
345
PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r)
346
{
346
{
347
    request_rec *rp = apr_pcalloc(r->pool, sizeof(*r));
347
    request_rec *rp = apr_pcalloc(c->pool, sizeof(*r));
348
349
    apr_pool_create(&(rp->pool), c->pool);
350
    apr_pool_tag(rp->pool, "request_fake");
348
351
349
    rp->pool            = r->pool;
350
    rp->status          = HTTP_OK;
352
    rp->status          = HTTP_OK;
351
353
352
    rp->headers_in      = apr_table_make(r->pool, 50);
354
    rp->headers_in      = apr_table_make(rp->pool, 50);
353
    rp->subprocess_env  = apr_table_make(r->pool, 50);
355
    rp->subprocess_env  = apr_table_make(rp->pool, 50);
354
    rp->headers_out     = apr_table_make(r->pool, 12);
356
    rp->headers_out     = apr_table_make(rp->pool, 12);
355
    rp->err_headers_out = apr_table_make(r->pool, 5);
357
    rp->err_headers_out = apr_table_make(rp->pool, 5);
356
    rp->notes           = apr_table_make(r->pool, 5);
358
    rp->notes           = apr_table_make(rp->pool, 5);
357
359
358
    rp->server = r->server;
360
    rp->server = r->server;
359
    rp->proxyreq = r->proxyreq;
361
    rp->proxyreq = r->proxyreq;
Lines 364-370 Link Here
364
    rp->proto_output_filters  = c->output_filters;
366
    rp->proto_output_filters  = c->output_filters;
365
    rp->proto_input_filters   = c->input_filters;
367
    rp->proto_input_filters   = c->input_filters;
366
368
367
    rp->request_config  = ap_create_request_config(r->pool);
369
    rp->request_config  = ap_create_request_config(rp->pool);
368
    proxy_run_create_req(r, rp);
370
    proxy_run_create_req(r, rp);
369
371
370
    return rp;
372
    return rp;
(-)httpd-2.2.17/server/core_filters.c (-4 / +4 lines)
Lines 230-236 Link Here
230
         * so tack on an EOS too. */
230
         * so tack on an EOS too. */
231
        /* We have read until the brigade was empty, so we know that we
231
        /* We have read until the brigade was empty, so we know that we
232
         * must be EOS. */
232
         * must be EOS. */
233
        e = apr_bucket_eos_create(f->c->bucket_alloc);
233
        e = apr_bucket_eos_create(b->bucket_alloc);
234
        APR_BRIGADE_INSERT_TAIL(b, e);
234
        APR_BRIGADE_INSERT_TAIL(b, e);
235
        return APR_SUCCESS;
235
        return APR_SUCCESS;
236
    }
236
    }
Lines 262-268 Link Here
262
            apr_bucket_delete(e);
262
            apr_bucket_delete(e);
263
263
264
            if (mode == AP_MODE_READBYTES) {
264
            if (mode == AP_MODE_READBYTES) {
265
                e = apr_bucket_eos_create(f->c->bucket_alloc);
265
                e = apr_bucket_eos_create(b->bucket_alloc);
266
                APR_BRIGADE_INSERT_TAIL(b, e);
266
                APR_BRIGADE_INSERT_TAIL(b, e);
267
            }
267
            }
268
            return APR_SUCCESS;
268
            return APR_SUCCESS;
Lines 655-662 Link Here
655
                            /* Create a temporary brigade as a means
655
                            /* Create a temporary brigade as a means
656
                             * of concatenating a bunch of buckets together
656
                             * of concatenating a bunch of buckets together
657
                             */
657
                             */
658
                            temp_brig = apr_brigade_create(f->c->pool,
658
                            temp_brig = apr_brigade_create(b->p,
659
                                                       f->c->bucket_alloc);
659
                                                       b->bucket_alloc);
660
                            if (last_merged_bucket) {
660
                            if (last_merged_bucket) {
661
                                /* If we've concatenated together small
661
                                /* If we've concatenated together small
662
                                 * buckets already in a previous pass,
662
                                 * buckets already in a previous pass,
(-)httpd-2.2.17/srclib/apr-util/buckets/apr_brigade.c (-4 / +12 lines)
Lines 327-338 Link Here
327
        if (pos != NULL) {
327
        if (pos != NULL) {
328
            apr_bucket_split(e, pos - str + 1);
328
            apr_bucket_split(e, pos - str + 1);
329
            APR_BUCKET_REMOVE(e);
329
            APR_BUCKET_REMOVE(e);
330
            APR_BRIGADE_INSERT_TAIL(bbOut, e);
330
            rv = apr_brigade_write(bbOut, NULL, NULL, str, pos - str + 1);
331
            if (rv != APR_SUCCESS) {
332
                return rv;
333
            }
334
            apr_bucket_destroy(e);
331
            return APR_SUCCESS;
335
            return APR_SUCCESS;
332
        }
336
        }
333
        APR_BUCKET_REMOVE(e);
337
        APR_BUCKET_REMOVE(e);
334
        if (APR_BUCKET_IS_METADATA(e) || len > APR_BUCKET_BUFF_SIZE/4) {
338
        if (APR_BUCKET_IS_EOS(e)) {
335
            APR_BRIGADE_INSERT_TAIL(bbOut, e);
339
            apr_bucket *b = apr_bucket_eos_create(bbOut->bucket_alloc);
340
            APR_BRIGADE_INSERT_TAIL(bbOut, b);
341
        } else if (APR_BUCKET_IS_FLUSH(e)) {
342
            apr_bucket *b = apr_bucket_flush_create(bbOut->bucket_alloc);
343
            APR_BRIGADE_INSERT_TAIL(bbOut, b);
336
        }
344
        }
337
        else {
345
        else {
338
            if (len > 0) {
346
            if (len > 0) {
Lines 341-348 Link Here
341
                    return rv;
349
                    return rv;
342
                }
350
                }
343
            }
351
            }
344
            apr_bucket_destroy(e);
345
        }
352
        }
353
        apr_bucket_destroy(e);
346
        readbytes += len;
354
        readbytes += len;
347
        /* We didn't find an APR_ASCII_LF within the maximum line length. */
355
        /* We didn't find an APR_ASCII_LF within the maximum line length. */
348
        if (readbytes >= maxbytes) {
356
        if (readbytes >= maxbytes) {

Return to bug 50335