httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: [PATCH] Take 3 of httpd filter rewrite...
Date Sat, 29 Sep 2001 04:29:32 GMT
> Index: server/core.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/core.c,v
> retrieving revision 1.61
> diff -u -r1.61 core.c
> --- server/core.c	2001/09/19 05:52:42	1.61
> +++ server/core.c	2001/09/24 20:46:51
> @@ -2753,23 +2753,145 @@
>      return ap_pass_brigade(r->output_filters, bb);
>  }
>
> +typedef struct core_filter_ctx {
> +    apr_bucket_brigade *b;
> +} core_ctx_t;
> +
>  static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
> ap_input_mode_t mode, apr_off_t *readbytes) {
>      apr_bucket *e;
> +    apr_status_t rv;
> +    core_ctx_t *ctx = f->ctx;
> +    char *buff, *pos;
> +    apr_size_t len;
> +
> +    if (!ctx)
> +    {
> +        f->ctx = ctx = apr_pcalloc(f->c->pool, sizeof(*ctx));
> +        ctx->b = apr_brigade_create(f->c->pool);
>
> -    if (!f->ctx) {    /* If we haven't passed up the socket yet... */
> -        f->ctx = (void *)1;
> +        /* seed the brigade with the client socket. */
>          e = apr_bucket_socket_create(f->c->client_socket);

I agree with Greg that creating this socket bucket isn't necessary.  This filter
should just read from the network.

> +        apr_brigade_partition(ctx->b, *readbytes, &e);
> +        /* Must do split before CONCAT */
> +        if (e != APR_BRIGADE_SENTINEL(ctx->b)) {
> +            newbb = apr_brigade_split(ctx->b, e);
> +        }
> +        APR_BRIGADE_CONCAT(b, ctx->b);

I'm assuming this has been removed since this patch was posted.

Looks good to me.  I would prefer it if this wasn't committed until the server
was working correctly again, because that would make debugging any bugs
that are introduced much easier.  But, I am NOT even asking for that delay.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Mime
View raw message