Skip to content

Commit

Permalink
Support LWP::ConnCache->new(total_capacity => undef)
Browse files Browse the repository at this point in the history
It means unlimited capacity; same behaviour as for the accessor.
  • Loading branch information
tadam authored and gisle committed Mar 14, 2011
1 parent 82548d7 commit 93c26dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/LWP/ConnCache.pm
Expand Up @@ -8,8 +8,11 @@ $VERSION = "6.00";

sub new {
my($class, %cnf) = @_;
my $total_capacity = delete $cnf{total_capacity};
$total_capacity = 1 unless defined $total_capacity;

my $total_capacity = 1;
if (exists $cnf{total_capacity}) {
$total_capacity = delete $cnf{total_capacity};
}
if (%cnf && $^W) {
require Carp;
Carp::carp("Unrecognised options: @{[sort keys %cnf]}")
Expand Down

0 comments on commit 93c26dd

Please sign in to comment.