You can give this a go. Maybe it's something I'm doing in there that is causing the problem, not sure.
Anyway, you'll notice commented flush buckets. When you turn them on, the output should start making sense. I'm also attaching the test file. On Thu, 2003-08-07 at 23:06, Cliff Woolley wrote: > I'll try to construct a test for that case and see what's going on in core > output. Hey Greg... seen anything like this? -- Bojan
/** * mod_testfilebucket.c * * This software is licensed under GNU General Public License * http://www.gnu.org/copyleft/gpl.html * * Bojan Smojver, Rexursive, 2003 * */ #include "apr.h" #include "apr_strings.h" #include "apr_lib.h" #include "apr_hash.h" #include "apr_optional.h" #define APR_WANT_STRFUNC #include "apr_want.h" #include "ap_config.h" #include "util_filter.h" #include "httpd.h" #include "http_core.h" #include "http_config.h" #include "http_log.h" module AP_MODULE_DECLARE_DATA testfilebucket_module; #define TEST_MAGIC_TYPE "httpd/testfilebucket" /* * The handlers... */ static int testfilebucket_handler(request_rec *r){ conn_rec *c=r->connection; apr_bucket_brigade *bb; apr_bucket *b; apr_file_t *fp; char *buffer; if(strcmp(r->handler,TEST_MAGIC_TYPE) && strcmp(r->handler,"testfilebucket")) return DECLINED; buffer=apr_pstrdup(r->pool,"SOME TEXT\n"); bb=apr_brigade_create(r->pool,c->bucket_alloc); apr_file_open(&fp,r->filename,APR_READ,APR_OS_DEFAULT,r->pool); b=apr_bucket_file_create(fp,0,3200,r->pool,c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb,b); // b=apr_bucket_flush_create(c->bucket_alloc); // APR_BRIGADE_INSERT_TAIL(bb,b); b=apr_bucket_pool_create(buffer,10,r->pool,c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb,b); b=apr_bucket_file_create(fp,3210,80,r->pool,c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb,b); // b=apr_bucket_flush_create(c->bucket_alloc); // APR_BRIGADE_INSERT_TAIL(bb,b); b=apr_bucket_pool_create(buffer,10,r->pool,c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb,b); b=apr_bucket_file_create(fp,3300,3200,r->pool,c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb,b); // b=apr_bucket_flush_create(c->bucket_alloc); // APR_BRIGADE_INSERT_TAIL(bb,b); ap_pass_brigade(r->output_filters,bb); return OK; } /* * The hooks... */ static void register_hooks(apr_pool_t *p){ ap_hook_handler(testfilebucket_handler,NULL,NULL,APR_HOOK_MIDDLE); } module AP_MODULE_DECLARE_DATA testfilebucket_module={ STANDARD20_MODULE_STUFF, NULL, /* create per-dir config */ NULL, /* merge per-dir config */ NULL, /* server config */ NULL, /* merge server config */ NULL, /* command apr_table_t */ register_hooks /* register hooks */ };
0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 *rubbish* 0123456789012345678901234567890123456789012345678901234567890123456789012345678 *rubbish* 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 *rubbish* 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 *rubbish* 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678 0123456789012345678901234567890123456789012345678901234567890123456789012345678