Commit 6ef566ed authored by Graham Leggett's avatar Graham Leggett
Browse files

Optimise reset_filter() in http_protocol.c

PR:
Obtained from:
Submitted by:	Greg Stein
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89256 13f79535-47bb-0310-9956-ffa450edef68
parent c7b6869d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.19-dev

  *) Optimise reset_filter() in http_protocol.c. [Greg Stein]

  *) Add a check to ap_die() to make sure the filter stack is sane and
     contains the correct basic filters when an error occurs. This fixes
     a problem where headers are not being sent on error. [John Sterling]
+4 −14
Original line number Diff line number Diff line
@@ -1745,20 +1745,10 @@ static const char *get_canned_error_string(int status,

static void reset_filters(request_rec *r)
{
    ap_filter_t *f = r->output_filters;

    while (f) {
        if (!strcasecmp(f->frec->name, "CORE") ||
            !strcasecmp(f->frec->name, "CONTENT_LENGTH") ||
            !strcasecmp(f->frec->name, "HTTP_HEADER")) {
            f = f->next;
            continue;
        }
        else {
            ap_remove_output_filter(f);
            f = f->next;
        }
    }
    r->output_filters = NULL;
    ap_add_output_filter("CORE", NULL, r, r->connection);
    ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
    ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
}

/* We should have named this send_canned_response, since it is used for any