Author: igalic
Date: Sun Sep 18 01:51:27 2011
New Revision: 1172168
URL: http://svn.apache.org/viewvc?rev=1172168&view=rev
Log:
TS-953: consolidate string copy/concat for proxy/http/ - comitting test first.
Modified:
trafficserver/traffic/trunk/proxy/http/testheaders.cc
Modified: trafficserver/traffic/trunk/proxy/http/testheaders.cc
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/testheaders.cc?rev=1172168&r1=1172167&r2=1172168&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/testheaders.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/testheaders.cc Sun Sep 18 01:51:27
2011
@@ -22,9 +22,12 @@
*/
#include "ink_unused.h" /* MAGIC_EDITING_TAG */
+#include "ink_string.h"
#include "HttpTransact.h"
#include "HttpTransactHeaders.h"
+#define MAX_FIELD_VALUE_SIZE 512
+
char request1[] =
"GET http://people.netscape.com/jwz/hacks-1.gif HTTP/1.0\r\n"
"If-Modified-Since: Wednesday, 26-Feb-97 06:58:17 GMT; length=842\r\n"
@@ -90,18 +93,17 @@ make_comma_separated_header_field_value(
/* This if is needed to put in the commas correctly */
if (hfv) {
str = hfv->get_raw();
- strcat(full_str, str);
+ ink_strlcat(full_str, str, MAX_FIELD_VALUE_SIZE);
hfv = hfv->next();
}
while (hfv) {
str = hfv->get_raw();
- strcat(full_str, ", ");
- strcat(full_str, str);
+ ink_strlcat(full_str, ", ", MAX_FIELD_VALUE_SIZE);
+ ink_strlcat(full_str, str, MAX_FIELD_VALUE_SIZE);
hfv = hfv->next();
}
}
-#define MAX_FIELD_VALUE_SIZE 512
void
test_headers()
{