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

Setting LWP::ConnCache total_capacity from LWP::UserAgent

Thread Next
Blair Zajac
October 27, 2001 19:21
Setting LWP::ConnCache total_capacity from LWP::UserAgent
Message ID:
Reading the manual page for the new LWP::ConnCache in the CPAN released
libwww-perl, I thought that I could set an unlimited total_capacity by
doing something like this:

	require LWP::UserAgent;
	my $ua = LWP::UserAgent->new(keep_alive => undef);

However, the code in LWP::UserAgent::new just does

    my $keep_alive = delete $cnf{keep_alive};

and it doesn't distinguish between a keep_alive being set to an undef value
or no keep_alive being set.

So it looks like currently the way to do this would be

	require LWP::UserAgent;
	my %conn_cache = (keep_alive => undef);
	my $ua = LWP::UserAgent->new(conn_cache = \%conn_cache);

This isn't too clear.

The following patch fixes this.


Blair Zajac <> - Perl & sysadmin services for hire
Web and OS performance plots -
Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About