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

(-)modules/http/http_filters.c (-6 / +14 lines)
Lines 1234-1239 AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade Link Here
1234
{
1234
{
1235
    request_rec *r = f->r;
1235
    request_rec *r = f->r;
1236
    conn_rec *c = r->connection;
1236
    conn_rec *c = r->connection;
1237
    int header_only = (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status));
1237
    const char *protocol = NULL;
1238
    const char *protocol = NULL;
1238
    apr_bucket *e;
1239
    apr_bucket *e;
1239
    apr_bucket_brigade *b2;
1240
    apr_bucket_brigade *b2;
Lines 1251-1257 AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade Link Here
1251
    }
1252
    }
1252
    else if (ctx->headers_sent) {
1253
    else if (ctx->headers_sent) {
1253
        /* Eat body if response must not have one. */
1254
        /* Eat body if response must not have one. */
1254
        if (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status)) {
1255
        if (header_only) {
1255
            /* Still next filters may be waiting for EOS, so pass it (alone)
1256
            /* Still next filters may be waiting for EOS, so pass it (alone)
1256
             * when encountered and be done with this filter.
1257
             * when encountered and be done with this filter.
1257
             */
1258
             */
Lines 1448-1461 AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade Link Here
1448
1449
1449
    terminate_header(b2);
1450
    terminate_header(b2);
1450
1451
1452
    if (header_only) {
1453
        e = APR_BRIGADE_LAST(b);
1454
        if (APR_BUCKET_IS_EOS(e)) {
1455
            APR_BUCKET_REMOVE(e);
1456
            APR_BRIGADE_INSERT_TAIL(b2, e);
1457
            ap_remove_output_filter(f);
1458
        }
1459
        apr_brigade_cleanup(b);
1460
    }
1461
1451
    rv = ap_pass_brigade(f->next, b2);
1462
    rv = ap_pass_brigade(f->next, b2);
1452
    if (rv != APR_SUCCESS) {
1463
    apr_brigade_cleanup(b2);
1453
        goto out;
1454
    }
1455
    ctx->headers_sent = 1;
1464
    ctx->headers_sent = 1;
1456
1465
1457
    if (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status)) {
1466
    if (rv != APR_SUCCESS || header_only) {
1458
        apr_brigade_cleanup(b);
1459
        goto out;
1467
        goto out;
1460
    }
1468
    }
1461
1469

Return to bug 63192