trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject git commit: TS-2774: TS::AdminClient.pm's get_stat API broken in 5.0
Date Fri, 02 May 2014 17:02:14 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 72782383e -> b1c3b758a


TS-2774: TS::AdminClient.pm's get_stat API broken in 5.0


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

Branch: refs/heads/master
Commit: b1c3b758aaa33a20975724bcb0d906b4600886cd
Parents: 7278238
Author: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Authored: Fri May 2 09:55:18 2014 -0700
Committer: Bryan Call <bcall@apache.org>
Committed: Fri May 2 10:01:39 2014 -0700

----------------------------------------------------------------------
 lib/perl/lib/Apache/TS/AdminClient.pm | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b1c3b758/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 c7a6d1f..edd9683 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -208,24 +208,25 @@ sub get_stat {
     $self->{_socket}->print(pack("sla*", TS_RECORD_GET, length($stat)), $stat);
     $res = $self->_do_read();
 
-    my @resp = unpack("sls", $res);
-    return undef unless (scalar(@resp) == 3);
+    my @resp = unpack("slls", $res);
+    return undef unless (scalar(@resp) == 4);
 
     if ($resp[0] == TS_ERR_OKAY) {
-        if ($resp[2] < TS_REC_FLOAT) {
-            @resp = unpack("slsq", $res);
-            return undef unless (scalar(@resp) == 4);
-            return int($resp[3]);
+        if ($resp[3] < TS_REC_FLOAT) {
+            @resp = unpack("sllsq", $res);
+            return undef unless (scalar(@resp) == 5);
+            return int($resp[4]);
         }
-        elsif ($resp[2] == TS_REC_FLOAT) {
-            @resp = unpack("slsf", $res);
-            return undef unless (scalar(@resp) == 4);
-            return $resp[3];
+        elsif ($resp[3] == TS_REC_FLOAT) {
+            @resp = unpack("sllsf", $res);
+            return undef unless (scalar(@resp) == 5);
+            return $resp[4];
         }
-        elsif ($resp[2] == TS_REC_STRING) {
-            @resp = unpack("slsa*", $res);
-            return undef unless (scalar(@resp) == 4);
-            return $resp[3];
+        elsif ($resp[3] == TS_REC_STRING) {
+            @resp = unpack("sllsa*", $res);
+            return undef unless (scalar(@resp) == 5);
+	    my @result = split($stat, $resp[4]);
+            return $result[0];
         }
     }
 


Mime
View raw message