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" );