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

(-)modules/http/http_filters.c (-6 / +29 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_INCOMPLETE;
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 388-394 Link Here
388
                              (ctx->remaining < 0) ? "(overflow)" : "");
405
                              (ctx->remaining < 0) ? "(overflow)" : "");
389
                ctx->remaining = 0; /* Reset it in case we have to
406
                ctx->remaining = 0; /* Reset it in case we have to
390
                                     * come back here later */
407
                                     * come back here later */
391
                if (APR_STATUS_IS_TIMEUP(rv)) { 
408
                if (rv != APR_SUCCESS) { 
392
                    http_error = HTTP_REQUEST_TIME_OUT;
409
                    http_error = HTTP_REQUEST_TIME_OUT;
393
                }
410
                }
394
                return bail_out_on_error(ctx, f, http_error);
411
                return bail_out_on_error(ctx, f, http_error);
Lines 439-444 Link Here
439
                        return APR_EAGAIN;
456
                        return APR_EAGAIN;
440
                    }
457
                    }
441
                    /* If we get an error, then leave */
458
                    /* If we get an error, then leave */
459
                    if (rv == APR_EOF) {
460
                        return APR_INCOMPLETE;
461
                    }
442
                    if (rv != APR_SUCCESS) {
462
                    if (rv != APR_SUCCESS) {
443
                        return rv;
463
                        return rv;
444
                    }
464
                    }
Lines 494-500 Link Here
494
                                  (ctx->remaining < 0) ? "(overflow)" : "");
514
                                  (ctx->remaining < 0) ? "(overflow)" : "");
495
                    ctx->remaining = 0; /* Reset it in case we have to
515
                    ctx->remaining = 0; /* Reset it in case we have to
496
                                         * come back here later */
516
                                         * come back here later */
497
                    if (APR_STATUS_IS_TIMEUP(rv)) { 
517
                    if (rv != APR_SUCCESS) { 
498
                        http_error = HTTP_REQUEST_TIME_OUT;
518
                        http_error = HTTP_REQUEST_TIME_OUT;
499
                    }
519
                    }
500
                    return bail_out_on_error(ctx, f, http_error);
520
                    return bail_out_on_error(ctx, f, http_error);
Lines 524-529 Link Here
524
544
525
    rv = ap_get_brigade(f->next, b, mode, block, readbytes);
545
    rv = ap_get_brigade(f->next, b, mode, block, readbytes);
526
546
547
    if (rv == APR_EOF && ctx->state != BODY_NONE &&
548
            ctx->remaining > 0) {
549
        return APR_INCOMPLETE;
550
    }
527
    if (rv != APR_SUCCESS) {
551
    if (rv != APR_SUCCESS) {
528
        return rv;
552
        return rv;
529
    }
553
    }
Lines 537-546 Link Here
537
561
538
    if (ctx->state != BODY_NONE) {
562
    if (ctx->state != BODY_NONE) {
539
        ctx->remaining -= totalread;
563
        ctx->remaining -= totalread;
540
        if (ctx->remaining > 0) {
564
        if (ctx->remaining > 0 && !APR_BRIGADE_EMPTY(b) &&
541
            e = APR_BRIGADE_LAST(b);
565
                APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(b))) {
542
            if (APR_BUCKET_IS_EOS(e))
566
            return APR_INCOMPLETE;
543
                return APR_EOF;
544
        }
567
        }
545
    }
568
    }
546
569

Return to bug 55475