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

(-)modules/http/http_filters.c (-4 / +30 lines)
Lines 87-92 static apr_status_t bail_out_on_error(http_ctx_t * Link Here
87
    apr_bucket_brigade *bb = ctx->bb;
87
    apr_bucket_brigade *bb = ctx->bb;
88
88
89
    apr_brigade_cleanup(bb);
89
    apr_brigade_cleanup(bb);
90
91
    if (f->r->proxyreq == PROXYREQ_RESPONSE) {
92
        switch (http_error) {
93
        case HTTP_REQUEST_TIME_OUT:
94
            return APR_ECONNABORTED;
95
96
        case HTTP_REQUEST_ENTITY_TOO_LARGE:
97
            return APR_ENOSPC;
98
99
        case HTTP_NOT_IMPLEMENTED:
100
            return APR_ENOTIMPL;
101
102
        default:
103
            return APR_EGENERAL;
104
        }
105
    }
106
90
    e = ap_bucket_error_create(http_error,
107
    e = ap_bucket_error_create(http_error,
91
                               NULL, f->r->pool,
108
                               NULL, f->r->pool,
92
                               f->c->bucket_alloc);
109
                               f->c->bucket_alloc);
Lines 396-402 apr_status_t ap_http_filter(ap_filter_t *f, apr_bu Link Here
396
                              (ctx->remaining < 0) ? "(overflow)" : "");
413
                              (ctx->remaining < 0) ? "(overflow)" : "");
397
                ctx->remaining = 0; /* Reset it in case we have to
414
                ctx->remaining = 0; /* Reset it in case we have to
398
                                     * come back here later */
415
                                     * come back here later */
399
                if (APR_STATUS_IS_TIMEUP(rv)) {
416
                if (rv != APR_SUCCESS) {
400
                    http_error = HTTP_REQUEST_TIME_OUT;
417
                    http_error = HTTP_REQUEST_TIME_OUT;
401
                }
418
                }
402
                return bail_out_on_error(ctx, f, http_error);
419
                return bail_out_on_error(ctx, f, http_error);
Lines 447-452 apr_status_t ap_http_filter(ap_filter_t *f, apr_bu Link Here
447
                        return APR_EAGAIN;
464
                        return APR_EAGAIN;
448
                    }
465
                    }
449
                    /* If we get an error, then leave */
466
                    /* If we get an error, then leave */
467
                    if (rv == APR_EOF) {
468
                        return APR_ECONNABORTED;
469
                    }
450
                    if (rv != APR_SUCCESS) {
470
                    if (rv != APR_SUCCESS) {
451
                        return rv;
471
                        return rv;
452
                    }
472
                    }
Lines 502-508 apr_status_t ap_http_filter(ap_filter_t *f, apr_bu Link Here
502
                                  (ctx->remaining < 0) ? "(overflow)" : "");
522
                                  (ctx->remaining < 0) ? "(overflow)" : "");
503
                    ctx->remaining = 0; /* Reset it in case we have to
523
                    ctx->remaining = 0; /* Reset it in case we have to
504
                                         * come back here later */
524
                                         * come back here later */
505
                    if (APR_STATUS_IS_TIMEUP(rv)) {
525
                    if (rv != APR_SUCCESS) {
506
                        http_error = HTTP_REQUEST_TIME_OUT;
526
                        http_error = HTTP_REQUEST_TIME_OUT;
507
                    }
527
                    }
508
                    return bail_out_on_error(ctx, f, http_error);
528
                    return bail_out_on_error(ctx, f, http_error);
Lines 532-537 apr_status_t ap_http_filter(ap_filter_t *f, apr_bu Link Here
532
552
533
    rv = ap_get_brigade(f->next, b, mode, block, readbytes);
553
    rv = ap_get_brigade(f->next, b, mode, block, readbytes);
534
554
555
    if (rv == APR_EOF && ctx->state != BODY_NONE &&
556
            ctx->remaining > 0) {
557
        return APR_ECONNABORTED;
558
    }
535
    if (rv != APR_SUCCESS) {
559
    if (rv != APR_SUCCESS) {
536
        return rv;
560
        return rv;
537
    }
561
    }
Lines 547-554 apr_status_t ap_http_filter(ap_filter_t *f, apr_bu Link Here
547
        ctx->remaining -= totalread;
571
        ctx->remaining -= totalread;
548
        if (ctx->remaining > 0) {
572
        if (ctx->remaining > 0) {
549
            e = APR_BRIGADE_LAST(b);
573
            e = APR_BRIGADE_LAST(b);
550
            if (APR_BUCKET_IS_EOS(e))
574
            if (APR_BUCKET_IS_EOS(e)) {
551
                return APR_EOF;
575
                apr_bucket_delete(e);
576
                return APR_ECONNABORTED;
577
            }
552
        }
578
        }
553
    }
579
    }
554
580

Return to bug 55475