trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yun...@apache.org
Subject git commit: TS-2174: Assign proper type for uninitialized expression token
Date Wed, 04 Sep 2013 18:19:29 GMT
Updated Branches:
  refs/heads/master 0ec6fc7e1 -> b71ca5521


TS-2174: Assign proper type for uninitialized expression token

In librecords, not all token are register at initialization,
we must assign proper type if it is undefined.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>


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

Branch: refs/heads/master
Commit: b71ca5521466b22b44500bd09adb128081a573ea
Parents: 0ec6fc7
Author: Yunkai Zhang <qiushu.zyk@taobao.com>
Authored: Thu Sep 5 02:01:49 2013 +0800
Committer: Yunkai Zhang <qiushu.zyk@taobao.com>
Committed: Thu Sep 5 02:18:55 2013 +0800

----------------------------------------------------------------------
 CHANGES                | 2 ++
 mgmt/stats/StatType.cc | 7 +++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b71ca552/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 2a8e2b8..10259f3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-2174] traffic_shell/traffic_line miss some stats value
+
   *) [TS-2173] RECD_COUNTER type is missing in setTokenValue().
 
   *) [TS-2165] Introduce cluster-wide logging stats.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b71ca552/mgmt/stats/StatType.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatType.cc b/mgmt/stats/StatType.cc
index 3e13d78..1f92abe 100644
--- a/mgmt/stats/StatType.cc
+++ b/mgmt/stats/StatType.cc
@@ -1123,6 +1123,13 @@ StatObjectList::Eval()
           }
           // scroll old values
           for (StatExprToken * token = object->m_postfix->first(); token; token = object->m_expression->next(token))
{
+
+            // in librecords, not all statistics are register at initialization
+            // must assign proper type if it is undefined.
+            if (!isOperator(token->m_arith_symbol) && token->m_token_type ==
RECD_NULL) {
+              token->assignTokenType();
+            }
+
             if (token->m_token_value_delta) {
               if (!varDataFromName(token->m_token_type, token->m_token_name,
                                    &tempValue)) {


Mime
View raw message