Return-Path: Delivered-To: apmail-perl-modperl-cvs-archive@perl.apache.org Received: (qmail 53412 invoked by uid 500); 13 May 2003 09:18:59 -0000 Mailing-List: contact modperl-cvs-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@perl.apache.org Received: (qmail 53399 invoked by uid 500); 13 May 2003 09:18:59 -0000 Delivered-To: apmail-modperl-2.0-cvs@apache.org Date: 13 May 2003 09:18:58 -0000 Message-ID: <20030513091858.80987.qmail@icarus.apache.org> From: stas@apache.org To: modperl-2.0-cvs@apache.org Subject: cvs commit: modperl-2.0/src/modules/perl modperl_filter.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stas 2003/05/13 02:18:58 Modified: src/modules/perl modperl_filter.c Log: simplify modperl_input_filter_flush to call the appropriate eos/flush functions and add tracing from there. remove a potential problem where ->eos is reset when flush is sent Revision Changes Path 1.64 +13 -10 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- modperl_filter.c 9 May 2003 03:33:01 -0000 1.63 +++ modperl_filter.c 13 May 2003 09:18:58 -0000 1.64 @@ -39,6 +39,8 @@ apr_bucket *b = apr_bucket_eos_create(ba); APR_BRIGADE_INSERT_TAIL(filter->bb_out, b); ((modperl_filter_ctx_t *)filter->f->ctx)->sent_eos = 1; + MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT + "write out: EOS bucket\n", MP_FILTER_NAME(filter->f)); return APR_SUCCESS; } @@ -47,6 +49,8 @@ apr_bucket_alloc_t *ba = filter->f->c->bucket_alloc; apr_bucket *b = apr_bucket_flush_create(ba); APR_BRIGADE_INSERT_TAIL(filter->bb_out, b); + MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT + "write out: FLUSH bucket\n", MP_FILTER_NAME(filter->f)); return APR_SUCCESS; } @@ -653,16 +657,15 @@ /* no data should be sent after EOS has been sent */ return filter->rc; } - - if (filter->eos || filter->flush) { - MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT - "write out: %s bucket\n", - MP_FILTER_NAME(filter->f), - filter->eos ? "EOS" : "FLUSH"); - filter->rc = filter->eos ? - send_input_eos(filter) : send_input_flush(filter); - /* modperl_brigade_dump(filter->bb_out, stderr); */ - filter->flush = filter->eos = 0; + + if (filter->flush) { + filter->rc = send_input_flush(filter); + filter->flush = 0; + } + + if (filter->eos) { + filter->rc = send_input_eos(filter); + filter->eos = 0; } return filter->rc;