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

(-)httpd-2.2.15/modules/http/http_filters.c (-2 / +34 lines)
Lines 85-90 Link Here
85
    apr_bucket_brigade *bb = ctx->bb;
85
    apr_bucket_brigade *bb = ctx->bb;
86
86
87
    apr_brigade_cleanup(bb);
87
    apr_brigade_cleanup(bb);
88
89
    if (f->r->proxyreq == PROXYREQ_RESPONSE) {
90
        switch (http_error) {
91
        case HTTP_REQUEST_TIME_OUT:
92
            return APR_ECONNABORTED;
93
94
        case HTTP_REQUEST_ENTITY_TOO_LARGE:
95
            return APR_ENOSPC;
96
97
        case HTTP_NOT_IMPLEMENTED:
98
            return APR_ENOTIMPL;
99
100
        default:
101
            return APR_EGENERAL;
102
        }
103
    }
104
88
    e = ap_bucket_error_create(http_error,
105
    e = ap_bucket_error_create(http_error,
89
                               NULL, f->r->pool,
106
                               NULL, f->r->pool,
90
                               f->c->bucket_alloc);
107
                               f->c->bucket_alloc);
Lines 387-392 Link Here
387
            if (rv != APR_SUCCESS || ctx->remaining < 0) {
404
            if (rv != APR_SUCCESS || ctx->remaining < 0) {
388
                ctx->remaining = 0; /* Reset it in case we have to
405
                ctx->remaining = 0; /* Reset it in case we have to
389
                                     * come back here later */
406
                                     * come back here later */
407
                if (rv != APR_SUCCESS) {
408
                    http_error = HTTP_REQUEST_TIME_OUT;
409
                }
390
                return bail_out_on_error(ctx, f, http_error);
410
                return bail_out_on_error(ctx, f, http_error);
391
            }
411
            }
392
412
Lines 435-440 Link Here
435
                        return APR_EAGAIN;
455
                        return APR_EAGAIN;
436
                    }
456
                    }
437
                    /* If we get an error, then leave */
457
                    /* If we get an error, then leave */
458
                    if (rv == APR_EOF) {
459
                        return APR_ECONNABORTED;
460
                    }
438
                    if (rv != APR_SUCCESS) {
461
                    if (rv != APR_SUCCESS) {
439
                        return rv;
462
                        return rv;
440
                    }
463
                    }
Lines 488-493 Link Here
488
                if (rv != APR_SUCCESS || ctx->remaining < 0) {
511
                if (rv != APR_SUCCESS || ctx->remaining < 0) {
489
                    ctx->remaining = 0; /* Reset it in case we have to
512
                    ctx->remaining = 0; /* Reset it in case we have to
490
                                         * come back here later */
513
                                         * come back here later */
514
                    if (rv != APR_SUCCESS) {
515
                        http_error = HTTP_REQUEST_TIME_OUT;
516
                    }
491
                    bail_out_on_error(ctx, f, http_error);
517
                    bail_out_on_error(ctx, f, http_error);
492
                    return rv;
518
                    return rv;
493
                }
519
                }
Lines 516-521 Link Here
516
542
517
    rv = ap_get_brigade(f->next, b, mode, block, readbytes);
543
    rv = ap_get_brigade(f->next, b, mode, block, readbytes);
518
544
545
    if (rv == APR_EOF && ctx->state != BODY_NONE &&
546
            ctx->remaining > 0) {
547
        return APR_ECONNABORTED;
548
    }
519
    if (rv != APR_SUCCESS) {
549
    if (rv != APR_SUCCESS) {
520
        return rv;
550
        return rv;
521
    }
551
    }
Lines 531-538 Link Here
531
        ctx->remaining -= totalread;
561
        ctx->remaining -= totalread;
532
        if (ctx->remaining > 0) {
562
        if (ctx->remaining > 0) {
533
            e = APR_BRIGADE_LAST(b);
563
            e = APR_BRIGADE_LAST(b);
534
            if (APR_BUCKET_IS_EOS(e))
564
            if (APR_BUCKET_IS_EOS(e)) {
535
                return APR_EOF;
565
                apr_bucket_delete(e);
566
                return APR_ECONNABORTED;
567
            }
536
        }
568
        }
537
    }
569
    }
538
570

Return to bug 55475