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

(-)modules/http/http_filters.c (-6 / +14 lines)
Lines 1289-1294 AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade Link Here
1289
{
1289
{
1290
    request_rec *r = f->r;
1290
    request_rec *r = f->r;
1291
    conn_rec *c = r->connection;
1291
    conn_rec *c = r->connection;
1292
    int header_only = (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status));
1292
    const char *clheader;
1293
    const char *clheader;
1293
    const char *protocol = NULL;
1294
    const char *protocol = NULL;
1294
    apr_bucket *e;
1295
    apr_bucket *e;
Lines 1307-1313 AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade Link Here
1307
    }
1308
    }
1308
    else if (ctx->headers_sent) {
1309
    else if (ctx->headers_sent) {
1309
        /* Eat body if response must not have one. */
1310
        /* Eat body if response must not have one. */
1310
        if (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status)) {
1311
        if (header_only) {
1311
            /* Still next filters may be waiting for EOS, so pass it (alone)
1312
            /* Still next filters may be waiting for EOS, so pass it (alone)
1312
             * when encountered and be done with this filter.
1313
             * when encountered and be done with this filter.
1313
             */
1314
             */
Lines 1522-1535 AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade Link Here
1522
1523
1523
    terminate_header(b2);
1524
    terminate_header(b2);
1524
1525
1526
    if (header_only) {
1527
        e = APR_BRIGADE_LAST(b);
1528
        if (APR_BUCKET_IS_EOS(e)) {
1529
            APR_BUCKET_REMOVE(e);
1530
            APR_BRIGADE_INSERT_TAIL(b2, e);
1531
            ap_remove_output_filter(f);
1532
        }
1533
        apr_brigade_cleanup(b);
1534
    }
1535
1525
    rv = ap_pass_brigade(f->next, b2);
1536
    rv = ap_pass_brigade(f->next, b2);
1526
    if (rv != APR_SUCCESS) {
1537
    apr_brigade_cleanup(b2);
1527
        goto out;
1528
    }
1529
    ctx->headers_sent = 1;
1538
    ctx->headers_sent = 1;
1530
1539
1531
    if (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status)) {
1540
    if (rv != APR_SUCCESS || header_only) {
1532
        apr_brigade_cleanup(b);
1533
        goto out;
1541
        goto out;
1534
    }
1542
    }
1535
1543

Return to bug 63192