Hi all - I am trying to change the content-length in an output filter, following the example in the mp2 docs:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Setting_the_Content_Length_Header_in_Request_Output_Filters I have copied the example _exactly_, except: -> use $f->ctx inplace rather than a separate $ctx. -> omitted the '$bdata =~ s/-//g;' line (what the heck is that?) -> added some STDERR debugging prints: for( my $b = $bb->first; $b; $b = $bb->next( $b ) ) { print STDERR "invoked: ", $f->ctx->{invoked}, " bucket type: ",b->type->name; $seen_eos++, last if $b->is_eos; $b->read( my $bdata ); print STDERR " data: [$bdata]\n"; push @data, $bdata; } Works fine for normal pages; however in an error (NOT FOUND, etc) I get lots of duplicate bucket data. Here is a snippet of a 404: [... snipped a bunch of empty buckets ...] invoked: 11 bucket type: MMAP data: [] invoked: 11 bucket type: MMAP data: [] invoked: 11 bucket type: MMAP data: [<?xml version="1.0" encoding="] invoked: 12 bucket type: MMAP data: [] invoked: 12 bucket type: MMAP data: [] invoked: 12 bucket type: MMAP data: [] invoked: 12 bucket type: MMAP data: [] invoked: 12 bucket type: MMAP data: [] invoked: 12 bucket type: MMAP data: [] invoked: 12 bucket type: MMAP data: [<?xml version="1.0" encoding="] invoked: 12 bucket type: POOL data: [ISO-8859-1] invoked: 12 bucket type: MMAP data: ["?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="] invoked: 13 bucket type: MMAP data: [] invoked: 13 bucket type: MMAP data: [] invoked: 13 bucket type: MMAP data: [] invoked: 13 bucket type: MMAP data: [] invoked: 13 bucket type: MMAP data: [] invoked: 13 bucket type: MMAP data: [] invoked: 13 bucket type: MMAP data: [<?xml version="1.0" encoding="] invoked: 13 bucket type: POOL data: [ISO-8859-1] invoked: 13 bucket type: MMAP data: ["?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="] invoked: 13 bucket type: POOL data: [en] invoked: 13 bucket type: MMAP data: [" xml:lang="] [... snipped the rest ...] Needless to say the returned page is trashed. What am I missing? At the bottom of your filters tutorial, you mention some important consideratons about checking the bucket type before saving it, but I can't really see how this works. Oh, I am using mp2 svn, apache 2.3 trunk svn, perl 5.8.7, on a Gentoo Linux box. Aloha => Beau;