v4
This commit is contained in:
parent
22d6609a55
commit
715100e4ed
9
xtrd.pl
9
xtrd.pl
@ -7,7 +7,7 @@ use Socket;
|
||||
use DBI;
|
||||
use File::Fetch;
|
||||
use PerlIO::gzip;
|
||||
use LWP::UserAgent;
|
||||
use HTTP::Tiny;
|
||||
use HTTP::Request;
|
||||
use Data::Validate::IP qw(is_ipv4);
|
||||
use Data::Dumper;
|
||||
@ -88,10 +88,9 @@ sub check_server_status
|
||||
{
|
||||
my ($hostname,$port) = @_;
|
||||
my $url = "http://".$hostname.":".$port."/v3/client/info/version";
|
||||
my $ua = LWP::UserAgent->new(timeout => 2);
|
||||
my $req = HTTP::Request->new("GET", $url);
|
||||
my $response = $ua->request($req);
|
||||
my @return_code = ($response->is_success, $response->decoded_content);
|
||||
my $httptiny = HTTP::Tiny->new("timeout" => 2);
|
||||
my $response = $httptiny->request("GET",$url);
|
||||
my @return_code = ($response->{'success'}, $response->{'content'});
|
||||
return @return_code;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user