You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2012/03/13 22:59:38 UTC
git commit: TS-1133 Make the max host-header length configure.ac
configurable
Updated Branches:
refs/heads/master 58fc4c472 -> 3ad18bc24
TS-1133 Make the max host-header length configure.ac configurable
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3ad18bc2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3ad18bc2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3ad18bc2
Branch: refs/heads/master
Commit: 3ad18bc24e4f9c984a08aabc4b891c2131481677
Parents: 58fc4c4
Author: Leif Hedstrom <le...@ogre.com>
Authored: Tue Mar 13 15:59:16 2012 -0600
Committer: Leif Hedstrom <le...@ogre.com>
Committed: Tue Mar 13 15:59:16 2012 -0600
----------------------------------------------------------------------
configure.ac | 10 ++++++++++
lib/ts/ink_config.h.in | 6 ++++--
proxy/http/remap/UrlRewrite.cc | 4 ++--
3 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3ad18bc2/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index c04e3e6..52e072f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -396,6 +396,16 @@ AC_ARG_WITH([max-api-stats],
AC_SUBST(max_api_stats)
#
+# Max host name length that we deal with in URLs.
+#
+AC_ARG_WITH([max-host-name-len],
+ [AS_HELP_STRING([--with-max-host-name-len],[max host name length [default=256]])],
+ [max_host_name_len=$withval],
+ [max_host_name_len=256]
+)
+AC_SUBST(max_host_name_len)
+
+#
# EventProcessor thread configurations
#
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3ad18bc2/lib/ts/ink_config.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index fc26694..6d02b77 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -150,8 +150,10 @@
# define TS_MAX_THREADS_IN_EACH_THREAD_TYPE @max_threads_per_type@
# define TS_MAX_NUMBER_EVENT_THREADS @max_event_threads@
-# define TS_ARG_MAX @arg_max@
-# define TS_ARG_MAX_STR "@arg_max@"
+# define TS_ARG_MAX @arg_max@
+# define TS_ARG_MAX_STR "@arg_max@"
+
+# define TS_MAX_HOST_NAME_LEN @max_host_name_len@
#if TS_HAS_INKAPI
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3ad18bc2/proxy/http/remap/UrlRewrite.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/UrlRewrite.cc b/proxy/http/remap/UrlRewrite.cc
index eda4bfc..e1796ca 100644
--- a/proxy/http/remap/UrlRewrite.cc
+++ b/proxy/http/remap/UrlRewrite.cc
@@ -1781,10 +1781,10 @@ UrlRewrite::_mappingLookup(MappingsStore &mappings, URL *request_url,
int request_port, const char *request_host, int request_host_len,
UrlMappingContainer &mapping_container)
{
- char request_host_lower[256];
+ char request_host_lower[TS_MAX_HOST_NAME_LEN];
if (!request_host || !request_url ||
- (request_host_len < 0) || (request_host_len >= 256)) {
+ (request_host_len < 0) || (request_host_len >= TS_MAX_HOST_NAME_LEN)) {
Debug("url_rewrite", "Invalid arguments!");
return false;
}