From 667ab05ac384d30dfc85ffebcdea2c6a636ed6cf Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Tue, 12 Dec 2017 15:24:03 +0100 Subject: [PATCH] TT#26808 use read_timeout for the UA timeout * read_timeout value is used to define the default UA timeout, it fallbacks to 180 if not set Change-Id: I98f8f3df8434a048ee0e63c72052b8f0f3af189b --- lib/NGCP/API/Client.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/NGCP/API/Client.pm b/lib/NGCP/API/Client.pm index 1ad78c6..bc25a95 100644 --- a/lib/NGCP/API/Client.pm +++ b/lib/NGCP/API/Client.pm @@ -29,6 +29,7 @@ sub new { $opts{iface} = $cfg->{_}->{NGCP_API_IFACE}; $opts{sslverify} = $cfg->{_}->{NGCP_API_SSLVERIFY} || 'yes'; $opts{sslverify_lb} = $cfg->{_}->{NGCP_API_SSLVERIFY_LOOPBACK} || 'no'; + $opts{read_timeout} = $cfg->{_}->{NGCP_API_READ_TIMEOUT} || 180; $opts{auth_user} = $cfg->{_}->{AUTH_SYSTEM_LOGIN}; $opts{auth_pass} = $cfg->{_}->{AUTH_SYSTEM_PASSWORD}; $opts{verbose} = 0; @@ -61,6 +62,8 @@ sub _create_ua { $ua->add_handler("response_done", sub { shift->dump; return }); } + $ua->timeout($opts{read_timeout}); + return ($ua,$urlbase); }