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

Setting LWP::ConnCache total_capacity from LWP::UserAgent

Thread Next
From:
Blair Zajac
Date:
October 27, 2001 19:21
Subject:
Setting LWP::ConnCache total_capacity from LWP::UserAgent
Message ID:
3BDB47A7.383AAEB2@orcaware.com
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

-- 
Blair Zajac <blair@orcaware.com> - Perl & sysadmin services for hire
Web and OS performance plots - http://www.orcaware.com/orca/
Thread Next


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