httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@apache.org>
Subject Re: cvs commit: httpd-2.0/modules/filters mod_include.c
Date Thu, 20 Jun 2002 03:05:13 GMT
On Thu, Jun 20, 2002 at 02:59:25AM -0000, brianp@apache.org wrote:
>   @@ -3238,7 +3239,30 @@
>                }
>                               /* Set aside tag, pass pre-tag... */
>                tag_and_after = apr_brigade_split(*bb, ctx->head_start_bucket);
>   -            ap_save_brigade(f, &ctx->ssi_tag_brigade, &tag_and_after, r->pool);
>   +            rv = ap_pass_brigade(f->next, *bb);

Why not check for the error here rather than down below?  We'd also
lose the result code (if any) for the EOS being sent down.  -- justin

>   +            /* Set aside the partial tag
>   +             * Exception: if there's an EOS at the end of this brigade,
>   +             * the tag will never be completed, so send an error and EOS
>   +             */
>   +            last = APR_BRIGADE_LAST(tag_and_after);
>   +            if (APR_BUCKET_IS_EOS(last)) {
>   +                /* Remove everything before the EOS (i.e., the partial tag)
>   +                 * and replace it with an error msg */
>   +                apr_bucket *b;
>   +                apr_bucket *err_bucket = NULL;
>   +                for (b = APR_BRIGADE_FIRST(tag_and_after);
>   +                     !APR_BUCKET_IS_EOS(b);
>   +                     b = APR_BRIGADE_FIRST(tag_and_after)) {
>   +                    APR_BUCKET_REMOVE(b);
>   +                    apr_bucket_destroy(b);
>   +                }
>   +                CREATE_ERROR_BUCKET(ctx, err_bucket, b, err_bucket);
>   +                ap_pass_brigade(f->next, tag_and_after);
>   +            }
>   +            else {
>   +                ap_save_brigade(f, &ctx->ssi_tag_brigade,
>   +                                &tag_and_after, r->pool);
>   +            }
>                if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(ctx->ssi_tag_brigade))) {
>                    apr_bucket *new_eos;
>                    /* Make sure there's no EOS at the end of the set-aside
>   @@ -3253,7 +3277,7 @@
>                    new_eos = apr_bucket_eos_create((*bb)->bucket_alloc);
>                    APR_BRIGADE_INSERT_TAIL(*bb, new_eos);
>                }
>   -            rv = ap_pass_brigade(f->next, *bb);
>   +
>                if (rv != APR_SUCCESS) {
>                    return rv;
>                }
>   
>   
>   

Mime
View raw message