From 56bafa3cb462b95feacc82d1fd4f16c7984ff3a2 Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Thu, 2 Sep 2010 19:36:51 +0100 Subject: increase LWP MaxLineLength to allow long riak Link http headers --- lib/Net/Riak/Role/UserAgent.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Net') diff --git a/lib/Net/Riak/Role/UserAgent.pm b/lib/Net/Riak/Role/UserAgent.pm index 4c6cb1f..ecc412f 100644 --- a/lib/Net/Riak/Role/UserAgent.pm +++ b/lib/Net/Riak/Role/UserAgent.pm @@ -11,6 +11,13 @@ has useragent => ( lazy => 1, default => sub { my $self = shift; + + # The Links header Riak returns (esp. for buckets) can get really long, + # so here increase the MaxLineLength LWP will accept (default = 8192) + my %opts = @LWP::Protocol::http::EXTRA_SOCK_OPTS; + $opts{MaxLineLength} = 65_536; + @LWP::Protocol::http::EXTRA_SOCK_OPTS = %opts; + my $ua = LWP::UserAgent->new; $ua->timeout(3); $ua; -- cgit 1.4.1