stas 2003/11/06 11:59:25
Modified: src/modules/perl modperl_io_apache.c Log: assertions are ugly as they cause a segfault without telling the end user what the problem is. Use a proper setting of $! if seeing an empty bucket brigade instead. Revision Changes Path 1.12 +10 -1 modperl-2.0/src/modules/perl/modperl_io_apache.c Index: modperl_io_apache.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io_apache.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -u -r1.11 -r1.12 --- modperl_io_apache.c 6 Nov 2003 11:44:07 -0000 1.11 +++ modperl_io_apache.c 6 Nov 2003 19:59:25 -0000 1.12 @@ -294,7 +294,16 @@ * handle APR_BLOCK_READ requests by returning data when * requested. */ - AP_DEBUG_ASSERT(!APR_BRIGADE_EMPTY(bb)); + if (APR_BRIGADE_EMPTY(bb)) { + apr_brigade_destroy(bb); + /* we can't tell which filter is broken, since others may + * just pass data through */ + sv_setpv(ERRSV, "Aborting read from client. " + "One of the input filters is broken. " + "It returned an empty bucket brigade for " + "the APR_BLOCK_READ mode request"); + return -1; + } if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) { seen_eos = 1;