This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
     new 3062bd5  ts_lua: change type in stats struct from 'int' to 'TSMgmtInt' 
to avoid overflow (#8738)
3062bd5 is described below

commit 3062bd5f6c7db7103564608db9657a9833b48621
Author: Brian Olsen <[email protected]>
AuthorDate: Fri Mar 18 06:10:59 2022 -0600

    ts_lua: change type in stats struct from 'int' to 'TSMgmtInt' to avoid 
overflow (#8738)
    
    (cherry picked from commit 739f0fa1cb8bbff85f844339b5e110bee4984893)
---
 plugins/lua/ts_lua.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/lua/ts_lua.c b/plugins/lua/ts_lua.c
index d1634d8..b9e4bd3 100644
--- a/plugins/lua/ts_lua.c
+++ b/plugins/lua/ts_lua.c
@@ -72,8 +72,8 @@ static char const *const ts_lua_g_stat_strs[] = {
 typedef struct {
   ts_lua_main_ctx *main_ctx_array;
 
-  int gc_kb;   // last collected gc in kb
-  int threads; // last collected number active threads
+  TSMgmtInt gc_kb;   // last collected gc in kb
+  TSMgmtInt threads; // last collected number active threads
 
   int stat_inds[TS_LUA_IND_SIZE]; // stats indices
 
@@ -183,8 +183,8 @@ collectStats(ts_lua_plugin_stats *const plugin_stats)
       ts_lua_ctx_stats *const stats = main_ctx->stats;
 
       TSMutexLock(stats->mutexp);
-      gc_kb_total += (TSMgmtInt)stats->gc_kb;
-      threads_total += (TSMgmtInt)stats->threads;
+      gc_kb_total += stats->gc_kb;
+      threads_total += stats->threads;
       TSMutexUnlock(stats->mutexp);
     }
   }

Reply via email to