httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <redd...@attglobal.net>
Subject Re: cvs commit: apache-2.0/src/main http_core.c http_protocol.c
Date Tue, 14 Nov 2000 03:26:21 GMT

>
> >   @@ -3008,7 +3010,7 @@
> >                if ((n < MIN_BUCKET_SIZE) && (n < ctx->avail)) {
> >                    /* Coalesce this bucket into the buffer */
> >                    if (ctx->buf == NULL) {
> >   -                    ctx->buf = apr_palloc(p, FILTER_BUFF_SIZE);
> >   +                    ctx->buf = apr_palloc(p, MIN_BYTES_TO_WRITE);
> >                        ctx->cur = ctx->buf;
> >                        ctx->cnt = 0;
> >                    }
> >   @@ -3051,13 +3053,13 @@
> >        }
> >
> >        if (pass_the_brigade) {
> >   -        /* Insert ctx->buf into the correct spotin the brigade */
> >   +        /* Insert ctx->buf into the correct spot in the brigade */
> >            if (insert_first) {
> >   -            e = ap_bucket_create_pool(ctx->buf, ctx->cnt, p);
> >   +            e = ap_bucket_create_heap(ctx->buf, ctx->cnt, 1, NULL);
>
> You can't do this.  This buffer was allocated out of a pool.  If you use a
> heap bucket for this, then when the pool goes away so does the data, even
> if it wasn't sent to the network yet.

Nope, will not happen. Arg 3 tells ap_bucket_create_heap to malloc the storage and copy buf
into it.

>
> >   -    ap_register_output_filter("COALESCE", coalesce_filter, AP_FTYPE_CONNECTION);
> >   +    ap_register_output_filter("COALESCE", coalesce_filter, AP_FTYPE_CONTENT);
>
> This is not a content filter.  If this filter goes into place, it should
> go as deep down the stack as it can, like under the http_header_filter.

Agreed. I ment to change this before I committed the patch.

>
> >  @@ -2519,6 +2517,11 @@
> >       ap_pass_brigade(f->next, b2);
> >
> >       if (r->chunked) {
> >   +        /* The coalesce filter is useful to coalesce content from the ap_r*
> >   +         * routines. Removing this filter should not break the server.
> >   +         */
> >   +        ap_add_output_filter("COALESCE", NULL, r, r->connection);
> >   +
>
> If this filter is really useful, then it should go in regardless of
> whether we are doing chunking or not.  If it isn't useful, then it should
> be removed and the underlying problems should be solved.
>

Heh, heh, this advice from you? :-)


Bill


Mime
View raw message