trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geor...@apache.org
Subject svn commit: r912051 - in /incubator/trafficserver/traffic/branches/dev: ./ proxy/InkAPITestTool.cc proxy/Plugin.cc proxy/stats/Stats.h
Date Sat, 20 Feb 2010 00:29:49 GMT
Author: georgep
Date: Sat Feb 20 00:29:49 2010
New Revision: 912051

URL: http://svn.apache.org/viewvc?rev=912051&view=rev
Log:
Merge TS-197, TS-198 from trunk to dev branch.

Modified:
    incubator/trafficserver/traffic/branches/dev/   (props changed)
    incubator/trafficserver/traffic/branches/dev/proxy/InkAPITestTool.cc
    incubator/trafficserver/traffic/branches/dev/proxy/Plugin.cc
    incubator/trafficserver/traffic/branches/dev/proxy/stats/Stats.h

Propchange: incubator/trafficserver/traffic/branches/dev/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Feb 20 00:29:49 2010
@@ -1 +1 @@
-/incubator/trafficserver/traffic/trunk:891822-911700
+/incubator/trafficserver/traffic/trunk:891822-912050

Modified: incubator/trafficserver/traffic/branches/dev/proxy/InkAPITestTool.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/InkAPITestTool.cc?rev=912051&r1=912050&r2=912051&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/InkAPITestTool.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/InkAPITestTool.cc Sat Feb 20 00:29:49
2010
@@ -45,8 +45,8 @@
 #define PROXY_CONFIG_NAME_HTTP_PORT "proxy.config.http.server_port"
 #define PROXY_HTTP_DEFAULT_PORT 8080
 
-#define REQUEST_MAX_SIZE  2047
-#define RESPONSE_MAX_SIZE 2047
+#define REQUEST_MAX_SIZE  4095
+#define RESPONSE_MAX_SIZE 4095
 
 #define HTTP_REQUEST_END "\r\n\r\n"
 
@@ -529,8 +529,12 @@
     int blocklen;
     const char *blockptr = INKIOBufferBlockReadStart(block, txn->resp_reader, &blocklen);
 
-    memcpy((char *) (txn->response + txn->response_len), blockptr, blocklen);
-    txn->response_len += blocklen;
+    if (txn->response_len+blocklen <= RESPONSE_MAX_SIZE) {
+      memcpy((char *) (txn->response + txn->response_len), blockptr, blocklen);
+      txn->response_len += blocklen;
+    } else {
+      INKError("Error: Response length %d > response buffer size %d", txn->response_len+blocklen,
RESPONSE_MAX_SIZE);
+    }
 
     block = INKIOBufferBlockNext(block);
   }
@@ -926,8 +930,12 @@
     int blocklen;
     const char *blockptr = INKIOBufferBlockReadStart(block, txn->req_reader, &blocklen);
 
-    memcpy((char *) (txn->request + txn->request_len), blockptr, blocklen);
-    txn->request_len += blocklen;
+    if (txn->request_len+blocklen <= REQUEST_MAX_SIZE) {
+      memcpy((char *) (txn->request + txn->request_len), blockptr, blocklen);
+      txn->request_len += blocklen;
+    } else {
+      INKError("Error: Request length %d > request buffer size %d", txn->request_len+blocklen,
REQUEST_MAX_SIZE);
+    }
 
     block = INKIOBufferBlockNext(block);
   }

Modified: incubator/trafficserver/traffic/branches/dev/proxy/Plugin.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/Plugin.cc?rev=912051&r1=912050&r2=912051&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/Plugin.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/Plugin.cc Sat Feb 20 00:29:49 2010
@@ -36,7 +36,7 @@
 #include "Plugin.h"
 #include "PluginDB.h"
 #include "ink_snprintf.h"
-
+#include "stats/Stats.h"
 
 // HPUX:
 //   LD_SHAREDCMD=ld -b
@@ -302,6 +302,7 @@
 
   if (INIT_ONCE) {
     api_init();
+    init_inkapi_stat_system();
 
     RecGetRecordString_Xmalloc("proxy.config.plugin.plugin_dir", &plugin_dir);
     RecGetRecordString_Xmalloc("proxy.config.plugin.extensions_dir", &extensions_dir);

Modified: incubator/trafficserver/traffic/branches/dev/proxy/stats/Stats.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/stats/Stats.h?rev=912051&r1=912050&r2=912051&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/stats/Stats.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/stats/Stats.h Sat Feb 20 00:29:49 2010
@@ -224,4 +224,6 @@
   return m_type == RECD_INT ? (float) tmp.rec_int : tmp.rec_float;
 }
 
+void init_inkapi_stat_system();
+
 #endif // STATS_H



Mime
View raw message