trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject svn commit: r1167024 - in /trafficserver/traffic/trunk/proxy: MuxVC.cc http/HttpPages.cc http/HttpSM.cc
Date Fri, 09 Sep 2011 07:22:55 GMT
Author: zym
Date: Fri Sep  9 07:22:55 2011
New Revision: 1167024

URL: http://svn.apache.org/viewvc?rev=1167024&view=rev
Log:
TS-813 we should use ats_strdup now

Modified:
    trafficserver/traffic/trunk/proxy/MuxVC.cc
    trafficserver/traffic/trunk/proxy/http/HttpPages.cc
    trafficserver/traffic/trunk/proxy/http/HttpSM.cc

Modified: trafficserver/traffic/trunk/proxy/MuxVC.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/MuxVC.cc?rev=1167024&r1=1167023&r2=1167024&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/MuxVC.cc (original)
+++ trafficserver/traffic/trunk/proxy/MuxVC.cc Fri Sep  9 07:22:55 2011
@@ -2843,8 +2843,7 @@ MuxPagesHandler::handle_callback(int eve
       StatPageData data;
 
       data.data = response;
-      data.type = (char *)ats_malloc(10);
-      snprintf(data.type, 10, "text/html");
+      data.type = ats_strdup("text/html");
       data.length = response_length;
       response = NULL;
 

Modified: trafficserver/traffic/trunk/proxy/http/HttpPages.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpPages.cc?rev=1167024&r1=1167023&r2=1167024&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpPages.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpPages.cc Fri Sep  9 07:22:55 2011
@@ -447,8 +447,7 @@ HttpPagesHandler::handle_callback(int ev
       StatPageData data;
 
       data.data = response;
-      data.type = (char *)ats_malloc(10);
-      snprintf(data.type, 10, "text/html");
+      data.type = ats_strdup("text/html");
       data.length = response_length;
       response = NULL;
 

Modified: trafficserver/traffic/trunk/proxy/http/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpSM.cc?rev=1167024&r1=1167023&r2=1167024&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpSM.cc Fri Sep  9 07:22:55 2011
@@ -2157,10 +2157,8 @@ HttpSM::state_handle_stat_page(int event
       t_state.internal_msg_buffer = spd->data;
       if (spd->type)
         t_state.internal_msg_buffer_type = spd->type;
-      else {
-        t_state.internal_msg_buffer_type = (char *)ats_malloc(10);
-        snprintf(t_state.internal_msg_buffer_type, 10, "text/html");
-      }
+      else
+        t_state.internal_msg_buffer_type = ats_strdup("text/html");
       t_state.internal_msg_buffer_size = spd->length;
       t_state.internal_msg_buffer_fast_allocator_size = -1;
     }



Mime
View raw message