trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r1031368 - /trafficserver/plugins/stats/stats.c
Date Fri, 05 Nov 2010 00:13:07 GMT
Author: jesus
Date: Fri Nov  5 00:13:07 2010
New Revision: 1031368

URL: http://svn.apache.org/viewvc?rev=1031368&view=rev
Log:
increase the buffer size and only output if it fits

Modified:
    trafficserver/plugins/stats/stats.c

Modified: trafficserver/plugins/stats/stats.c
URL: http://svn.apache.org/viewvc/trafficserver/plugins/stats/stats.c?rev=1031368&r1=1031367&r2=1031368&view=diff
==============================================================================
--- trafficserver/plugins/stats/stats.c (original)
+++ trafficserver/plugins/stats/stats.c Fri Nov  5 00:13:07 2010
@@ -156,9 +156,9 @@ stats_process_read(INKCont contp, INKEve
 
 #define APPEND(a) my_state->output_bytes += stats_add_data_to_resp_buffer(a, my_state)
 #define APPEND_STAT(a, fmt, v) do { \
-  char b[128]; \
-  snprintf(b, sizeof(b), "\"%s\": \"" fmt "\",\n", a, v); \
-  APPEND(b); \
+  char b[256]; \
+  if(snprintf(b, sizeof(b), "\"%s\": \"" fmt "\",\n", a, v) < sizeof(b)) \
+    APPEND(b); \
 } while(0)
 
 static void



Mime
View raw message