You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2022/03/18 12:11:14 UTC

[trafficserver] branch master updated: ts_lua: change type in stats struct from 'int' to 'TSMgmtInt' to avoid overflow (#8738)

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

bnolsen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


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

commit 739f0fa1cb8bbff85f844339b5e110bee4984893
Author: Brian Olsen <br...@comcast.com>
AuthorDate: Fri Mar 18 06:10:59 2022 -0600

    ts_lua: change type in stats struct from 'int' to 'TSMgmtInt' to avoid overflow (#8738)
---
 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 b52355a..ea9f8ae 100644
--- a/plugins/lua/ts_lua.c
+++ b/plugins/lua/ts_lua.c
@@ -73,8 +73,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
 
@@ -184,8 +184,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);
     }
   }