develooper Front page | perl.libwww | Postings from April 2001

Re: Apache error?

Thread Previous
From:
Gisle Aas
Date:
April 27, 2001 23:07
Subject:
Re: Apache error?
Message ID:
lr4rvaf1ho.fsf@caliper.ActiveState.com
Ulrich Wisser <u.wisser@publisher.de> writes:

> Hi Gisle,
> 
> 
> > > Any idea how to reset maxsize
> >
> >$ua->max_size(undef);
> 
> I'm afraid this won't work. I looked into the LWP sources
> and the _elem subroutine will online change the value, if
> the new value is defined.

It is a bug then.  Please try the following patch:

Index: lib/LWP/MemberMixin.pm
===================================================================
RCS file: /cvsroot/libwww-perl/lwp5/lib/LWP/MemberMixin.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -u -r1.5 -r1.6
--- lib/LWP/MemberMixin.pm	1997/12/02 13:22:52	1.5
+++ lib/LWP/MemberMixin.pm	2001/04/27 21:57:36	1.6
@@ -1,5 +1,5 @@
 #
-# $Id: MemberMixin.pm,v 1.5 1997/12/02 13:22:52 aas Exp $
+# $Id: MemberMixin.pm,v 1.6 2001/04/27 21:57:36 gisle Exp $
 
 package LWP::MemberMixin;
 
@@ -26,8 +26,8 @@ There is only one method provided:
 =item _elem($elem [, $val])
 
 Internal method to get/set the value of member variable
-C<$elem>. If C<$val> is defined it is used as the new value
-for the member variable.  If it is undefined the current
+C<$elem>. If C<$val> is present it is used as the new value
+for the member variable.  If it is not present the current
 value is not touched. In both cases the previous value of
 the member variable is returned.
 
@@ -37,9 +37,10 @@ the member variable is returned.
 
 sub _elem
 {
-    my($self, $elem, $val) = @_;
+    my $self = shift;
+    my $elem = shift;
     my $old = $self->{$elem};
-    $self->{$elem} = $val if defined $val;
+    $self->{$elem} = shift if @_;
     return $old;
 }
 
Regards,
Gisle

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About