You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/09/10 18:45:23 UTC

[3/3] git commit: TS-2174: Assign proper type for uninitialized expression token

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 <qi...@taobao.com>

Conflicts:
	CHANGES


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

Branch: refs/heads/4.0.x
Commit: e41e03e599bda2c5528ef6617de2fec34cb8a848
Parents: 3751008
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Thu Sep 5 02:01:49 2013 +0800
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Sep 10 10:39:00 2013 -0600

----------------------------------------------------------------------
 CHANGES                | 4 +++-
 mgmt/stats/StatType.cc | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e41e03e5/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index bb266c7..cc732de 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.0.2
 
-  *) [TS-2173] RECD_COUNTER type is missing in setTokenValue()
+  *) [TS-2174] traffic_shell/traffic_line miss some stats value
+
+  *) [TS-2173] RECD_COUNTER type is missing in setTokenValue().
 
 
 Changes with Apache Traffic Server 4.0.1

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e41e03e5/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)) {