Skip Menu |

This queue is for tickets about the HTTP-Proxy CPAN distribution.

Report information
The Basics
Id: 33018
Status: resolved
Priority: 0/
Queue: HTTP-Proxy

People
Owner: Nobody in particular
Requestors: GWOLF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.20
Fixed in: 0.21



Subject: save filter "filename" parameter used invalidly
Hi, I'm forwarding this bug to CPAN's RT as it was filed in Debian's BTS - For further information or direct contact with the original submitter, please refer to: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=433951 The patch I'm attaching here contains both of the submitted patches. Thanks, ----------------------------------------- Hi, consider the attached patch. It adopts the code to the documentation (see inline pod). bye, Roland Further info: The "filename" member should be a function, as documented, not a further indirection. Hi, I'm attaching an additional (incremental) patch that fixes additional use of the filename. It is only initialized there as a string without being used as such. Therefore, this should be removed to not confuse the other use of it (as a code reference). Looks like this part of the code has never been tested before. ;) (A colleague of mine discovered this, feel free to ask me if the issue (and resolution) is still unclear.) bye, Roland
Subject: libhttp-proxy-perl.diff
Index: lib/HTTP/Proxy/BodyFilter/save.pm =================================================================== --- lib/HTTP/Proxy/BodyFilter/save.pm (revision 14625) +++ lib/HTTP/Proxy/BodyFilter/save.pm (working copy) @@ -58,7 +58,7 @@ my $file = ''; if( defined $self->{_hpbf_save_filename} ) { # use the user-provided callback - $file = &{ $self->{_hpbf_save_filename} }->($message); + $file = &{ $self->{_hpbf_save_filename} }($message); unless ( defined $file and $file ne '' ) { $self->proxy->log( HTTP::Proxy::FILTERS, "HTBF::save", "Filter will not save $uri" ); @@ -92,7 +92,6 @@ $file = File::Spec->rel2abs( $file ); # internal data initialisation - $self->{_hpbf_save_filename} = ""; $self->{_hpbf_save_fh} = undef; # create the directory @@ -132,7 +131,6 @@ } # we have an open filehandle - $self->{_hpbf_save_filename} = $file.$ext; binmode( $self->{_hpbf_save_fh} ); # for Win32 and friends $self->proxy->log( HTTP::Proxy::FILTERS, "HPBF::save", "Saving $uri to $file$ext" );
On Fri Feb 08 10:17:24 2008, GWOLF wrote: Show quoted text
> > I'm forwarding this bug to CPAN's RT as it was filed in Debian's BTS - > For further information or direct contact with the original submitter, > please refer to: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=433951 > > The patch I'm attaching here contains both of the submitted patches. >
Thanks for the reports. This and other problems with HTTP::Proxy::BodyFilter::save have prompted me to write a comprehensive test suite for it. This bug and a few others have been fixed. These fixes will be available in version 0.21, which should appear on CPAN very soon. -- BooK