trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch 7.1.x updated: Fix for YTSATS-983
Date Fri, 03 Feb 2017 21:18:42 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/7.1.x by this push:
       new  96b5bbd   Fix for YTSATS-983
96b5bbd is described below

commit 96b5bbd23bc9e1bedd9c1f01fefa129b84eca92a
Author: Pushkar Pradhan <ppradhan@yahoo-inc.com>
AuthorDate: Thu Dec 15 17:30:46 2016 -0800

    Fix for YTSATS-983
    
    (cherry picked from commit 10c008baa48a5cff5bc36ab4cf60c6de6232fc2c)
---
 lib/perl/lib/Apache/TS/AdminClient.pm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index aa48d96..b236b80 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -184,6 +184,16 @@ sub _do_read {
 
     while ($self->{_select}->can_read($timeout)) {
         my $rc = $self->{_socket}->sysread($res, 1024, length($res));
+
+        # If the server dies we get into a infinite loop because
+        # IO::Select::can_read keeps returning true
+        # In this condition sysread returns 0 or undef
+        # Also, we want to return an undef rather than a partial response
+        # to avoid unmarshalling errors in the callers
+        if (!defined($rc) || ($rc == 0)) {
+            $res = undef;
+            last;
+        }
     }
 
     return $res || undef;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message