trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject trafficserver git commit: TS-4282: Check for _do_read returning undef in AdminClient.pm This closes #527.
Date Wed, 16 Mar 2016 22:20:37 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master cd04bda90 -> 73dedc34b


TS-4282: Check for _do_read returning undef in AdminClient.pm
This closes #527.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/73dedc34
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/73dedc34
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/73dedc34

Branch: refs/heads/master
Commit: 73dedc34b61033978032941a1408487f760b0d49
Parents: cd04bda
Author: Alan M. Carroll <amc@apache.org>
Authored: Wed Mar 16 15:36:23 2016 -0500
Committer: Alan M. Carroll <amc@apache.org>
Committed: Wed Mar 16 17:19:29 2016 -0500

----------------------------------------------------------------------
 lib/perl/lib/Apache/TS/AdminClient.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73dedc34/lib/perl/lib/Apache/TS/AdminClient.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index 00a3bf2..4ef0a28 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -197,7 +197,6 @@ sub _do_read {
 sub get_stat {
     my ($self, $stat) = @_;
     my $res               = "";
-    my $max_read_attempts = 25;
 
     return undef unless defined($self->{_socket});
     return undef unless $self->{_select}->can_write(10);
@@ -210,6 +209,7 @@ sub get_stat {
     my $msg = pack("ll/Z", TS_RECORD_GET, $stat);
     $self->{_socket}->print(pack("l/a", $msg));
     $res = $self->_do_read();
+    return undef unless defined($res); # Don't proceed on read failure.
 
     # The response format is:
     #   MGMT_MARSHALL_INT: message length


Mime
View raw message