httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: cvs commit: apache-2.0/src/main http_core.c http_protocol.c
Date Fri, 03 Nov 2000 01:27:11 GMT
On Fri, 3 Nov 2000, Sascha Schumann wrote:

> > This is fine, because if it is possible for the request to be streamed, we
> > just remove the filter.  That is done by the first if statement in the
> > function.
> 
>     Could you point me to the condition you refer to?

AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f,
                                                              ap_bucket_brigade *b)
{
    request_rec *r = f->r;
    struct content_length_ctx *ctx;
    apr_status_t rv;
    ap_bucket *e;

    ctx = f->ctx;
    if (!ctx) { /* first time through */
        /* We won't compute a content length if one of the following is true:
         * . subrequest
         * . HTTP/0.9
         * . status HTTP_NOT_MODIFIED or HTTP_NO_CONTENT
         * . HEAD
         * . content length already computed
         * . can be chunked
         * . body already chunked
         * Much of this should correspond to checks in ap_set_keepalive().
         */
        if (r->assbackwards 
            || r->status == HTTP_NOT_MODIFIED 
            || r->status == HTTP_NO_CONTENT
            || r->header_only
            || apr_table_get(r->headers_out, "Content-Length")
            || r->proto_num == HTTP_VERSION(1,1)
            || ap_find_last_token(f->r->pool,
                                  apr_table_get(r->headers_out,
                                                "Transfer-Encoding"),
                                  "chunked")) {
            ap_remove_output_filter(f);
            return ap_pass_brigade(f->next, b);
        }

        f->ctx = ctx = apr_pcalloc(r->pool, sizeof(struct content_length_ctx));
    }

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message