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 2013/09/10 17:09:27 UTC

[01/48] git commit: Added proper .'s, come on people, proper sentences. ; )

Updated Branches:
  refs/heads/5.0.x 9aad786e8 -> d27749429


Added proper .'s, come on people, proper sentences. ;)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d35e0e94
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d35e0e94
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d35e0e94

Branch: refs/heads/5.0.x
Commit: d35e0e94c6a6614324c25e54df1e1daa692b634a
Parents: b450c84
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Sep 3 20:49:32 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Sep 3 20:49:32 2013 -0600

----------------------------------------------------------------------
 CHANGES | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d35e0e94/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 455bdcf..aee6325 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,16 +1,16 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
-  *) [TS-2173] RECD_COUNTER type is missing in setTokenValue()
+  *) [TS-2173] RECD_COUNTER type is missing in setTokenValue().
 
-  *) [TS-2165] Introduce cluster-wide logging stats
+  *) [TS-2165] Introduce cluster-wide logging stats.
 
   *) [TS-2167] Update apichecker.pl to give suggestions on additional
-   deprecated APIs
+   deprecated APIs.
 
   *) [TS-2163] Remove WDA_BILLING, ACC_ALARMS etc. code and definitions.
 
-  *) [TS-2156] Fix stats trap in different type of threads
+  *) [TS-2156] Fix stats trap in different type of threads.
 
   *) [TS-2160] Remove ats_is_ip_nonroutable and replace it with the less confusing
    ats_is_ip_linklocal and ats_is_ip_private.


[43/48] git commit: TS-2195: reimplement TSHttpTxnCacheLookupSkip in terms of TSHttpTxnConfigIntSet

Posted by zw...@apache.org.
TS-2195: reimplement TSHttpTxnCacheLookupSkip in terms of TSHttpTxnConfigIntSet

Replace the guts of TSHttpTxnCacheLookupSkip with TSHttpTxnConfigIntSet.
This is a compatible change that makes it easy to remove
TSHttpTxnCacheLookupSkip in the 5.x branch.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1fd225ab
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1fd225ab
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1fd225ab

Branch: refs/heads/5.0.x
Commit: 1fd225ab3d164aa63a41925a91ff4e418c194b88
Parents: b61c6df
Author: James Peach <jp...@apache.org>
Authored: Mon Sep 9 16:35:38 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Sep 9 16:35:38 2013 -0700

----------------------------------------------------------------------
 proxy/InkAPI.cc            | 8 ++------
 proxy/http/HttpTransact.cc | 3 ---
 proxy/http/HttpTransact.h  | 2 --
 3 files changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1fd225ab/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 8b51218..1418826 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -5031,15 +5031,11 @@ TSHttpTxnNoActivityTimeoutSet(TSHttpTxn txnp, int timeout)
 }
 
 
+// TS-2196: TSHttpTxnCacheLookupSkip will be removed in the 5.x release.
 TSReturnCode
 TSHttpTxnCacheLookupSkip(TSHttpTxn txnp)
 {
-  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
-
-  HttpTransact::State *s = &(((HttpSM *) txnp)->t_state);
-  s->api_skip_cache_lookup = true;
-
-  return TS_SUCCESS;
+  return TSHttpTxnConfigIntSet(txnp, TS_CONFIG_HTTP_CACHE_HTTP, 0);
 }
 
 TSReturnCode

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1fd225ab/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index a0c9176..01a5f76 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5885,9 +5885,6 @@ HttpTransact::is_request_cache_lookupable(State* s)
     return false;
   }
 
-  if (s->api_skip_cache_lookup) {
-    return false;
-  }
   // Even with "no-cache" directive, we want to do a cache lookup
   // because we need to update our cached copy.
   // Client request "no-cache" directive is handle elsewhere:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1fd225ab/proxy/http/HttpTransact.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 6a66fd1..ad3152b 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -957,7 +957,6 @@ public:
     HdrHeapSDKHandle *cache_resp_hdr_heap_handle;
     bool api_release_server_session;
     bool api_cleanup_cache_read;
-    bool api_skip_cache_lookup;
     bool api_server_response_no_store;
     bool api_server_response_ignore;
     bool api_http_sm_shutdown;
@@ -1068,7 +1067,6 @@ public:
         cache_resp_hdr_heap_handle(NULL),
         api_release_server_session(false),
         api_cleanup_cache_read(false),
-        api_skip_cache_lookup(false),
         api_server_response_no_store(false),
         api_server_response_ignore(false),
         api_http_sm_shutdown(false),


[15/48] git commit: TS-2168: Use #if condition to control reclaimable freelist options

Posted by zw...@apache.org.
TS-2168: Use #if condition to control reclaimable freelist options

1) Define reclaimabe freelist options only when compiles ATS
   with --enable-reclaimabe-freelist,

2) "proxy.config.allocator.enable_reclaim" will be set to 1 by default
   for two reasons:
   a) It should keep consistent with the description in
      records.config.default.in: "Default 1, reclaim enabled",
   b) More important, most users want to get reclaim feature when
      they compiles ATS with --enable-reclaimable-freelist.

3) Make the *NOTE description* in records.config.default.in more notable.

Signed-off-by: Yunkai Zhang <qi...@taobao.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6de8354f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6de8354f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6de8354f

Branch: refs/heads/5.0.x
Commit: 6de8354f20944032fc1ace6559e4bf7bdd1c0186
Parents: 4538389
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Thu Sep 5 15:08:07 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Thu Sep 5 17:26:19 2013 +0800

----------------------------------------------------------------------
 mgmt/RecordsConfig.cc                  |  4 +++-
 proxy/config/records.config.default.in | 12 ++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6de8354f/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 81f0b2d..919675f 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1938,6 +1938,7 @@ RecordElement RecordsConfig[] = {
   {RECT_CONFIG, "proxy.config.stat_api.max_stats_allowed", RECD_INT, "256", RECU_RESTART_TS, RR_NULL, RECC_INT, "[256-1000]", RECA_NULL}
   ,
 
+#if TS_USE_RECLAIMABLE_FREELIST
   //############
   //#
   //# Using for Reclaimable InkFreeList memory pool
@@ -1947,10 +1948,11 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.allocator.max_overage", RECD_INT, "3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "1", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.allocator.reclaim_factor", RECD_FLOAT, "0.3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+#endif /* TS_USE_RECLAIMABLE_FREELIST */
 
   //############
   //#

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6de8354f/proxy/config/records.config.default.in
----------------------------------------------------------------------
diff --git a/proxy/config/records.config.default.in b/proxy/config/records.config.default.in
index 549001a..a5abe55 100644
--- a/proxy/config/records.config.default.in
+++ b/proxy/config/records.config.default.in
@@ -606,7 +606,7 @@ CONFIG proxy.config.diags.show_location INT 0
 #
 # Configuration for Reclaimable InkFreeList memory pool
 #
-# NOTE: The following options are not meaningful unless compiles TrafficServer
+# NOTE: The following options are no meaningful unless compiles TrafficServer
 #	with '--enable-reclaimable-freelist' option. Looks like:
 #	$ ./configure --enable-reclaimable-freelist
 #
@@ -615,17 +615,25 @@ CONFIG proxy.config.diags.show_location INT 0
   # in the mask, then debug information of the corresponding action are dumped:
   #  bit 0: reclaim memory in ink_freelist_new
   #  bit 1: allocate memory from partial-free Chunks(if exist) or OS
+  # NOTE: This option make no sense unless compiles TrafficServer
+  #       with '--enable-reclaimable-freelist' option.
 CONFIG proxy.config.allocator.debug_filter INT 0
   # The value of enable_reclaim should be 0 or 1. Default 1, reclaim enabled.
-CONFIG proxy.config.allocator.enable_reclaim INT @use_reclaimable_freelist@
+  # NOTE: This option make no sense unless compiles TrafficServer
+  #       with '--enable-reclaimable-freelist' option.
+CONFIG proxy.config.allocator.enable_reclaim INT 1
   # The value of reclaim_factor should be in 0.0 ~ 1.0, allocator use it to
   # calculate average value of idle memory in InkFreeList, which will determine
   # when to reclaim memory. The larger the value, the faster the reclaiming.
   # This value is effective only when enable_reclaim is 1.
+  # NOTE: This option make no sense unless compiles TrafficServer
+  #       with '--enable-reclaimable-freelist' option.
 CONFIG proxy.config.allocator.reclaim_factor FLOAT 0.300000
   # Allocator will reclaim memory only when it continuously satisfy the reclaim
   # condition for max_overage times. This value is effective only when
   # enable_reclaim is 1.
+  # NOTE: This option make no sense unless compiles TrafficServer
+  #       with '--enable-reclaimable-freelist' option.
 CONFIG proxy.config.allocator.max_overage INT 3
 
 ##############################################################################


[19/48] git commit: Doc: Fixup config var reference issues.

Posted by zw...@apache.org.
Doc: Fixup config var reference issues.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c6c817d0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c6c817d0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c6c817d0

Branch: refs/heads/5.0.x
Commit: c6c817d01c4bcd0a035b31a4196012d3ac2ebdc9
Parents: d31a4f9
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Thu Sep 5 16:13:15 2013 -0500
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Thu Sep 5 16:13:15 2013 -0500

----------------------------------------------------------------------
 doc/admin/configuring-cache.en.rst              |  26 ++---
 .../configuration/records.config.en.rst         | 114 ++++++++++---------
 doc/sdk/new-protocol-plugins.en.rst             |  63 +++++-----
 3 files changed, 107 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c6c817d0/doc/admin/configuring-cache.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/configuring-cache.en.rst b/doc/admin/configuring-cache.en.rst
index 7051192..3c6d1c4 100644
--- a/doc/admin/configuring-cache.en.rst
+++ b/doc/admin/configuring-cache.en.rst
@@ -5,20 +5,20 @@ Configuring the Cache
 
 .. Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
- 
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+     with the License.  You may obtain a copy of the License at
+
    http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
 
 The Traffic Server cache consists of a high-speed object database called
 the **object store** that indexes objects according to URLs and their

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c6c817d0/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index b661e35..f92ed71 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -210,7 +210,9 @@ Network
 
 Unless explicitly specified in `proxy.config.http.server_ports`_ the server port will be bound to one of these addresses, selected by IP address family. The built in default is any address. This is used if no address for a family is specified. This setting is useful if most or all server ports should be bound to the same address.
 
-.. note:: This is ignored for inbound transparent server ports because they must be able to accept connections on arbitrary IP addresses.
+.. note::
+
+   This is ignored for inbound transparent server ports because they must be able to accept connections on arbitrary IP addresses.
 
 .. topic:: Example
 
@@ -230,7 +232,9 @@ Unless explicitly specified in `proxy.config.http.server_ports`_ the server port
 
    Unless explicitly specified in `proxy.config.http.server_ports`_ one of these addresses, selected by IP address family, will be used as the local address for outbound connections. This setting is useful if most or all of the server ports should use the same outbound IP addresses.
 
-.. note:: This is ignore for outbound transparent ports as the local outbound address will be the same as the client local address.
+.. note::
+
+   This is ignored for outbound transparent ports as the local outbound address will be the same as the client local address.
 
 .. topic:: Example
 
@@ -438,7 +442,9 @@ compress
 Traffic Server allows tunnels only to the specified ports.
 Supports both wildcards ('\*') and ranges ("0-1023").
 
-.. note:: These are the ports on the *origin server*, not Traffic Server :ts:cv:`proxy ports <proxy.config.http.server_ports>`.
+.. note::
+
+   These are the ports on the *origin server*, not Traffic Server :ts:cv:`proxy ports <proxy.config.http.server_ports>`.
 
 .. ts:cv:: CONFIG proxy.config.http.insert_request_via_str INT 1
    :reloadable:
@@ -453,7 +459,9 @@ Value Effect
 2     some extra information is added.
 ===== ============================================
 
-.. note:: the ``Via`` header string interpretation can be `decoded here. </tools/via>`_
+.. note::
+
+   The ``Via`` header string interpretation can be `decoded here. </tools/via>`_
 
 .. ts:cv:: CONFIG proxy.config.http.insert_response_via_str INT 1
    :reloadable:
@@ -773,24 +781,24 @@ Negative Response Caching
 
    .. note::
 
-       ``Cache-Control`` directives from the server forbidding ache are ignored for the following HTTP response codes, regardless
-       of the value specified for the `proxy.config.http.negative_caching_enabled`_ variable. The
-       following negative responses are cached by Traffic Server:::
-
-            204  No Content
-            305  Use Proxy
-            400  Bad Request
-            403  Forbidden
-            404  Not Found
-            405  Method Not Allowed
-            500  Internal Server Error
-            501  Not Implemented
-            502  Bad Gateway
-            503  Service Unavailable
-            504  Gateway Timeout
-
-    The cache lifetime for objects cached from this setting is controlled via
-    ``proxy.config.http.negative_caching_lifetime``.
+      ``Cache-Control`` directives from the server forbidding ache are ignored for the following HTTP response codes, regardless
+      of the value specified for the :ts:cv:`proxy.config.http.negative_caching_enabled` variable. The
+      following negative responses are cached by Traffic Server:::
+
+         204  No Content
+         305  Use Proxy
+         400  Bad Request
+         403  Forbidden
+         404  Not Found
+         405  Method Not Allowed
+         500  Internal Server Error
+         501  Not Implemented
+         502  Bad Gateway
+         503  Service Unavailable
+         504  Gateway Timeout
+
+   The cache lifetime for objects cached from this setting is controlled via
+   :ts:cv:`proxy.config.http.negative_caching_lifetime`.
 
 Proxy User Variables
 ====================
@@ -989,11 +997,11 @@ Cache Control
 
    .. note::
 
-       This option should only be enabled if you're having
-       problems with caching *and* one of the following is true:
+      This option should only be enabled if you're having
+      problems with caching *and* one of the following is true:
 
-       -  Your origin server sets ``Vary: Accept`` when doing content negotiation with ``Accept`` *OR*
-       -  The server does not send a ``406 (Not Acceptable)`` response for types that it cannot serve.
+      -  Your origin server sets ``Vary: Accept`` when doing content negotiation with ``Accept`` *OR*
+      -  The server does not send a ``406 (Not Acceptable)`` response for types that it cannot serve.
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_language_mismatch INT 0
    :reloadable:
@@ -1003,10 +1011,10 @@ Cache Control
 
    .. note::
 
-       This option should only be enabled if you're having
-       problems with caching and your origin server is guaranteed to set
-       ``Vary: Accept-Language`` when doing content negotiation with
-       ``Accept-Language``.
+      This option should only be enabled if you're having
+      problems with caching and your origin server is guaranteed to set
+      ``Vary: Accept-Language`` when doing content negotiation with
+      ``Accept-Language``.
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_charset_mismatch INT 0
    :reloadable:
@@ -1016,10 +1024,8 @@ Cache Control
 
    .. note::
 
-       This option should only be enabled if you're having
-       problems with caching and your origin server is guaranteed to set
-       ``Vary: Accept-Charset`` when doing content negotiation with
-       ``Accept-Charset``.
+      This option should only be enabled if you're having problems with caching and your origin server is
+      guaranteed to set ``Vary: Accept-Charset`` when doing content negotiation with ``Accept-Charset``.
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_client_cc_max_age INT 1
    :reloadable:
@@ -1034,22 +1040,21 @@ Cache Control
 RAM Cache
 =========
 
-
-.. :ts:cv:: CONFIG proxy.config.cache.ram_cache.size INT -1
+.. ts:cv:: CONFIG proxy.config.cache.ram_cache.size INT -1
 
    By default the RAM cache size is automatically determined, based on
    disk cache size; approximately 10 MB of RAM cache per GB of disk cache.
    Alternatively, it can be set to a fixed value such as
    **20GB** (21474836480)
 
-.. :ts:cv:: CONFIG proxy.config.cache.ram_cache.algorithm INT 0
+.. ts:cv:: CONFIG proxy.config.cache.ram_cache.algorithm INT 0
 
    Two distinct RAM caches are supported, the default (0) being the **CLFUS**
    (*Clocked Least Frequently Used by Size*). As an alternative, a simpler
    **LRU** (*Least Recently Used*) cache is also available, by changing this
    configuration to 1.
 
-.. :ts:cv:: CONFIG proxy.config.cache.ram_cache.use_seen_filter INT 0
+.. ts:cv:: CONFIG proxy.config.cache.ram_cache.use_seen_filter INT 0
 
    Enabling this option will filter inserts into the RAM cache to ensure that
    they have been seen at least once.  For the **LRU**, this provides scan
@@ -1057,7 +1062,7 @@ RAM Cache
    before it is inserted, so for **CLFUS**, setting this option means that a
    document must be seen three times before it is added to the RAM cache.
 
-.. :ts:cv:: CONFIG proxy.config.cache.ram_cache.compress INT 0
+.. ts:cv:: CONFIG proxy.config.cache.ram_cache.compress INT 0
 
    The **CLFUS** RAM cache also supports an optional in-memory compression.
    This is not to be confused with ``Content-Encoding: gzip`` compression.
@@ -1071,34 +1076,37 @@ RAM Cache
    - ``2`` = libz (moderate speed, reasonable compression)
    - ``3`` = liblzma (very slow, high compression)
 
-   NOTE: compression runs on task threads.  To use more cores for
-   RAM cache compression, increase :ts:cv:`proxy.config.task_threads`.
+   .. note::
+
+      Compression runs on task threads.  To use more cores for RAM cache compression, increase :ts:cv:`proxy.config.task_threads`.
 
 
 Heuristic Expiration
 ====================
 
-.. :ts:cv:: proxy.config.http.cache.heuristic_min_lifetime INT 3600
+.. ts:cv:: CONFIG proxy.config.http.cache.heuristic_min_lifetime INT 3600
    :reloadable:
 
-   The minimum amount of time an HTTP object without an expiration date can remain fresh in the cache before is considered to be stale.
+   The minimum amount of time an HTTP object without an expiration date can remain fresh in the cache before is
+   considered to be stale.
 
-.. :ts:cv:: proxy.config.http.cache.heuristic_max_lifetime INT 86400
+.. ts:cv:: CONFIG proxy.config.http.cache.heuristic_max_lifetime INT 86400
    :reloadable:
 
-   The maximum amount of time an HTTP object without an expiration date can remain fresh in the cache before is considered to be stale.
+   The maximum amount of time an HTTP object without an expiration date can remain fresh in the cache before is
+   considered to be stale.
 
 .. ts:cv:: CONFIG proxy.config.http.cache.heuristic_lm_factor FLOAT 0.10000
    :reloadable:
 
-   The aging factor for freshness computations. Traffic Server stores an object for this percentage of the time that elapsed since it last
-   changed.
+   The aging factor for freshness computations. Traffic Server stores an object for this percentage of the time that
+   elapsed since it last changed.
 
 .. ts:cv:: CONFIG proxy.config.http.cache.fuzz.time INT 240
    :reloadable:
 
-   How often Traffic Server checks for an early refresh, during the period before the document stale time. The interval specified must
-   be in seconds.
+   How often Traffic Server checks for an early refresh, during the period before the document stale time. The interval
+   specified must be in seconds.
 
 .. ts:cv:: CONFIG proxy.config.http.cache.fuzz.probability FLOAT 0.00500
    :reloadable:
@@ -1975,12 +1983,16 @@ Sockets
 Undocumented
 ============
 
-.. ts:cv:: CONFIG proxy.config.http.cache.heuristic_min_lifetime INT 0
+These are referenced but not documented. Please contribute a definition.
+
+.. ts:cv:: CONFIG proxy.config.http.negative_caching_lifetime INT 0
 
-.. ts:cv:: CONFIG proxy.config.http.cache.heuristic_max_lifetime INT 0
+.. ts:cv:: CONFIG proxy.config.task_threads INT 0
 
 .. ts:cv:: CONFIG proxy.config.cache.limits.http.max_alts INT 5
 
 .. ts:cv:: CONFIG proxy.config.http.enabled INT 1
 
+.. ts:cv:: CONFIG proxy.configl.cache.max_doc_size INT 0
+
    Enable caching HTTP content.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c6c817d0/doc/sdk/new-protocol-plugins.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/new-protocol-plugins.en.rst b/doc/sdk/new-protocol-plugins.en.rst
index 13614a5..4ca91e7 100644
--- a/doc/sdk/new-protocol-plugins.en.rst
+++ b/doc/sdk/new-protocol-plugins.en.rst
@@ -5,20 +5,20 @@ New Protocol Plugins
 
 .. Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
- 
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
    http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
 
 .. toctree::
    :maxdepth: 1
@@ -34,25 +34,23 @@ About the Sample Protocol
 
 The sample protocol enables a client to ask a server for a file. Clients
 send requests to a specific Traffic Server port (specified in
-``plugin.config``); each request has the following structure:
-
-::
+:file:`plugin.config`); each request has the following structure::
 
-    server_name file_name
+   server_name file_name
 
 Using the Protocol plugin, Traffic Server can accept these requests,
 parse them, and act as a proxy cache (i.e., request the file from the
 origin server on the client's behalf and store copies of response
 messages in cache). The Protocol plugin is a state machine that flows
 through the states illustrated in the `Sample Protocol State
-Diagram <#SampleProtocolStDiag>`__. This figure illustrates the steps
+Diagram <#SampleProtocolStDiag>`_. This figure illustrates the steps
 that Traffic Server and the Protocol plugin go through in order to
 support the sample protocol.
 
 In more specific terms, Traffic Server and the Protocol plugin must:
 
 -  Listen for and accept client connections (on the accept port
-   specified in ``plugin.config``)
+   specified in :file:`plugin.config`)
 
 -  Read incoming client requests
 
@@ -62,7 +60,7 @@ In more specific terms, Traffic Server and the Protocol plugin must:
    example does not do freshness checking)
 
 -  Open a connection to the origin server if the request is a cache miss
-   (on the server port specified in ``plugin.config``)
+   (on the server port specified in :file:`plugin.config`)
 
 -  Forward the request to the origin server
 
@@ -76,16 +74,17 @@ In more specific terms, Traffic Server and the Protocol plugin must:
    :alt: Sample Protocol State Diagram
 
    Sample Protocol State Diagram
+
 Protocol Plugin Structure
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 
 To see how the Protocol plugin works, you need to understand some
 broader concepts. This section assumes you're familiar with the concepts
-of **continuation**, Traffic Server's **asynchronous event model**, and
+of :term:`continuation`, Traffic Server's **asynchronous event model**, and
 basic Traffic Server **plugin structure**. If you are not familiar with
 these concepts, then reference `Getting
-Started <../getting-started#GettingStarted>`__ and `How to Create
-Traffic Server Plugins <../how-to-create-trafficserver-plugins>`__
+Started <../getting-started#GettingStarted>`_ and `How to Create
+Traffic Server Plugins <../how-to-create-trafficserver-plugins>`_
 
 Continuations in the Protocol Plugin
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -96,7 +95,7 @@ connections on the appropriate port. When Traffic Server accepts a net
 connection from a client on that port, the accept state machine is
 activated. It then creates a new continuation: a transaction state
 machine. The accept state machine creates one transaction state machine
-for each transaction (where a **transaction** consists of a client
+for each transaction (where a :term:`transaction` consists of a client
 request and Traffic Server's response). Each transaction state machine
 lives until the transaction completes; then it is destroyed. If the
 client's request for content is a cache miss, then a transaction state
@@ -104,15 +103,16 @@ machine might need to open a connection to the origin server. This is
 illustrated in the `Protocol Plugin
 Overview <#ProtocolPluginOverview>`__ diagram below.
 
-**Protocol Plugin Overview** {#ProtocolPluginOverview}
+**Protocol Plugin Overview**
 
 .. figure:: ../static/images/sdk/protocol_sm_big.jpg
    :alt: Protocol Plugin Overview
 
    Protocol Plugin Overview
+
 The first steps for writing the Protocol plugin are now clear: in
 ``TSPluginInit``, you must create a continuation that listens for net
-connections on the client port specified in ``plugin.config`` (this
+connections on the client port specified in :file:`plugin.config` (this
 continuation is the accept state machine).
 
 Below is a summary of the continuations implemented for the Protocol
@@ -156,14 +156,15 @@ connect to the origin server, then the transaction state machine
 initiates a net connection and waits for an event from the Net
 Processor.
 
-**Protocol Plugin Flow of Events** {#ProtocolPluginFlow}
+**Protocol Plugin Flow of Events**
 
 .. figure:: ../static/images/sdk/protocol_evt.jpg
    :alt: Protocol Plugin Flow of Events
 
    Protocol Plugin Flow of Events
+
 The flow of events is illustrated in the `Protocol Plugin Flow of
-Events <#ProtocolPluginFlow>`__ diagram above. The thin straight lines
+Events <#ProtocolPluginFlow>`_ diagram above. The thin straight lines
 show Net Processor event flow, the thin dashed lines represent Host
 Database event flow, and the thick dashed lines show Cache event flow.
 
@@ -244,10 +245,10 @@ Plugin" <#ImplementTransStMachine>`__.
 Plugin** {#ImplementTransStMachine}
 
 .. figure:: /images/sdk/txn_sm.jpg
-   :alt: How Transaction State Machines are Implemented in the Protocol
-   Plugin
+   :alt: How Transaction State Machines are Implemented in the Protocol Plugin
 
    How Transaction State Machines are Implemented in the Protocol Plugin
+
 Processing a Typical Transaction
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -357,5 +358,3 @@ typical transaction.
     **``TS_EVENT_OPEN_READ``** (a cache hit) or
     **``TS_EVENT_OPEN_READ_FAILED``** (a cache miss),
     **``main_handler``** calls **``state_handle_cache_lookup``**.
-
-


[14/48] git commit: TS-214 use port_send to signal async events (Illumos/Solaris)

Posted by zw...@apache.org.
TS-214 use port_send to signal async events (Illumos/Solaris)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/45383890
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/45383890
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/45383890

Branch: refs/heads/5.0.x
Commit: 45383890730f421d3be09364287012c59c5102fd
Parents: 965b7ee
Author: Theo Schlossnagle <je...@omniti.com>
Authored: Thu Sep 5 03:52:37 2013 +0000
Committer: Theo Schlossnagle <je...@omniti.com>
Committed: Thu Sep 5 03:54:45 2013 +0000

----------------------------------------------------------------------
 iocore/eventsystem/UnixEThread.cc | 4 ++++
 iocore/net/UnixNet.cc             | 5 +++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45383890/iocore/eventsystem/UnixEThread.cc
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/UnixEThread.cc b/iocore/eventsystem/UnixEThread.cc
index c379229..c0907eb 100644
--- a/iocore/eventsystem/UnixEThread.cc
+++ b/iocore/eventsystem/UnixEThread.cc
@@ -78,6 +78,10 @@ EThread::EThread(ThreadType att, int anid)
   }
   fcntl(evfd, F_SETFD, FD_CLOEXEC);
   fcntl(evfd, F_SETFL, O_NONBLOCK);
+#elif TS_USE_PORT
+  /* Solaris ports requires no crutches to do cross thread signaling.
+   * We'll just port_send the event straight over the port.
+   */
 #else
   ink_release_assert(pipe(evpipe) >= 0);
   fcntl(evpipe[0], F_SETFD, FD_CLOEXEC);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45383890/iocore/net/UnixNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index b6e956b..5e72b0c 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -167,6 +167,8 @@ net_signal_hook_callback(EThread *thread) {
 #if HAVE_EVENTFD
   uint64_t counter;
   ATS_UNUSED_RETURN(read(thread->evfd, &counter, sizeof(uint64_t)));
+#elif TS_USE_PORT
+  /* Nothing to drain or do */
 #else
   char dummy[1024];
   ATS_UNUSED_RETURN(read(thread->evpipe[0], &dummy[0], 1024));
@@ -178,6 +180,9 @@ net_signal_hook_function(EThread *thread) {
 #if HAVE_EVENTFD
   uint64_t counter = 1;
   ATS_UNUSED_RETURN(write(thread->evfd, &counter, sizeof(uint64_t)));
+#elif TS_USE_PORT
+  PollDescriptor *pd = get_PollDescriptor(thread);
+  ATS_UNUSED_RETURN(port_send(pd->port_fd, 0, thread->ep));
 #else
   char dummy = 1;
   ATS_UNUSED_RETURN(write(thread->evpipe[1], &dummy, 1));


[28/48] git commit: fixed checking for xml parser

Posted by zw...@apache.org.
fixed checking for xml parser


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f7c09fd0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f7c09fd0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f7c09fd0

Branch: refs/heads/5.0.x
Commit: f7c09fd0a74df178d9a7dfb1d564229bbbc8237f
Parents: 9a7e6ca
Author: Bryan Call <bc...@apache.org>
Authored: Fri Sep 6 15:53:12 2013 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Fri Sep 6 15:53:12 2013 -0700

----------------------------------------------------------------------
 build/xml.m4 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f7c09fd0/build/xml.m4
----------------------------------------------------------------------
diff --git a/build/xml.m4 b/build/xml.m4
index fc342a9..d4b4356 100644
--- a/build/xml.m4
+++ b/build/xml.m4
@@ -30,14 +30,15 @@ AC_DEFUN([TS_CHECK_XML], [
       TS_CHECK_XML_EXPAT
     elif test "$withval" = "libxml2" ; then
       TS_CHECK_XML_LIBXML2
-    elif test "x$withval" = "x" ; then
-      TS_CHECK_XML_LIBXML2
-      if test "$enable_xml" = "no"; then
-        TS_CHECK_XML_EXPAT
-      fi
     else
       AC_MSG_ERROR([Unrecognised --with-xml option])
     fi
+  ],
+  [
+    TS_CHECK_XML_LIBXML2
+    if test "$enable_xml" = "no"; then
+      TS_CHECK_XML_EXPAT
+    fi
   ])
   if test "$enable_xml" = "no"; then
     AC_MSG_ERROR([An XML parser (expat or libxml2) is required.])


[18/48] git commit: TS-350 Try to fix the formatting

Posted by zw...@apache.org.
TS-350 Try to fix the formatting


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d31a4f92
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d31a4f92
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d31a4f92

Branch: refs/heads/5.0.x
Commit: d31a4f92e1e865d8aaef3621e7d6993444d5066e
Parents: 6648a78
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Sep 5 13:26:28 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Sep 5 13:26:28 2013 -0600

----------------------------------------------------------------------
 doc/admin/configuring-cache.en.rst                | 6 +++---
 doc/reference/configuration/records.config.en.rst | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d31a4f92/doc/admin/configuring-cache.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/configuring-cache.en.rst b/doc/admin/configuring-cache.en.rst
index 8eed8c7..7051192 100644
--- a/doc/admin/configuring-cache.en.rst
+++ b/doc/admin/configuring-cache.en.rst
@@ -66,8 +66,8 @@ You can configure the RAM cache size to suit your needs, as described in
 :ref:`changing-the-size-of-the-ram-cache` below.
 
 The RAM cache supports two cache eviction algorithms, a regular **LRU**
-(``Least Recently Used``) and the more advanced **CLFUS** (``Clocked Least
-Frequently Used by Size``). The default is to use **CLFUS**, and this is
+(*Least Recently Used*) and the more advanced **CLFUS** (*Clocked Least
+Frequently Used by Size*). The default is to use **CLFUS**, and this is
 controlled via :ts:cv:`proxy.config.cache.ram_cache.algorithm`.
 
 Both the **LRU** and **CLFUS** RAM caches support a configuration to increase
@@ -78,7 +78,7 @@ resistance against this problem.
 
 In addition, **CLFUS** also supports compressing in the RAM cache itself.
 This can be useful for content which is not compressed by itself (e.g.
-images). This should not be confused with ``Content-Encoding: gzip``, this
+images). This should not be confused with *Content-Encoding: gzip*, this
 feature is only thereto save space internally in the RAM cache itself. As
 such, it is completely transparent to the User-Agent. The RAM cache
 compression is enabled with the option

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d31a4f92/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index f546187..b661e35 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -1045,8 +1045,8 @@ RAM Cache
 .. :ts:cv:: CONFIG proxy.config.cache.ram_cache.algorithm INT 0
 
    Two distinct RAM caches are supported, the default (0) being the **CLFUS**
-   (``Clocked Least Frequently Used by Size``). As an alternative, a simpler
-   **LRU** (``Least Recently Used``) cache is also available, by changing this
+   (*Clocked Least Frequently Used by Size*). As an alternative, a simpler
+   **LRU** (*Least Recently Used*) cache is also available, by changing this
    configuration to 1.
 
 .. :ts:cv:: CONFIG proxy.config.cache.ram_cache.use_seen_filter INT 0


[05/48] git commit: TS-2177: Add invoke utility method to APIHooks.

Posted by zw...@apache.org.
TS-2177: Add invoke utility method to APIHooks.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6da47d5c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6da47d5c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6da47d5c

Branch: refs/heads/5.0.x
Commit: 6da47d5c43419d2d54429d9c777f5e40c774c41a
Parents: b71ca55
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Wed Sep 4 13:59:04 2013 -0500
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Wed Sep 4 13:59:33 2013 -0500

----------------------------------------------------------------------
 proxy/InkAPIInternal.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6da47d5c/proxy/InkAPIInternal.h
----------------------------------------------------------------------
diff --git a/proxy/InkAPIInternal.h b/proxy/InkAPIInternal.h
index 971e196..74614df 100644
--- a/proxy/InkAPIInternal.h
+++ b/proxy/InkAPIInternal.h
@@ -143,6 +143,7 @@ public:
   APIHook *get();
   void clear();
   bool is_empty() const;
+  void invoke(int event, void* data);
 
 private:
   Que(APIHook, m_link) m_hooks;
@@ -154,6 +155,12 @@ APIHooks::is_empty() const
   return NULL == m_hooks.head;
 }
 
+inline void
+APIHooks::invoke(int event, void* data) {
+  for ( APIHook* hook = m_hooks.head ; NULL != hook ; hook = hook->next())
+    hook->invoke(event, data);
+}
+
 /** Container for API hooks for a specific feature.
 
     This is an array of hook lists, each identified by a numeric identifier (id). Each array element is a list of all
@@ -184,6 +191,9 @@ public:
   /// @return @c true if @a id is a valid id, @c false otherwise.
   static bool is_valid(ID id);
 
+  /// Invoke the callbacks for the hook @a id.
+  void invoke(ID id, int event, void* data);
+
   /// Fast check for any hooks in this container.
   ///
   /// @return @c true if any list has at least one hook, @c false if
@@ -246,6 +256,13 @@ FeatureAPIHooks<ID,N>::get(ID id)
 }
 
 template < typename ID, ID N >
+void
+FeatureAPIHooks<ID,N>::invoke(ID id, int event, void* data)
+{
+  m_hooks[id].invoke(event, data);
+}
+
+template < typename ID, ID N >
 bool
 FeatureAPIHooks<ID,N>::has_hooks() const
 {


[03/48] git commit: TS-2177: Improve code quality of FeatureAPIHooks.

Posted by zw...@apache.org.
TS-2177: Improve code quality of FeatureAPIHooks.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0ec6fc7e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0ec6fc7e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0ec6fc7e

Branch: refs/heads/5.0.x
Commit: 0ec6fc7e12f79f84fa284015493dfc92f1ca5413
Parents: c05a097
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Wed Sep 4 12:00:47 2013 -0500
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Wed Sep 4 12:00:47 2013 -0500

----------------------------------------------------------------------
 proxy/InkAPIInternal.h | 78 +++++++++++++++++++++++++++++++++------------
 1 file changed, 58 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0ec6fc7e/proxy/InkAPIInternal.h
----------------------------------------------------------------------
diff --git a/proxy/InkAPIInternal.h b/proxy/InkAPIInternal.h
index fe10601..971e196 100644
--- a/proxy/InkAPIInternal.h
+++ b/proxy/InkAPIInternal.h
@@ -124,6 +124,7 @@ struct HttpAltInfo
   float m_qvalue;
 };
 
+/// A single API hook that can be invoked.
 class APIHook
 {
 public:
@@ -133,6 +134,7 @@ public:
   LINK(APIHook, m_link);
 };
 
+/// A collection of API hooks.
 class APIHooks
 {
 public:
@@ -140,87 +142,123 @@ public:
   void append(INKContInternal * cont);
   APIHook *get();
   void clear();
+  bool is_empty() const;
 
 private:
   Que(APIHook, m_link) m_hooks;
 };
 
+inline bool
+APIHooks::is_empty() const
+{
+  return NULL == m_hooks.head;
+}
+
 /** Container for API hooks for a specific feature.
+
+    This is an array of hook lists, each identified by a numeric identifier (id). Each array element is a list of all
+    hooks for that ID. Adding a hook means adding to the list in the corresponding array element. There is no provision
+    for removing a hook.
+
+    @note The minimum value for a hook ID is zero. Therefore the template parameter @a N_ID should be one more than the
+    maximum hook ID so the valid ids are 0..(N-1) in the standard C array style.
  */
 template <
   typename ID, ///< Type of hook ID
-  ID MAX_ID ///< Maximum value for ID
+  ID N ///< Number of hooks
 >
 class FeatureAPIHooks
 {
 public:
-  FeatureAPIHooks();
-  ~FeatureAPIHooks();
+  FeatureAPIHooks(); ///< Constructor (empty container).
+  ~FeatureAPIHooks(); ///< Destructor.
 
+  /// Remove all hooks.
   void clear();
+  /// Add the hook @a cont to the front of the hooks for @a id.
   void prepend(ID id, INKContInternal * cont);
+  /// Add the hook @a cont to the end of the hooks for @a id.
   void append(ID id, INKContInternal * cont);
+  /// Get the list of hooks for @a id.
   APIHook *get(ID id);
+  /// @return @c true if @a id is a valid id, @c false otherwise.
+  static bool is_valid(ID id);
 
+  /// Fast check for any hooks in this container.
+  ///
+  /// @return @c true if any list has at least one hook, @c false if
+  /// all lists have no hooks.
   bool has_hooks() const;
 
+  /// Check for existence of hooks of a specific @a id.
+  /// @return @c true if any hooks of type @a id are present.
+  bool has_hooks_for(ID id) const;
+
 private:
-  bool hooks_p; ///< Enable fast check for any hooks.
-  APIHooks m_hooks[MAX_ID];
+  bool hooks_p; ///< Flag for (not) empty container.
+  /// The array of hooks lists.
+  APIHooks m_hooks[N];
 };
 
-template < typename ID, ID MAX_ID >
-FeatureAPIHooks<ID,MAX_ID>::FeatureAPIHooks():
+template < typename ID, ID N >
+FeatureAPIHooks<ID,N>::FeatureAPIHooks():
 hooks_p(false)
 {
 }
 
-template < typename ID, ID MAX_ID >
-FeatureAPIHooks<ID,MAX_ID>::~FeatureAPIHooks()
+template < typename ID, ID N >
+FeatureAPIHooks<ID,N>::~FeatureAPIHooks()
 {
   this->clear();
 }
 
-template < typename ID, ID MAX_ID >
+template < typename ID, ID N >
 void
-FeatureAPIHooks<ID,MAX_ID>::clear()
+FeatureAPIHooks<ID,N>::clear()
 {
-  for (int i = 0; i < MAX_ID; ++i) {
+  for (int i = 0; i < N; ++i) {
     m_hooks[i].clear();
   }
   hooks_p = false;
 }
 
-template < typename ID, ID MAX_ID >
+template < typename ID, ID N >
 void
-FeatureAPIHooks<ID,MAX_ID>::prepend(ID id, INKContInternal *cont)
+FeatureAPIHooks<ID,N>::prepend(ID id, INKContInternal *cont)
 {
   hooks_p = true;
   m_hooks[id].prepend(cont);
 }
 
-template < typename ID, ID MAX_ID >
+template < typename ID, ID N >
 void
-FeatureAPIHooks<ID,MAX_ID>::append(ID id, INKContInternal *cont)
+FeatureAPIHooks<ID,N>::append(ID id, INKContInternal *cont)
 {
   hooks_p = true;
   m_hooks[id].append(cont);
 }
 
-template < typename ID, ID MAX_ID >
+template < typename ID, ID N >
 APIHook *
-FeatureAPIHooks<ID,MAX_ID>::get(ID id)
+FeatureAPIHooks<ID,N>::get(ID id)
 {
   return m_hooks[id].get();
 }
 
-template < typename ID, ID MAX_ID >
+template < typename ID, ID N >
 bool
-FeatureAPIHooks<ID,MAX_ID>::has_hooks() const
+FeatureAPIHooks<ID,N>::has_hooks() const
 {
   return hooks_p;
 }
 
+template < typename ID, ID N >
+bool
+FeatureAPIHooks<ID,N>::is_valid(ID id)
+{
+  return 0 <= id && id < N;
+}
+
 class HttpAPIHooks : public FeatureAPIHooks<TSHttpHookID, TS_HTTP_LAST_HOOK>
 {
 };


[41/48] git commit: TS-2195: Deprecate experimental TSHttpTxnCacheLookupSkip API

Posted by zw...@apache.org.
TS-2195: Deprecate experimental TSHttpTxnCacheLookupSkip API

TSHttpTxnCacheLookupSkip() is in experimental, but can be implemented
by stable API; TSHttpTxnConfigIntSet(txn, TS_CONFIG_HTTP_CACHE_HTTP, 0).


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a061d7ca
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a061d7ca
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a061d7ca

Branch: refs/heads/5.0.x
Commit: a061d7ca88eb090e3dffe874167c02e4c001301e
Parents: ddf36d2
Author: James Peach <jp...@apache.org>
Authored: Mon Sep 9 15:49:36 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Sep 9 15:52:32 2013 -0700

----------------------------------------------------------------------
 CHANGES                     | 2 ++
 proxy/api/ts/experimental.h | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a061d7ca/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index fd4076f..faa6402 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 4.1.0
 
 
+  *) [TS-2195] Deprecate experimental TSHttpTxnCacheLookupSkip API.
+
   *) [TS-2176] Do not reset value of api_skip_cache_lookup when reading it.
     Author: Corey Cossentino <co...@omniti.com>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a061d7ca/proxy/api/ts/experimental.h
----------------------------------------------------------------------
diff --git a/proxy/api/ts/experimental.h b/proxy/api/ts/experimental.h
index 9a92507..f13edab 100644
--- a/proxy/api/ts/experimental.h
+++ b/proxy/api/ts/experimental.h
@@ -183,11 +183,14 @@ extern "C"
    ****************************************************************************/
   tsapi TSReturnCode TSHttpTxnCacheLookupCountGet(TSHttpTxn txnp, int *lookup_count);
   tsapi TSReturnCode TSHttpTxnRedirectRequest(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc url_loc);
-  tsapi TSReturnCode TSHttpTxnCacheLookupSkip(TSHttpTxn txnp);
   tsapi TSReturnCode TSHttpTxnServerRespIgnore(TSHttpTxn txnp);
   tsapi TSReturnCode TSHttpTxnShutDown(TSHttpTxn txnp, TSEvent event);
   tsapi TSReturnCode TSHttpTxnCloseAfterResponse(TSHttpTxn txnp, int should_close);
 
+  // TS-2195: TSHttpTxnCacheLookupSkip() is deprecated, because TSHttpTxnConfigIntSet(txn, TS_CONFIG_HTTP_CACHE_HTTP, 0)
+  // does the same thing, but better. TSHttpTxnCacheLookupSkip will be removed in TrafficServer 5.0.
+  tsapi TS_DEPRECATED TSReturnCode TSHttpTxnCacheLookupSkip(TSHttpTxn txnp);
+
   // TS-1996: These API swill be removed after v3.4.0 is cut. Do not use them!
   tsapi TSReturnCode TSHttpTxnNewCacheLookupDo(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc url_loc);
   tsapi TSReturnCode TSHttpTxnSecondUrlTryLock(TSHttpTxn txnp);


[42/48] git commit: remove Makefile-pl on make distclean

Posted by zw...@apache.org.
remove Makefile-pl on make distclean


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b61c6dfc
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b61c6dfc
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b61c6dfc

Branch: refs/heads/5.0.x
Commit: b61c6dfc52f1cd52c575f65709a1fdc9616812ed
Parents: a061d7c
Author: James Peach <jp...@apache.org>
Authored: Mon Sep 9 16:30:12 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Sep 9 16:30:12 2013 -0700

----------------------------------------------------------------------
 lib/perl/Makefile.am | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b61c6dfc/lib/perl/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/perl/Makefile.am b/lib/perl/Makefile.am
index be6ea76..0622e51 100644
--- a/lib/perl/Makefile.am
+++ b/lib/perl/Makefile.am
@@ -26,6 +26,9 @@ Makefile-pl: Makefile.PL
 	-[ $(srcdir) != $(builddir) ] && cp -rf $(abs_srcdir)/. $(builddir)/.
 	$(PERL) Makefile.PL INSTALLDIRS=$(INSTALLDIRS) PREFIX=$(prefix)
 
+distclean-local:
+	-rm -f Makefile-pl
+
 #test: check
 
 #check-local: Makefile-pl


[39/48] git commit: TS-2176: do not reset value of api_skip_cache_lookup when reading it

Posted by zw...@apache.org.
TS-2176: do not reset value of api_skip_cache_lookup when reading it

When is_request_cache_lookupable reads the value of api_skip_cache_lookup
it also resets the value to false.  Since the function is called
from HandleRequest, the flag set by the API call will be ignored
by DecideCacheLookup.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b1845c4b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b1845c4b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b1845c4b

Branch: refs/heads/5.0.x
Commit: b1845c4be987a2d0ba331b46839c01e0f17d7666
Parents: f1bffdf
Author: Corey Cossentino <co...@omniti.com>
Authored: Wed Sep 4 13:04:05 2013 -0400
Committer: James Peach <jp...@apache.org>
Committed: Mon Sep 9 15:28:57 2013 -0700

----------------------------------------------------------------------
 CHANGES                    | 6 +++++-
 proxy/http/HttpTransact.cc | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b1845c4b/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f63e647..9027adb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
-  
+
+
+  *) [TS-2176] do not reset value of api_skip_cache_lookup when reading it
+    Author: Corey Cossentino <co...@omniti.com>
+
   *) [TS-2191] Do not reschedule http_sm when the sm_list`s lock is not
    acquired. This can lose items for the WebUI, which will be fixed in a
    separate bug.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b1845c4b/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 512a1cc..a0c9176 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5886,7 +5886,6 @@ HttpTransact::is_request_cache_lookupable(State* s)
   }
 
   if (s->api_skip_cache_lookup) {
-    s->api_skip_cache_lookup = false;
     return false;
   }
   // Even with "no-cache" directive, we want to do a cache lookup


[25/48] git commit: Docs: Fix formatting for KMGT-bytes

Posted by zw...@apache.org.
Docs: Fix formatting for KMGT-bytes


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9cc51385
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9cc51385
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9cc51385

Branch: refs/heads/5.0.x
Commit: 9cc51385e2e6d8899da003792106f415fb723836
Parents: 57fcef1
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Sep 6 08:35:00 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Sep 6 08:35:04 2013 -0600

----------------------------------------------------------------------
 doc/reference/configuration/records.config.en.rst | 10 +++++-----
 doc/reference/configuration/storage.config.en.rst | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9cc51385/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index ae0c2d2..e3ecfae 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -55,12 +55,12 @@ A variable marked as ``Reloadable`` can be updated via the command::
 ``INT`` type configurations are expressed as any normal integer,
 e.g. *32768*. They can also be expressed using more human readable values
 using standard prefixes, e.g. *32K*. The following prefixes are supported
-for all ``INT` type configurations ::
+for all ``INT` type configurations
 
-   -  ``K`` Kilobytes (1024 bytes)
-   -  ``M`` Megabytes (1,048,576 bytes)
-   -  ``G`` Gigabytes (1,073,741,824 bytes
-   -  ``T`` Terabytes (1,099,511,627,776 bytes)
+   - ``K`` Kilobytes (1024 bytes)
+   - ``M`` Megabytes (1024^2 or 1,048,576 bytes)
+   - ``G`` Gigabytes (1024^3 or 1,073,741,824 bytes
+   - ``T`` Terabytes (1024^4 or 1,099,511,627,776 bytes)
 
 .. note::
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9cc51385/doc/reference/configuration/storage.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/storage.config.en.rst b/doc/reference/configuration/storage.config.en.rst
index 14d811e..3aa2fb3 100644
--- a/doc/reference/configuration/storage.config.en.rst
+++ b/doc/reference/configuration/storage.config.en.rst
@@ -59,12 +59,12 @@ operating systems have stronger requirements - see the following examples for
 more information.
 
 As with standard ``records.config`` integers, human readable prefixes are also
-supported. They include::
+supported. They include
 
-   -  ``K`` Kilobytes (1024 bytes)
-   -  ``M`` Megabytes (1,048,576 bytes)
-   -  ``G`` Gigabytes (1,073,741,824 bytes
-   -  ``T`` Terabytes (1,099,511,627,776 bytes)
+   - ``K`` Kilobytes (1024 bytes)
+   - ``M`` Megabytes (1024^2 or 1,048,576 bytes)
+   - ``G`` Gigabytes (1024^3 or 1,073,741,824 bytes
+   - ``T`` Terabytes (1024^4 or 1,099,511,627,776 bytes)
 
 
 Examples


[35/48] git commit: TS-2191 we should not simply reschdule the http_sm if the sm_list`s mutex is not acquired, because the client_vc`s timeout events maybe triggered. The race may lead http_sm received a event after it is deleted. Sub task (TS-2192)

Posted by zw...@apache.org.
TS-2191 we should not simply reschdule the http_sm if the sm_list`s mutex
is not acquired, because the client_vc`s timeout events maybe triggered.
The race may lead http_sm received a event after it is deleted.
Sub task (TS-2192)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a27b9e73
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a27b9e73
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a27b9e73

Branch: refs/heads/5.0.x
Commit: a27b9e73a5e113a0231d56817e86fbad27583180
Parents: e8672a8
Author: weijin <ta...@taobao.com>
Authored: Mon Sep 9 23:36:34 2013 +0800
Committer: weijin <ta...@taobao.com>
Committed: Mon Sep 9 23:51:29 2013 +0800

----------------------------------------------------------------------
 CHANGES              |  2 ++
 proxy/http/HttpSM.cc | 12 +++++-------
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a27b9e73/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 1c7d948..878b55b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
+  
+  *) [TS-2191] not reschedule http_sm when the sm_list`s lock is not acquired.
 
   *) [TS-1086] Avoid edge case returning 304 to an unconditional request.
      Diagnosis and patch by Mohamad Khateeb.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a27b9e73/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 3804c50..113a89b 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -520,13 +520,11 @@ HttpSM::state_add_to_list(int event, void * /* data ATS_UNUSED */)
     int bucket = ((unsigned int) sm_id % HTTP_LIST_BUCKETS);
 
     MUTEX_TRY_LOCK(lock, HttpSMList[bucket].mutex, mutex->thread_holding);
-    if (!lock) {
-      HTTP_SM_SET_DEFAULT_HANDLER(&HttpSM::state_add_to_list);
-      mutex->thread_holding->schedule_in(this, HTTP_LIST_RETRY);
-      return EVENT_DONE;
-    }
-
-    HttpSMList[bucket].sm_list.push(this);
+    // the client_vc`s timeout events can be triggered, so we should not
+    // reschedule the http_sm when the lock is not acquired.
+    // FIXME: the sm_list may miss some http_sms when the lock contention
+    if (lock)
+      HttpSMList[bucket].sm_list.push(this);
   }
 
   t_state.api_next_action = HttpTransact::HTTP_API_SM_START;


[16/48] git commit: TS-2168 Clean up the verbose comments

Posted by zw...@apache.org.
TS-2168 Clean up the verbose comments

There's not much purpose to repeat the same thing 4 times :). This
also fixes a potential problem with debug_filter, since it currently
has two bit fields in use, we should allow for values 0-3, right?

There's still a huge problem with this code as it is now, because
it would make it impossible to implement features that does
consistency checks on records.config (see TS-1882).


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/03b88fca
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/03b88fca
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/03b88fca

Branch: refs/heads/5.0.x
Commit: 03b88fca6fa6e2d5561a78ed055ed247d8001799
Parents: 6de8354
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Sep 5 09:04:40 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Sep 5 09:04:40 2013 -0600

----------------------------------------------------------------------
 mgmt/RecordsConfig.cc                  |  6 ++---
 proxy/config/records.config.default.in | 37 ++++++++++-------------------
 2 files changed, 16 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/03b88fca/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 919675f..c1fec36 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1944,14 +1944,14 @@ RecordElement RecordsConfig[] = {
   //# Using for Reclaimable InkFreeList memory pool
   //#
   //############
-  {RECT_CONFIG, "proxy.config.allocator.debug_filter", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "1", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.allocator.max_overage", RECD_INT, "3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "1", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
-  ,
   {RECT_CONFIG, "proxy.config.allocator.reclaim_factor", RECD_FLOAT, "0.3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.allocator.debug_filter", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, "[0-3]", RECA_NULL}
+  ,
 #endif /* TS_USE_RECLAIMABLE_FREELIST */
 
   //############

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/03b88fca/proxy/config/records.config.default.in
----------------------------------------------------------------------
diff --git a/proxy/config/records.config.default.in b/proxy/config/records.config.default.in
index a5abe55..900d571 100644
--- a/proxy/config/records.config.default.in
+++ b/proxy/config/records.config.default.in
@@ -606,35 +606,24 @@ CONFIG proxy.config.diags.show_location INT 0
 #
 # Configuration for Reclaimable InkFreeList memory pool
 #
-# NOTE: The following options are no meaningful unless compiles TrafficServer
-#	with '--enable-reclaimable-freelist' option. Looks like:
-#	$ ./configure --enable-reclaimable-freelist
+# NOTE: The following options are meaningfull only when Traffic Server is
+#       compiled with the following option to configure:
+#
+#	    --enable-reclaimable-freelist
 #
 ##############################################################################
-  # Dump debug information according bit mask of debug_filter, if a bit is set
-  # in the mask, then debug information of the corresponding action are dumped:
-  #  bit 0: reclaim memory in ink_freelist_new
-  #  bit 1: allocate memory from partial-free Chunks(if exist) or OS
-  # NOTE: This option make no sense unless compiles TrafficServer
-  #       with '--enable-reclaimable-freelist' option.
-CONFIG proxy.config.allocator.debug_filter INT 0
-  # The value of enable_reclaim should be 0 or 1. Default 1, reclaim enabled.
-  # NOTE: This option make no sense unless compiles TrafficServer
-  #       with '--enable-reclaimable-freelist' option.
-CONFIG proxy.config.allocator.enable_reclaim INT 1
-  # The value of reclaim_factor should be in 0.0 ~ 1.0, allocator use it to
-  # calculate average value of idle memory in InkFreeList, which will determine
-  # when to reclaim memory. The larger the value, the faster the reclaiming.
-  # This value is effective only when enable_reclaim is 1.
-  # NOTE: This option make no sense unless compiles TrafficServer
-  #       with '--enable-reclaimable-freelist' option.
+CONFIG proxy.config.allocator.enable_reclaim INT 0
+  # The value of reclaim_factor should be in the 0.0 to 1.0 range. Allocators
+  # use it to calculate size of unused memory, which is used to determine when
+  # to reclaim memory. The larger the value, the more aggressive reclaims.
 CONFIG proxy.config.allocator.reclaim_factor FLOAT 0.300000
   # Allocator will reclaim memory only when it continuously satisfy the reclaim
-  # condition for max_overage times. This value is effective only when
-  # enable_reclaim is 1.
-  # NOTE: This option make no sense unless compiles TrafficServer
-  #       with '--enable-reclaimable-freelist' option.
+  # condition for max_overage continuous checks.
 CONFIG proxy.config.allocator.max_overage INT 3
+  #  For debugging, enable debug_filter, which is a bit-map with these fields:
+  #     bit 0: reclaim memory in ink_freelist_new
+  #     bit 1: allocate memory from partial-free Chunks(if exist) or OS
+CONFIG proxy.config.allocator.debug_filter INT 0
 
 ##############################################################################
 #


[38/48] git commit: Updated text / format.

Posted by zw...@apache.org.
Updated text / format.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f1bffdf2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f1bffdf2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f1bffdf2

Branch: refs/heads/5.0.x
Commit: f1bffdf25d30c6c4d96c6ebc49c7e059f77e9ed1
Parents: 9e82415
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Sep 9 13:39:50 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Sep 9 13:39:50 2013 -0600

----------------------------------------------------------------------
 CHANGES | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f1bffdf2/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 6734ed8..f63e647 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,10 +1,12 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
   
-  *) [TS-2191] not reschedule http_sm when the sm_list`s lock is not acquired.
+  *) [TS-2191] Do not reschedule http_sm when the sm_list`s lock is not
+   acquired. This can lose items for the WebUI, which will be fixed in a
+   separate bug.
 
-  *) [TS-2188] Fixes to make healthcheck plugin not segfault, and parse
-   the log files properly. Author: Scott Harris <sc...@harrisnet.id.au>.
+  *) [TS-2188] Fixes to make healthcheck plugin not segfault, and parse the
+   log files properly. Author: Scott Harris <sc...@harrisnet.id.au>.
 
   *) [TS-1086] Avoid edge case returning 304 to an unconditional request.
      Diagnosis and patch by Mohamad Khateeb.


[33/48] git commit: Remove undefined INK_LOCKFILE_INCLUDE_REDUCED

Posted by zw...@apache.org.
Remove undefined INK_LOCKFILE_INCLUDE_REDUCED


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8489d51a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8489d51a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8489d51a

Branch: refs/heads/5.0.x
Commit: 8489d51a26e618e169aea62da029b57d80e05937
Parents: f2882b8
Author: James Peach <jp...@apache.org>
Authored: Sat Sep 7 21:42:13 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Sep 7 21:42:13 2013 -0700

----------------------------------------------------------------------
 lib/ts/ink_lockfile.h | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8489d51a/lib/ts/ink_lockfile.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_lockfile.h b/lib/ts/ink_lockfile.h
index 1448af7..93fea02 100644
--- a/lib/ts/ink_lockfile.h
+++ b/lib/ts/ink_lockfile.h
@@ -24,17 +24,13 @@
 #ifndef __INK_LOCKFILE_H__
 #define __INK_LOCKFILE_H__
 
-#ifndef INK_LOCKFILE_INCLUDE_REDUCED
 #include "ink_resource.h"
-#endif
 #include "ink_defs.h"
 #include "ink_string.h"
 
-#ifndef INK_LOCKFILE_INCLUDE_REDUCED
 #define COP_LOCK       "cop.lock"
 #define MANAGER_LOCK   "manager.lock"
 #define SERVER_LOCK    "server.lock"
-#endif
 
 class Lockfile
 {


[02/48] git commit: TS-2107 Revert this change, please review for correctness

Posted by zw...@apache.org.
TS-2107 Revert this change, please review for correctness


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c05a0979
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c05a0979
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c05a0979

Branch: refs/heads/5.0.x
Commit: c05a09799488bd91a9d6186535bf2f2796c5877d
Parents: d35e0e9
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Sep 4 07:36:40 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed Sep 4 07:36:40 2013 -0600

----------------------------------------------------------------------
 CHANGES                                |  4 ----
 mgmt/RecordsConfig.cc                  |  4 +---
 mgmt/cli/ConfigCmd.cc                  |  9 ++++-----
 mgmt/cli/ConfigCmd.h                   |  3 +--
 mgmt/cli/ShowCmd.cc                    |  9 +++------
 mgmt/cli/cli_detailed_command_list.txt |  6 ++----
 proxy/http/HttpConfig.cc               |  8 ++------
 proxy/http/HttpConfig.h                |  9 ++-------
 proxy/http/HttpSM.cc                   | 27 ++-------------------------
 9 files changed, 17 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index aee6325..2a8e2b8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -29,10 +29,6 @@ Changes with Apache Traffic Server 4.1.0
   *) [TS-2147] Set server_share_sessions to 1 for 'internal' transactions in
    rfc5861 plugin.
 
-  *) [TS-2107] split proxy.config.http.transaction_active_timeout_in to
-     proxy.config.http.transaction_header_timeout_in and
-     proxy.config.http.transaction_request_timeout_in. 
-
   *) [TS-2114] buffer_upload plugin defines true and false
     Author: Kit Chan <ch...@gmail.com>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index da8e36e..3f7661d 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -508,9 +508,7 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.http.transaction_no_activity_timeout_out", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.http.transaction_header_active_timeout_in", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.http.transaction_request_active_timeout_in", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.http.transaction_active_timeout_in", RECD_INT, "900", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.http.transaction_active_timeout_out", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
   ,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/mgmt/cli/ConfigCmd.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/ConfigCmd.cc b/mgmt/cli/ConfigCmd.cc
index ae7a5c5..a40da20 100644
--- a/mgmt/cli/ConfigCmd.cc
+++ b/mgmt/cli/ConfigCmd.cc
@@ -978,11 +978,8 @@ Cmd_ConfigHttp(ClientData clientData, Tcl_Interp * interp, int argc, const char
     case CMD_CONFIG_HTTP_INACTIVE_TIMEOUT_OUT:
       return (Cli_RecordInt_Action(action, "proxy.config.http.transaction_no_activity_timeout_out", argtable->arg_int));
 
-    case CMD_CONFIG_HTTP_HEADER_ACTIVE_TIMEOUT_IN:
-      return (Cli_RecordInt_Action(action, "proxy.config.http.transaction_header_active_timeout_in", argtable->arg_int));
-
-    case CMD_CONFIG_HTTP_REQUEST_ACTIVE_TIMEOUT_IN:
-      return (Cli_RecordInt_Action(action, "proxy.config.http.transaction_request_active_timeout_in", argtable->arg_int));
+    case CMD_CONFIG_HTTP_ACTIVE_TIMEOUT_IN:
+      return (Cli_RecordInt_Action(action, "proxy.config.http.transaction_active_timeout_in", argtable->arg_int));
 
     case CMD_CONFIG_HTTP_ACTIVE_TIMEOUT_OUT:
       return (Cli_RecordInt_Action(action, "proxy.config.http.transaction_active_timeout_out", argtable->arg_int));
@@ -1042,6 +1039,8 @@ CmdArgs_ConfigHttp()
   createArgument("inactive-timeout-out", 1, CLI_ARGV_OPTION_INT_VALUE,
                  (char *) NULL, CMD_CONFIG_HTTP_INACTIVE_TIMEOUT_OUT, "Inactive timeout outbound <seconds>",
                  (char *) NULL);
+  createArgument("active-timeout-in", 1, CLI_ARGV_OPTION_INT_VALUE,
+                 (char *) NULL, CMD_CONFIG_HTTP_ACTIVE_TIMEOUT_IN, "Active timeout inbound <seconds>", (char *) NULL);
   createArgument("active-timeout-out", 1, CLI_ARGV_OPTION_INT_VALUE,
                  (char *) NULL, CMD_CONFIG_HTTP_ACTIVE_TIMEOUT_OUT, "Active timeout outbound <seconds>", (char *) NULL);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/mgmt/cli/ConfigCmd.h
----------------------------------------------------------------------
diff --git a/mgmt/cli/ConfigCmd.h b/mgmt/cli/ConfigCmd.h
index 05473c4..42ed681 100644
--- a/mgmt/cli/ConfigCmd.h
+++ b/mgmt/cli/ConfigCmd.h
@@ -113,8 +113,7 @@ typedef enum
   CMD_CONFIG_HTTP_KEEP_ALIVE_TIMEOUT_OUT,
   CMD_CONFIG_HTTP_INACTIVE_TIMEOUT_IN,
   CMD_CONFIG_HTTP_INACTIVE_TIMEOUT_OUT,
-  CMD_CONFIG_HTTP_HEADER_ACTIVE_TIMEOUT_IN,
-  CMD_CONFIG_HTTP_REQUEST_ACTIVE_TIMEOUT_IN,
+  CMD_CONFIG_HTTP_ACTIVE_TIMEOUT_IN,
   CMD_CONFIG_HTTP_ACTIVE_TIMEOUT_OUT,
   CMD_CONFIG_HTTP_REMOVE_FROM,
   CMD_CONFIG_HTTP_REMOVE_REFERER,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/mgmt/cli/ShowCmd.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/ShowCmd.cc b/mgmt/cli/ShowCmd.cc
index 138e8cb..ed71560 100644
--- a/mgmt/cli/ShowCmd.cc
+++ b/mgmt/cli/ShowCmd.cc
@@ -1155,8 +1155,7 @@ ShowHttp()
   TSInt keepalive_timeout_out = -1;
   TSInt inactivity_timeout_in = -1;
   TSInt inactivity_timeout_out = -1;
-  TSInt header_activity_timeout_in = -1;
-  TSInt request_activity_timeout_in = -1;
+  TSInt activity_timeout_in = -1;
   TSInt activity_timeout_out = -1;
   TSInt max_alts = -1;
   TSInt remove_from = -1;
@@ -1177,8 +1176,7 @@ ShowHttp()
   Cli_RecordGetInt("proxy.config.http.keep_alive_no_activity_timeout_out", &keepalive_timeout_out);
   Cli_RecordGetInt("proxy.config.http.transaction_no_activity_timeout_in", &inactivity_timeout_in);
   Cli_RecordGetInt("proxy.config.http.transaction_no_activity_timeout_out", &inactivity_timeout_out);
-  Cli_RecordGetInt("proxy.config.http.transaction_header_active_timeout_in", &header_activity_timeout_in);
-  Cli_RecordGetInt("proxy.config.http.transaction_request_active_timeout_in", &request_activity_timeout_in);
+  Cli_RecordGetInt("proxy.config.http.transaction_active_timeout_in", &activity_timeout_in);
   Cli_RecordGetInt("proxy.config.http.transaction_active_timeout_out", &activity_timeout_out);
   Cli_RecordGetInt("proxy.config.cache.limits.http.max_alts", &max_alts);
   Cli_RecordGetInt("proxy.config.http.anonymize_remove_from", &remove_from);
@@ -1201,8 +1199,7 @@ ShowHttp()
   Cli_Printf("Keep-Alive Timeout Outbound --- %d s\n", keepalive_timeout_out);
   Cli_Printf("Inactivity Timeout Inbound ---- %d s\n", inactivity_timeout_in);
   Cli_Printf("Inactivity Timeout Outbound --- %d s\n", inactivity_timeout_out);
-  Cli_Printf("Header Activity Timeout Inbound ------ %d s\n", header_activity_timeout_in);
-  Cli_Printf("Request Activity Timeout Inbound ------ %d s\n", request_activity_timeout_in);
+  Cli_Printf("Activity Timeout Inbound ------ %d s\n", activity_timeout_in);
   Cli_Printf("Activity Timeout Outbound ----- %d s\n", activity_timeout_out);
   Cli_Printf("Maximum Number of Alternates -- %d\n", max_alts);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/mgmt/cli/cli_detailed_command_list.txt
----------------------------------------------------------------------
diff --git a/mgmt/cli/cli_detailed_command_list.txt b/mgmt/cli/cli_detailed_command_list.txt
index 670be8c..54b2776 100644
--- a/mgmt/cli/cli_detailed_command_list.txt
+++ b/mgmt/cli/cli_detailed_command_list.txt
@@ -362,8 +362,7 @@ http			HTTP Configuration
     Keep-Alive Timeout Outbound --- 10 s    (proxy.config.http.keep_alive_no_activity_timeout_out)
     Inactivity Timeout Inbound ---- 120 s   (proxy.config.http.transaction_no_activity_timeout_in)
     Inactivity Timeout Outbound --- 120 s   (proxy.config.http.transaction_no_activity_timeout_out)
-    Header Activity Timeout Inbound ------ 7200 s  (proxy.config.http.transaction_header_active_timeout_in)
-    Request Activity Timeout Inbound ------ 7200 s  (proxy.config.http.transaction_request_active_timeout_in)
+    Activity Timeout Inbound ------ 7200 s  (proxy.config.http.transaction_active_timeout_in)
     Activity Timeout Outbound ----- 7200 s  (proxy.config.http.transaction_active_timeout_out)
     Maximum Number of Alternates -- 3       (proxy.config.cache.limits.http.max_alts)
     Remove the following common headers
@@ -966,8 +965,7 @@ http			HTTP Configuration
           keep-alive-timeout-out   (proxy.config.http.keep_alive_no_activity_timeout_out)
           inactive-timeout-in      (proxy.config.http.transaction_no_activity_timeout_in)
           inactive-timeout-out     (proxy.config.http.transaction_no_activity_timeout_out)
-          header-active-timeout-in        (proxy.config.http.transaction_header_active_timeout_in)
-          request-active-timeout-in        (proxy.config.http.transaction_request_active_timeout_in)
+          active-timeout-in        (proxy.config.http.transaction_active_timeout_in)
           active-timeout-out       (proxy.config.http.transaction_active_timeout_out)
 
     ts# config:http keep-alive-timeout-in 10

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 14cbf1e..461a9b7 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1190,10 +1190,7 @@ HttpConfig::startup()
                                     "proxy.config.http.transaction_no_activity_timeout_in");
   HttpEstablishStaticConfigLongLong(c.oride.transaction_no_activity_timeout_out,
                                     "proxy.config.http.transaction_no_activity_timeout_out");
-  HttpEstablishStaticConfigLongLong(c.transaction_header_active_timeout_in, "proxy.config.http.transaction_header_active_timeout_in");
-  HttpEstablishStaticConfigLongLong(c.transaction_request_active_timeout_in, "proxy.config.http.transaction_request_active_timeout_in");
-  if (c.transaction_header_active_timeout_in >= c.transaction_request_active_timeout_in)
-    c.transaction_request_active_timeout_in = 0;
+  HttpEstablishStaticConfigLongLong(c.transaction_active_timeout_in, "proxy.config.http.transaction_active_timeout_in");
   HttpEstablishStaticConfigLongLong(c.oride.transaction_active_timeout_out, "proxy.config.http.transaction_active_timeout_out");
   HttpEstablishStaticConfigLongLong(c.accept_no_activity_timeout, "proxy.config.http.accept_no_activity_timeout");
 
@@ -1464,8 +1461,7 @@ HttpConfig::reconfigure()
   params->oride.keep_alive_no_activity_timeout_out = m_master.oride.keep_alive_no_activity_timeout_out;
   params->oride.transaction_no_activity_timeout_in = m_master.oride.transaction_no_activity_timeout_in;
   params->oride.transaction_no_activity_timeout_out = m_master.oride.transaction_no_activity_timeout_out;
-  params->oride.transaction_header_active_timeout_in = m_master.oride.transaction_header_active_timeout_in;
-  params->oride.transaction_request_active_timeout_in = m_master.oride.transaction_request_active_timeout_in;
+  params->transaction_active_timeout_in = m_master.transaction_active_timeout_in;
   params->oride.transaction_active_timeout_out = m_master.oride.transaction_active_timeout_out;
   params->accept_no_activity_timeout = m_master.accept_no_activity_timeout;
   params->oride.background_fill_active_timeout = m_master.oride.background_fill_active_timeout;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 04e14cb..c220463 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -420,7 +420,6 @@ struct OverridableHttpConfigParams {
       cache_guaranteed_min_lifetime(0), cache_guaranteed_max_lifetime(31536000), cache_max_stale_age(604800),
       keep_alive_no_activity_timeout_in(115), keep_alive_no_activity_timeout_out(120),
       transaction_no_activity_timeout_in(30), transaction_no_activity_timeout_out(30),
-      transaction_header_active_timeout_in(0), transaction_request_active_timeout_in(0),
       transaction_active_timeout_out(0), origin_max_connections(0),
       connect_attempts_max_retries(0), connect_attempts_max_retries_dead_server(3),
       connect_attempts_rr_retries(3), connect_attempts_timeout(30),
@@ -559,8 +558,6 @@ struct OverridableHttpConfigParams {
   MgmtInt keep_alive_no_activity_timeout_out;
   MgmtInt transaction_no_activity_timeout_in;
   MgmtInt transaction_no_activity_timeout_out;
-  MgmtInt transaction_header_active_timeout_in;
-  MgmtInt transaction_request_active_timeout_in;
   MgmtInt transaction_active_timeout_out;
   MgmtInt origin_max_connections;
 
@@ -672,8 +669,7 @@ public:
   MgmtByte session_auth_cache_keep_alive_enabled;
   MgmtInt origin_server_pipeline;
   MgmtInt user_agent_pipeline;
-  MgmtInt transaction_header_active_timeout_in;
-  MgmtInt transaction_request_active_timeout_in;
+  MgmtInt transaction_active_timeout_in;
   MgmtInt accept_no_activity_timeout;
 
   ////////////////////////////////////
@@ -906,8 +902,7 @@ HttpConfigParams::HttpConfigParams()
     session_auth_cache_keep_alive_enabled(1),
     origin_server_pipeline(1),
     user_agent_pipeline(8),
-    transaction_header_active_timeout_in(0),
-    transaction_request_active_timeout_in(0),
+    transaction_active_timeout_in(900),
     accept_no_activity_timeout(120),
     parent_connect_attempts(4),
     per_parent_connect_attempts(2),

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c05a0979/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index ce4f8b2..3804c50 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -636,11 +636,8 @@ HttpSM::attach_client_session(HttpClientSession * client_vc, IOBufferReader * bu
   // set up timeouts     //
   /////////////////////////
   client_vc->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(HttpConfig::m_master.accept_no_activity_timeout));
-  if (HttpConfig::m_master.transaction_header_active_timeout_in)
-    client_vc->get_netvc()->set_active_timeout(HRTIME_SECONDS(HttpConfig::m_master.transaction_header_active_timeout_in));
-  else if (HttpConfig::m_master.transaction_request_active_timeout_in)
-    client_vc->get_netvc()->set_active_timeout(HRTIME_SECONDS(HttpConfig::m_master.transaction_request_active_timeout_in));
-    
+  client_vc->get_netvc()->set_active_timeout(HRTIME_SECONDS(HttpConfig::m_master.transaction_active_timeout_in));
+
   // Add our state sm to the sm list
   state_add_to_list(EVENT_NONE, NULL);
 }
@@ -761,7 +758,6 @@ HttpSM::state_read_client_request_header(int event, void *data)
     milestones.ua_read_header_done = ink_get_hrtime();
   }
 
-  int method;
   switch (state) {
   case PARSE_ERROR:
     DebugSM("http", "[%" PRId64 "] error parsing client request header", sm_id);
@@ -769,7 +765,6 @@ HttpSM::state_read_client_request_header(int event, void *data)
     // Disable further I/O on the client
     ua_entry->read_vio->nbytes = ua_entry->read_vio->ndone;
 
-    ua_session->get_netvc()->cancel_active_timeout();
     call_transact_and_set_next_state(HttpTransact::BadRequest);
     break;
 
@@ -781,7 +776,6 @@ HttpSM::state_read_client_request_header(int event, void *data)
       // Disable further I/O on the client
       ua_entry->read_vio->nbytes = ua_entry->read_vio->ndone;
 
-      ua_session->get_netvc()->cancel_active_timeout();
       call_transact_and_set_next_state(HttpTransact::BadRequest);
       break;
     } else if (event == VC_EVENT_READ_COMPLETE) {
@@ -825,21 +819,6 @@ HttpSM::state_read_client_request_header(int event, void *data)
         (t_state.method == HTTP_WKSIDX_POST && HttpConfig::m_master.post_copy_size))
       enable_redirection = HttpConfig::m_master.redirection_enabled;
 
-    method = t_state.hdr_info.client_request.method_get_wksidx();
-    if ((method == HTTP_WKSIDX_POST || method == HTTP_WKSIDX_PUT || (t_state.hdr_info.extension_method && t_state.hdr_info.request_content_length > 0))) {
-      // is setted HttpConfig::m_master.transaction_header_active_timeout_in, so should reset active_timeout_in
-      if (ua_session->get_netvc()->get_active_timeout() == HRTIME_SECONDS(HttpConfig::m_master.transaction_header_active_timeout_in)) {
-        if (HttpConfig::m_master.transaction_request_active_timeout_in) {
-          if (HRTIME_SECONDS(HttpConfig::m_master.transaction_request_active_timeout_in) > (milestones.ua_read_header_done - milestones.sm_start)) {
-            ua_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(HttpConfig::m_master.transaction_request_active_timeout_in) - (milestones.ua_read_header_done - milestones.sm_start));
-          }
-        } else {
-          ua_session->get_netvc()->cancel_active_timeout();
-        }
-      }
-    } else {
-      ua_session->get_netvc()->cancel_active_timeout();
-    }
     call_transact_and_set_next_state(HttpTransact::ModifyRequest);
 
     break;
@@ -3316,7 +3295,6 @@ HttpSM::tunnel_handler_post_ua(int event, HttpTunnelProducer * p)
   case VC_EVENT_ACTIVE_TIMEOUT:
     //  Did not complete post tunnling.  Abort the
     //   server and close the ua
-    ua_session->get_netvc()->cancel_active_timeout();
     p->handler_state = HTTP_SM_POST_UA_FAIL;
     tunnel.chain_abort_all(p);
     p->read_vio = NULL;
@@ -3346,7 +3324,6 @@ HttpSM::tunnel_handler_post_ua(int event, HttpTunnelProducer * p)
     p->handler_state = HTTP_SM_POST_SUCCESS;
     p->read_success = true;
     ua_entry->in_tunnel = false;
-    ua_session->get_netvc()->cancel_active_timeout();
 
     if (p->do_dechunking || p->do_chunked_passthru) {
       if (p->chunked_handler.truncation) {


[46/48] git commit: TS-2185: support to control ClusterCom::sendSharedData frequency

Posted by zw...@apache.org.
TS-2185: support to control ClusterCom::sendSharedData frequency


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0a92bcdc
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0a92bcdc
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0a92bcdc

Branch: refs/heads/5.0.x
Commit: 0a92bcdccec4e79e1527521a01f2a464a7d6ce28
Parents: 55f792e
Author: Chen Bin <ku...@taobao.com>
Authored: Tue Sep 10 15:27:21 2013 +0800
Committer: Chen Bin <ku...@taobao.com>
Committed: Tue Sep 10 15:27:21 2013 +0800

----------------------------------------------------------------------
 CHANGES                    | 2 ++
 mgmt/RecordsConfig.cc      | 2 ++
 mgmt/cluster/ClusterCom.cc | 5 +++++
 mgmt/cluster/ClusterCom.h  | 1 +
 4 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index faa6402..e973653 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 4.1.0
 
 
+  *) [TS-2185] Support to control ClusterCom::sendSharedData frequency.
+
   *) [TS-2195] Deprecate experimental TSHttpTxnCacheLookupSkip API.
 
   *) [TS-2176] Do not reset value of api_skip_cache_lookup when reading it.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 86ce925..d9e4ab3 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -215,6 +215,8 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.cluster.peer_timeout", RECD_INT, "30", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.cluster.mc_send_interval", RECD_INT, "2", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
   {RECT_CONFIG, "proxy.config.cluster.startup_timeout", RECD_INT, "10", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   //# cluster type requires restart to change

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index a365412..2e3a7e4 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -423,6 +423,9 @@ ClusterCom::ClusterCom(unsigned long oip, char *host, int mcport, char *group, i
   peer_timeout = REC_readInteger("proxy.config.cluster.peer_timeout", &found);
   ink_assert(found);
 
+  mc_send_interval = REC_readInteger("proxy.config.cluster.mc_send_interval", &found);
+  ink_assert(found);
+
   /* Launch time */
   startup_time = time(NULL);
 
@@ -1308,6 +1311,8 @@ ClusterCom::sendSharedData(bool send_proxy_heart_beat)
     int time_since_last_send = now - last_shared_send;
     if (last_shared_send != 0 && time_since_last_send > peer_timeout) {
       Warning("multicast send timeout exceeded.  %d seconds since" " last send.", time_since_last_send);
+    } else if (last_shared_send != 0 && time_since_last_send < mc_send_interval) {
+      return true;
     }
     last_shared_send = now;
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a92bcdc/mgmt/cluster/ClusterCom.h
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.h b/mgmt/cluster/ClusterCom.h
index 39b10f3..3300336 100644
--- a/mgmt/cluster/ClusterCom.h
+++ b/mgmt/cluster/ClusterCom.h
@@ -152,6 +152,7 @@ public:
 
   time_t delta_thresh;
   time_t peer_timeout;
+  time_t mc_send_interval;
   time_t our_wall_clock;
   time_t startup_timeout;
   time_t startup_time;


[06/48] git commit: TS-858 Updated the docs to 128MB examples

Posted by zw...@apache.org.
TS-858 Updated the docs to 128MB examples

This avoids the confusion of examples being smaller than
the minimum disk cache size we have.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/18240535
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/18240535
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/18240535

Branch: refs/heads/5.0.x
Commit: 182405352dd62726e532135bad155df57e5d8014
Parents: 6da47d5
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Sep 4 13:00:01 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed Sep 4 13:00:08 2013 -0600

----------------------------------------------------------------------
 doc/reference/configuration/storage.config.en.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/18240535/doc/reference/configuration/storage.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/storage.config.en.rst b/doc/reference/configuration/storage.config.en.rst
index 6440894..d216846 100644
--- a/doc/reference/configuration/storage.config.en.rst
+++ b/doc/reference/configuration/storage.config.en.rst
@@ -58,15 +58,15 @@ However, some operating systems have stronger requirements - see the following e
 Examples
 ========
 
-The following basic example shows 64 MB of cache storage in the
+The following basic example shows 128 MB of cache storage in the
 ``/big_dir`` directory::
 
-   /big_dir 67108864
+   /big_dir 134217728
 
 You can use the ``.`` symbol for the current directory. Here is an
 example for 64 MB of cache storage in the current directory::
 
-   . 67108864
+   . 134217728
 
 Solaris Example
 ---------------


[20/48] git commit: TS-361 Document human readable number multiplies for configuration values

Posted by zw...@apache.org.
TS-361 Document human readable number multiplies for configuration values


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f15a2559
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f15a2559
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f15a2559

Branch: refs/heads/5.0.x
Commit: f15a2559abd60f86cee489e7d1599fdf1215c3cf
Parents: c6c817d
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Sep 5 21:35:30 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Sep 5 21:35:30 2013 -0600

----------------------------------------------------------------------
 .../configuration/records.config.en.rst         | 30 +++++++++++++++++--
 .../configuration/storage.config.en.rst         | 31 +++++++++++++++++---
 2 files changed, 54 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f15a2559/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index f92ed71..0652198 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -39,16 +39,34 @@ Each variable has the following format::
 
 where
 
-``SCOPE`` is related to clustering and is either ``CONFIG`` (all members of the cluster) or ``LOCAL`` (only the local machine)
+``SCOPE`` is related to clustering and is either ``CONFIG`` (all members of
+the cluster) or ``LOCAL`` (only the local machine)
 
-``DATATYPE`` is one of ``INT`` (integer), ``STRING`` (string), ``FLOAT`` (floating point).
+``DATATYPE`` is one of ``INT`` (integer), ``STRING`` (string), ``FLOAT``
+(floating point).
 
-A variable marked as ``Deprecated`` is still functional but should be avoided as it may be removed in a future release without warning.
+A variable marked as ``Deprecated`` is still functional but should be avoided
+as it may be removed in a future release without warning.
 
 A variable marked as ``Reloadable`` can be updated via the command::
 
    traffic_line -x
 
+``INT`` type configurations are expressed as any normal integer,
+e.g. *32768*. They can also be expressed using more human readable values
+using standard prefixes, e.g. *32K*. The following prefixes are supported
+for all ``INT` type configurations ::
+
+   -  ``K`` Kilobytes
+   -  ``M`` Megabytes
+   -  ``G`` Gigabytes
+   -  ``T`` Terabytes
+
+.. note::
+
+    Traffic Server currently writes back configurations to disk periodically,
+    and when doing so, will not preserve the prefixes.
+
 Examples
 ========
 
@@ -73,6 +91,12 @@ to 10 seconds. ::
 
    CONFIG proxy.config.cluster.startup_timeout INT 10
 
+The last examples configures a 64GB RAM cache, using a human readable
+prefix. ::
+
+   CONFIG proxy.config.cache.ram_cache.size INT 64G
+
+
 Environment Overrides
 =====================
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f15a2559/doc/reference/configuration/storage.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/storage.config.en.rst b/doc/reference/configuration/storage.config.en.rst
index d216846..4b7575c 100644
--- a/doc/reference/configuration/storage.config.en.rst
+++ b/doc/reference/configuration/storage.config.en.rst
@@ -50,10 +50,22 @@ Specify pathnames according to your operating system requirements. See
 the following examples. In the :file:`storage.config` file, a formatted or
 raw disk must be at least 128 MB.
 
-When using raw disk or partitions, you should make sure the :ts:cv:`Traffic Server user <proxy.config.admin.user_id>`
-used by the Traffic Server process has read and write privileges on the raw disk device or partition. One good practice
-is to make sure the device file is set with 'g+rw' and the Traffic Server user is in the group which owns the device file.
-However, some operating systems have stronger requirements - see the following examples for more information.
+When using raw disk or partitions, you should make sure the :ts:cv:`Traffic
+Server user <proxy.config.admin.user_id>` used by the Traffic Server process
+has read and write privileges on the raw disk device or partition. One good
+practice is to make sure the device file is set with 'g+rw' and the Traffic
+Server user is in the group which owns the device file.  However, some
+operating systems have stronger requirements - see the following examples for
+more information.
+
+As with standard ``records.config`` integers, human readable prefixes are also
+supported. They include::
+
+   -  ``K`` Kilobytes
+   -  ``M`` Megabytes
+   -  ``G`` Gigabytes
+   -  ``T`` Terabytes
+
 
 Examples
 ========
@@ -68,6 +80,17 @@ example for 64 MB of cache storage in the current directory::
 
    . 134217728
 
+As an alternative, using the human readable prefixes, you can express a 64GB
+cache file with::
+
+   /really_big_dir 64G
+
+
+.. note::
+    When using on-filesystem cache disk storage, you can only have one such
+    directory specified. This will be address in a future version.
+   
+
 Solaris Example
 ---------------
 


[08/48] git commit: TS-2168 Make RecordsConfig.cc more inline with default builds.

Posted by zw...@apache.org.
TS-2168 Make RecordsConfig.cc more inline with default builds.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1b75d0f0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1b75d0f0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1b75d0f0

Branch: refs/heads/5.0.x
Commit: 1b75d0f0f27276cb2b123cce8e371454f7673e2a
Parents: ebe3502
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Sep 4 17:02:03 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed Sep 4 17:02:07 2013 -0600

----------------------------------------------------------------------
 CHANGES               | 2 ++
 mgmt/RecordsConfig.cc | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b75d0f0/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 10259f3..a8b1318 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-2168] Make RecordsConfig.cc more inline with default builds.
+
   *) [TS-2174] traffic_shell/traffic_line miss some stats value
 
   *) [TS-2173] RECD_COUNTER type is missing in setTokenValue().

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b75d0f0/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 3f7661d..81f0b2d 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1947,7 +1947,7 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.allocator.max_overage", RECD_INT, "3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "1", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.allocator.reclaim_factor", RECD_FLOAT, "0.3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,


[45/48] git commit: Remove s from indentation

Posted by zw...@apache.org.
Remove <tab>s from indentation


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/55f792ee
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/55f792ee
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/55f792ee

Branch: refs/heads/5.0.x
Commit: 55f792ee0ec3461db0e4299a138081cdf567f8ba
Parents: ecd87cf
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Sep 9 21:16:19 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Sep 9 21:16:19 2013 -0600

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/55f792ee/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 01a5f76..de180aa 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6780,21 +6780,21 @@ HttpTransact::handle_response_keep_alive_headers(State* s, HTTPVersion ver, HTTP
     if (s->client_info.http_version == HTTPVersion(1, 1) && s->txn_conf->chunking_enabled == 1 &&
         // if we're not sending a body, don't set a chunked header regardless of server response
         !is_response_body_precluded(s->hdr_info.client_response.status_get(), s->method) &&
-         // we do not need chunked encoding for internal error messages
-         // that are sent to the client if the server response is not valid.
-         (( (s->source == SOURCE_HTTP_ORIGIN_SERVER || s->source == SOURCE_TRANSFORM) &&
-         s->hdr_info.server_response.valid() &&
-         // if we receive a 304, we will serve the client from the
-         // cache and thus do not need chunked encoding.
-         s->hdr_info.server_response.status_get() != HTTP_STATUS_NOT_MODIFIED &&
-         (s->current.server->transfer_encoding == HttpTransact::CHUNKED_ENCODING ||
-          // we can use chunked encoding if we cannot trust the content
-          // length (e.g. no Content-Length and Connection:close in HTTP/1.1 responses)
-          s->hdr_info.trust_response_cl == false)) ||
+        // we do not need chunked encoding for internal error messages
+        // that are sent to the client if the server response is not valid.
+        (((s->source == SOURCE_HTTP_ORIGIN_SERVER || s->source == SOURCE_TRANSFORM) &&
+          s->hdr_info.server_response.valid() &&
+          // if we receive a 304, we will serve the client from the
+          // cache and thus do not need chunked encoding.
+          s->hdr_info.server_response.status_get() != HTTP_STATUS_NOT_MODIFIED &&
+          (s->current.server->transfer_encoding == HttpTransact::CHUNKED_ENCODING ||
+           // we can use chunked encoding if we cannot trust the content
+           // length (e.g. no Content-Length and Connection:close in HTTP/1.1 responses)
+           s->hdr_info.trust_response_cl == false)) ||
          // handle serve from cache (read-while-write) case
          (s->source == SOURCE_CACHE && s->hdr_info.trust_response_cl == false) ||
-	  //any transform will potentially alter the content length. try chunking if possible
-	  (s->source == SOURCE_TRANSFORM && s->hdr_info.trust_response_cl == false ))) {
+         //any transform will potentially alter the content length. try chunking if possible
+         (s->source == SOURCE_TRANSFORM && s->hdr_info.trust_response_cl == false ))) {
       s->client_info.receive_chunked_response = true;
       heads->value_append(MIME_FIELD_TRANSFER_ENCODING, MIME_LEN_TRANSFER_ENCODING, HTTP_VALUE_CHUNKED, HTTP_LEN_CHUNKED, true);
     } else {


[11/48] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver

Posted by zw...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5ba16cb6
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5ba16cb6
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5ba16cb6

Branch: refs/heads/5.0.x
Commit: 5ba16cb66fd053e37d3c84a619255cb139c01d16
Parents: 439e3ad 1b75d0f
Author: Bryan Call <bc...@apache.org>
Authored: Wed Sep 4 17:22:42 2013 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Sep 4 17:22:42 2013 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------



[44/48] git commit: initialize HttpTunnelProducer::last_state to a default value

Posted by zw...@apache.org.
initialize HttpTunnelProducer::last_state to a default value


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ecd87cff
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ecd87cff
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ecd87cff

Branch: refs/heads/5.0.x
Commit: ecd87cff5e54faa836605da72625b0825c0847f4
Parents: 1fd225a
Author: Bryan Call <bc...@apache.org>
Authored: Mon Sep 9 16:53:02 2013 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Mon Sep 9 16:53:02 2013 -0700

----------------------------------------------------------------------
 proxy/http/HttpTunnel.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ecd87cff/proxy/http/HttpTunnel.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index 8e8ba53..4ba3b33 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -361,7 +361,7 @@ HttpTunnelProducer::HttpTunnelProducer()
     buffer_start(NULL), vc_type(HT_HTTP_SERVER), chunking_action(TCA_PASSTHRU_DECHUNKED_CONTENT),
     do_chunking(false), do_dechunking(false), do_chunked_passthru(false),
     init_bytes_done(0), nbytes(0), ntodo(0), bytes_read(0),
-    handler_state(0), num_consumers(0), alive(false),
+    handler_state(0), last_event(0), num_consumers(0), alive(false),
     read_success(false), flow_control_source(0), name(NULL)
 {
 }


[23/48] git commit: Introduce build-time option to select libxml2 in place of expat as build-time parser.

Posted by zw...@apache.org.
Introduce build-time option to select libxml2 in place of expat
as build-time parser.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2184cc8a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2184cc8a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2184cc8a

Branch: refs/heads/5.0.x
Commit: 2184cc8ace81675d0c4167a380e743c8b96dd808
Parents: 194d245
Author: Nick Kew <nk...@qualys.com>
Authored: Fri Sep 6 10:59:34 2013 +0100
Committer: Nick Kew <nk...@qualys.com>
Committed: Fri Sep 6 10:59:34 2013 +0100

----------------------------------------------------------------------
 build/xml.m4                | 78 ++++++++++++++++++++++++++++++++++++++--
 mgmt/stats/StatProcessor.cc | 30 +++++++++++++---
 mgmt/stats/StatProcessor.h  |  8 +++++
 mgmt/utils/XmlUtils.cc      | 61 ++++++++++++++++++++++++++-----
 4 files changed, 161 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2184cc8a/build/xml.m4
----------------------------------------------------------------------
diff --git a/build/xml.m4 b/build/xml.m4
index 03c59ff..d342814 100644
--- a/build/xml.m4
+++ b/build/xml.m4
@@ -23,12 +23,84 @@ dnl TS_CHECK_XML: look for xml libraries and headers
 dnl
 AC_DEFUN([TS_CHECK_XML], [
   enable_xml=no
-
-  TS_CHECK_XML_EXPAT
-  dnl add checks for other varieties of xml here
+  AC_MSG_CHECKING(["For XML parser"])
+  AC_ARG_WITH(xml, [AC_HELP_STRING([--with-xml=(expat|libxml2)],[select XML parser])],
+  [
+    if test "$withval" = "expat" ; then
+      TS_CHECK_XML_EXPAT
+    elif test "$withval" = "libxml2" ; then
+      TS_CHECK_XML_LIBXML2
+    elif test "x$withval" = "x" ; then
+      TS_CHECK_XML_EXPAT
+      if test "$enable_xml" = "no"; then
+        TS_CHECK_XML_LIBXML2
+      fi
+    else
+      AC_MSG_ERROR([Unrecognised --with-xml option])
+    fi
+  ])
+  if test "$enable_xml" = "no"; then
+    AC_MSG_ERROR([An XML parser (expat or libxml2) is required.])
+  fi
 ])
 dnl
 
+AC_DEFUN([TS_CHECK_XML_LIBXML2], [
+  enable_libxml2=no
+  libxml2_include=""
+  libxml2_ldflags=""
+  AC_ARG_WITH(libxml2, [AC_HELP_STRING([--with-libxml2=DIR],[use a specific libxml2 library])],
+  [
+    if test "x$withval" != "xyes" && test "x$withval" != "x"; then
+      if test "$withval" = "yes"; then
+        enable_libxml2=yes
+        libxml2_include="/usr/include/libxml2"
+      elif test "$withval" != "no"; then
+        enable_libxml2=yes
+        libxml2_include="$withval/include/libxml2"
+        libxml2_ldflags="$withval/lib"
+      fi
+    fi
+  ])
+  if test ${enable_libxml2} = "no"; then
+    enable_libxml2=yes
+    libxml2_include="/usr/include/libxml2"
+  fi
+  if test ${enable_libxml2} != "no"; then
+    AC_CACHE_CHECK([libxml2], [ts_cv_libxml2], [
+      ts_libxml2_CPPFLAGS=$CPPFLAGS
+      ts_libxml2_LIBS="$LIBS"
+      ts_libxml2_LDFLAGS="$LDFLAGS"
+      CPPFLAGS="$CPPFLAGS -I$libxml2_include"
+      LDFLAGS="$LDFLAGS $libxml2_ldflags"
+      LIBS="$LIBS -lxml2"
+      AC_TRY_LINK(
+        [#include <libxml/parser.h>],
+        [xmlSAXHandler sax; xmlCreatePushParserCtxt(&sax, NULL, NULL, 0, NULL);],
+        [ts_cv_libxml2=yes],
+        [ts_cv_libxml2=no],
+      )
+      CPPFLAGS=$ts_libxml2_CPPFLAGS
+      LIBS=$ts_libxml2_LIBS
+      LDFLAGS=$ts_libxml2_LDFLAGS
+    ])
+    if test $ts_cv_libxml2 = yes ; then
+      AC_DEFINE([HAVE_LIBXML2], 1, [Using libxml2])
+      if test -d "$libxml2_include" ; then
+        TS_ADDTO(CPPFLAGS, [-I${libxml2_include}])
+      fi
+      if test -d "$libxml2_ldflags" ; then
+        TS_ADDTO(LDFLAGS, [-L${libxml2_ldflags}])
+        TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R${libxml2_ldflags}])
+      fi
+      TS_ADDTO(LIBS, -lxml2)
+      enable_xml=yes
+    else
+      AC_MSG_ERROR(["Failed to find libxml2"])
+    fi
+  fi
+])
+
 AC_DEFUN([TS_CHECK_XML_EXPAT], [
 enable_expat=no
 AC_ARG_WITH(expat, [AC_HELP_STRING([--with-expat=DIR],[use a specific Expat library])],

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2184cc8a/mgmt/stats/StatProcessor.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatProcessor.cc b/mgmt/stats/StatProcessor.cc
index 268dc29..93a3f05 100644
--- a/mgmt/stats/StatProcessor.cc
+++ b/mgmt/stats/StatProcessor.cc
@@ -65,7 +65,8 @@ startElement(void * /* userData ATS_UNUSED */, const char *name, const char **at
     statObject = NEW(new StatObject(++statCount));
     Debug(MODULE_INIT, "\nStat #: ----------------------- %d -----------------------\n", statCount);
 
-    for (i = 0; atts[i]; i += 2) {
+    if (atts)
+     for (i = 0; atts[i]; i += 2) {
       ink_assert(atts[i + 1]);    // Attribute comes in pairs, hopefully.
 
       if (!strcmp(atts[i], "minimum")) {
@@ -93,7 +94,8 @@ startElement(void * /* userData ATS_UNUSED */, const char *name, const char **at
     nodeVar = true;
     sumClusterVar = true;       // Should only be used with cluster variable
 
-    for (i = 0; atts[i]; i += 2) {
+    if (atts)
+     for (i = 0; atts[i]; i += 2) {
       ink_assert(atts[i + 1]);    // Attribute comes in pairs, hopefully.
       if (!strcmp(atts[i], "scope")) {
         nodeVar = (!strcmp(atts[i + 1], "node") ? true : false);
@@ -137,14 +139,14 @@ endElement(void * /* userData ATS_UNUSED */, const char */* name ATS_UNUSED */)
 
 
 void
-charDataHandler(void * /* userData ATS_UNUSED */, const XML_Char * name, int /* len ATS_UNUSED */)
+charDataHandler(void * /* userData ATS_UNUSED */, const xmlchar * name, int /* len ATS_UNUSED */)
 {
   if (currentTag != EXPR_TAG && currentTag != DST_TAG) {
     return;
   }
 
   char content[BUFSIZ * 10];
-  if (XML_extractContent(name, content, BUFSIZ * 10) == 0) {
+  if (XML_extractContent((const char*)name, content, BUFSIZ * 10) == 0) {
     return;
   }
 
@@ -184,6 +186,7 @@ StatProcessor::rereadConfig()
   fileBuffer = fileContent->bufPtr();
   fileLen = strlen(fileBuffer);
 
+#if HAVE_LIBEXPAT
   /*
    * Start the XML Praser -- the package used is EXPAT
    */
@@ -214,6 +217,25 @@ StatProcessor::rereadConfig()
    * Cleaning upt
    */
   XML_ParserFree(parser);
+#else
+  /* Parse XML with libxml2 */
+  xmlSAXHandler sax;
+  memset(&sax, 0, sizeof(xmlSAXHandler));
+  sax.startElement = startElement;
+  sax.endElement = endElement;
+  sax.characters = charDataHandler;
+  sax.initialized = 1;
+  xmlParserCtxtPtr parser = xmlCreatePushParserCtxt(&sax, NULL, NULL, 0, NULL);
+
+  int status = xmlParseChunk(parser, fileBuffer, fileLen, 1);
+  if (status != 0) {
+    xmlErrorPtr errptr = xmlCtxtGetLastError(parser);
+    mgmt_log(stderr, "%s at %s:%d\n", errptr->message, errptr->file, errptr->line);
+  }
+  xmlFreeParserCtxt(parser);
+#endif
+
+
   delete fileContent;
 
   Debug(MODULE_INIT, "\n\n---------- END OF PARSING & INITIALIZING ---------\n\n");

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2184cc8a/mgmt/stats/StatProcessor.h
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatProcessor.h b/mgmt/stats/StatProcessor.h
index 8e6b0c6..e543e6c 100644
--- a/mgmt/stats/StatProcessor.h
+++ b/mgmt/stats/StatProcessor.h
@@ -46,7 +46,15 @@
 #define _FOOTER
 #include "DynamicStats.h"
 #include "StatType.h"
+#if HAVE_LIBEXPAT
 #include "expat.h"
+typedef XML_Char xmlchar;
+#elif HAVE_LIBXML2
+#include <libxml/parser.h>
+typedef xmlChar xmlchar;
+#else
+# error "No XML parser - please configure expat or libxml2"
+#endif
 #include <string.h>
 #include <stdlib.h>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2184cc8a/mgmt/utils/XmlUtils.cc
----------------------------------------------------------------------
diff --git a/mgmt/utils/XmlUtils.cc b/mgmt/utils/XmlUtils.cc
index 528d40c..317703f 100644
--- a/mgmt/utils/XmlUtils.cc
+++ b/mgmt/utils/XmlUtils.cc
@@ -21,7 +21,16 @@
   limitations under the License.
  */
 
+#include "ink_autoconf.h"
+#if HAVE_LIBEXPAT
 #include "expat.h"
+typedef XML_Char xmlchar;
+#elif HAVE_LIBXML2
+#include <libxml/parser.h>
+typedef xmlChar xmlchar;
+#else
+# error "No XML parser.  Please configure expat or libxml2"
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include "ink_platform.h"
@@ -378,7 +387,7 @@ XMLNode::getAttributeValueByName(const char *pAName)
 }
 
 void /*XMLDom:: */
-elementStart(void *pObj, const char *el, const char **attr)
+elementStart(void *pObj, const xmlchar *el, const xmlchar **attr)
 {
   XMLDom *pDom = (XMLDom *) pObj;
   int nTagLen;
@@ -392,12 +401,15 @@ elementStart(void *pObj, const char *el, const char **attr)
     pDom->m_pCur = p;
   }
 
-  nTagLen = strlen(el);
+  nTagLen = strlen((const char*)el);
   pTag = new char[nTagLen + 1];
   pDom->m_pCur->m_pNodeName = pTag;
   memcpy(pTag, el, nTagLen);
   pTag[nTagLen] = 0;
 
+  if (!attr)
+    return;
+
   int i;
   int nCount = 0;
   for (i = 0; attr[i]; i += 2)
@@ -410,13 +422,13 @@ elementStart(void *pObj, const char *el, const char **attr)
   pDom->m_pCur->m_pAList = new Attribute[nCount];
   for (i = 0; i < nCount; i++) {
     /* Attribute Name: attr[2*i], Value: attr[2*i+1]; */
-    alloc_and_copy(&pDom->m_pCur->m_pAList[i].pAName, attr[2 * i]);
-    alloc_and_copy(&pDom->m_pCur->m_pAList[i].pAValue, attr[2 * i + 1]);
+    alloc_and_copy(&pDom->m_pCur->m_pAList[i].pAName, (const char*)attr[2 * i]);
+    alloc_and_copy(&pDom->m_pCur->m_pAList[i].pAValue, (const char*)attr[2 * i + 1]);
   }
 }
 
 void /*XMLDom:: */
-elementEnd(void *pObj, const char * /* el ATS_UNUSED */)
+elementEnd(void *pObj, const xmlchar * /* el ATS_UNUSED */)
 {
   /*ASSERT(strcmp(el, pCur->pNodeName) == 0); */
   XMLDom *pDom = (XMLDom *) pObj;
@@ -424,7 +436,7 @@ elementEnd(void *pObj, const char * /* el ATS_UNUSED */)
 }
 
 void /*XMLDom:: */
-charHandler(void *pObj, const char *s, int len)
+charHandler(void *pObj, const xmlchar *s, int len)
 {
   XMLNode *pNode = ((XMLDom *) pObj)->m_pCur;
   int oldlen;
@@ -450,6 +462,9 @@ charHandler(void *pObj, const char *s, int len)
 int
 XMLDom::LoadXML(const char *pXml)
 {
+  int rv = 0;
+#if HAVE_LIBEXPAT
+  /* Old (expat) xml parsing */
   XML_Parser p = XML_ParserCreate(NULL);
   if (!p)                       /* no Memory. */
     return 1;
@@ -466,11 +481,39 @@ XMLDom::LoadXML(const char *pXml)
                               /*(void (*)(void *, const char *, int)) */ charHandler
     );
 
-  if (!XML_Parse(p, pXml, strlen(pXml), 0)) {
-    /*return 2;     Parse Error: bad xml format. */
+  if (!XML_Parse(p, pXml, strlen(pXml), 1)) {
+    rv = 2; /*return 2;     Parse Error: bad xml format. */
   }
+  XML_ParserFree(p);
+
+#else
+  /* Alternative (libxml2) xml parsing */
+  xmlParserCtxtPtr p;
+  xmlSAXHandler sax;
+  memset(&sax, 0, sizeof(xmlSAXHandler));
+  sax.startElement = elementStart;
+  sax.endElement = elementEnd;
+  sax.characters = charHandler;
+  sax.initialized = 1;
+  p = xmlCreatePushParserCtxt(&sax, this, NULL, 0, NULL);
+  if (!p)                       /* no Memory. */
+    return 1;
 
-  return 0;
+  /* Looks as if this is actually the whole xml and expat version's
+   * use of 0 for is_final is a bug.  We'll use 1.
+   */
+  if (xmlParseChunk(p, pXml, strlen(pXml), 1) != 0) {
+    rv = 2; /* expat version ignores error, so we'll do likewise */
+  }
+  xmlFreeParserCtxt(p);
+#endif
+
+  /* I don't know why the "return 2" in the old (expat) version was
+   * commented out.  Possibly because the call to XML_Parse incorrectly
+   * used 0 for is_final last arg, in which case we should restore it.
+   * If it's a bug in the caller then we'll just have to return 0 always.
+   */
+  return rv;
 }
 
 int


[29/48] git commit: one last fix hopefully for finding the xml parser, changed from an error message to a warning when it can't find xml2

Posted by zw...@apache.org.
one last fix hopefully for finding the xml parser, changed from an error
message to a warning when it can't find xml2


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2529257c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2529257c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2529257c

Branch: refs/heads/5.0.x
Commit: 2529257cb14f0d670b405d299aee88dff472c423
Parents: f7c09fd
Author: Bryan Call <bc...@apache.org>
Authored: Fri Sep 6 16:26:20 2013 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Fri Sep 6 16:26:20 2013 -0700

----------------------------------------------------------------------
 build/xml.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2529257c/build/xml.m4
----------------------------------------------------------------------
diff --git a/build/xml.m4 b/build/xml.m4
index d4b4356..806a997 100644
--- a/build/xml.m4
+++ b/build/xml.m4
@@ -97,7 +97,7 @@ AC_DEFUN([TS_CHECK_XML_LIBXML2], [
       TS_ADDTO(LIBS, -lxml2)
       enable_xml=yes
     else
-      AC_MSG_ERROR(["Failed to find libxml2"])
+      AC_MSG_WARN(["Failed to find libxml2"])
     fi
   fi
 ])


[47/48] git commit: TS-1637: Fix nodes as idle/dead if we have not heard from them in awhile

Posted by zw...@apache.org.
TS-1637: Fix nodes as idle/dead if we have not heard from them in awhile


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/cb9b0ffd
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/cb9b0ffd
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/cb9b0ffd

Branch: refs/heads/5.0.x
Commit: cb9b0ffd8e9b4fb0f1b6909918abb2894eb76217
Parents: 0a92bcd
Author: Chen Bin <ku...@taobao.com>
Authored: Tue Sep 10 15:54:05 2013 +0800
Committer: Chen Bin <ku...@taobao.com>
Committed: Tue Sep 10 15:54:05 2013 +0800

----------------------------------------------------------------------
 CHANGES                    | 2 ++
 mgmt/RecordsConfig.cc      | 2 ++
 mgmt/cluster/ClusterCom.cc | 5 ++++-
 mgmt/cluster/ClusterCom.h  | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cb9b0ffd/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index e973653..868829d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 4.1.0
 
 
+  *) [TS-1637] Fix nodes as idle/dead if we have not heard from them in awhile
+
   *) [TS-2185] Support to control ClusterCom::sendSharedData frequency.
 
   *) [TS-2195] Deprecate experimental TSHttpTxnCacheLookupSkip API.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cb9b0ffd/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index d9e4ab3..201216d 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -217,6 +217,8 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.cluster.mc_send_interval", RECD_INT, "2", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.cluster.mc_poll_timeout", RECD_INT, "5", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
   {RECT_CONFIG, "proxy.config.cluster.startup_timeout", RECD_INT, "10", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   //# cluster type requires restart to change

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cb9b0ffd/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index 2e3a7e4..430e01b 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -104,7 +104,7 @@ drainIncomingChannel(void *arg)
     // linux: set tv.tv_set in select() loop, since linux's select()
     // will update tv with the amount of time not slept (most other
     // implementations do not do this)
-    tv.tv_sec = 30;             // interface not-responding timeout
+    tv.tv_sec = lmgmt->ccom->mc_poll_timeout;             // interface not-responding timeout
     tv.tv_usec = 0;
 
     memset(message, 0, 61440);
@@ -426,6 +426,9 @@ ClusterCom::ClusterCom(unsigned long oip, char *host, int mcport, char *group, i
   mc_send_interval = REC_readInteger("proxy.config.cluster.mc_send_interval", &found);
   ink_assert(found);
 
+  mc_poll_timeout = REC_readInteger("proxy.config.cluster.mc_poll_timeout", &found);
+  ink_assert(found);
+
   /* Launch time */
   startup_time = time(NULL);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cb9b0ffd/mgmt/cluster/ClusterCom.h
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.h b/mgmt/cluster/ClusterCom.h
index 3300336..4dda298 100644
--- a/mgmt/cluster/ClusterCom.h
+++ b/mgmt/cluster/ClusterCom.h
@@ -153,6 +153,7 @@ public:
   time_t delta_thresh;
   time_t peer_timeout;
   time_t mc_send_interval;
+  time_t mc_poll_timeout;
   time_t our_wall_clock;
   time_t startup_timeout;
   time_t startup_time;


[13/48] git commit: Revert "TS-2172: Explicitly use subdir-objects in automake init"

Posted by zw...@apache.org.
Revert "TS-2172: Explicitly use subdir-objects in automake init"

This reverts commit 471655ca1f9469515444decaaa2f81fde0bd5a25.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/965b7ee5
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/965b7ee5
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/965b7ee5

Branch: refs/heads/5.0.x
Commit: 965b7ee58f4d715e24feab2dfb520075cbbbec5f
Parents: ae49e16
Author: James Peach <jp...@apache.org>
Authored: Wed Sep 4 20:44:15 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed Sep 4 20:44:15 2013 -0700

----------------------------------------------------------------------
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/965b7ee5/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index df91e0d..8023755 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,7 +40,7 @@ AC_PREREQ([2.59])
 AC_CONFIG_AUX_DIR([build/aux])
 AC_CONFIG_SRCDIR([proxy/Main.cc])
 AC_CONFIG_MACRO_DIR([build])
-AM_INIT_AUTOMAKE([-Wall -Werror tar-ustar foreign no-installinfo no-installman subdir-objects 1.9.2])
+AM_INIT_AUTOMAKE([-Wall -Werror tar-ustar foreign no-installinfo no-installman 1.9.2])
 AC_CONFIG_HEADERS([lib/ts/ink_autoconf.h])
 
 # Configure with --disable-silent-rules to get verbose output. For more info, see


[09/48] git commit: TS-2113 first stab at porting it over to ATS, still more work to be done to the balancer plugin

Posted by zw...@apache.org.
TS-2113 first stab at porting it over to ATS, still more work to be done to the balancer plugin


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6688e60d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6688e60d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6688e60d

Branch: refs/heads/5.0.x
Commit: 6688e60db8e40129b1668c39d9ead3f908fe3119
Parents: ebe3502
Author: Bryan Call <bc...@apache.org>
Authored: Wed Sep 4 17:19:45 2013 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Sep 4 17:19:45 2013 -0700

----------------------------------------------------------------------
 plugins/experimental/balancer/balancer.cc | 46 ++++++++++++++------------
 plugins/experimental/balancer/hashkey.h   | 44 +++++++++++-------------
 plugins/experimental/balancer/resources.h | 36 ++++++++++++++------
 3 files changed, 69 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6688e60d/plugins/experimental/balancer/balancer.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/balancer.cc b/plugins/experimental/balancer/balancer.cc
index adc91ad..8b8a5a1 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -41,8 +41,8 @@
 
 #include <string>
 
-#include <ts/remap.h>
 #include <ts/ts.h>
+#include <ts/remap.h>
 
 #include "resources.h"
 #include "hashkey.h"
@@ -151,24 +151,25 @@ public:
         if (TSIsDebugTagSet("balancer")) {
           TSDebug("balancer", "Making %s hash ID's using %s", secondary ? "secondary" : "primary", buf);
         }
-        ycrMD5_r(buf, key_len, id);
+        //MD5(buf, key_len, id);
       } else {
         if (secondary) {
           // Secondary ID defaults to IP (if none of the specified hashes computes)
           char buf[4];
 
-          *buf = resr.getRRI()->client_ip; // ToDo: this only works for IPv4
+          
+          //*buf = resr.getRRI()->client_ip; // ToDo: this only works for IPv4
 
           TSDebug("balancer", "Making secondary hash ID's using IP (default) = %s", buf);
-          ycrMD5_r(buf, key_len, id);
+          //MD5(buf, key_len, id);
         } else {
           // Primary ID defaults to URL (if none of the specified hashes computes)
-          char buf[resr.getRRI()->orig_url_size + 1];
+          char buf[resr._urlSize + 1];
 
-          memcpy(buf, resr.getRRI()->orig_url, resr.getRRI()->orig_url_size);
-          buf[resr.getRRI()->orig_url_size] = '\0';
+          memcpy(buf, resr._urlString, resr._urlSize);
+          buf[resr._urlSize] = '\0';
           TSDebug("balancer", "Making primary hash ID's using URL (default) = %s", buf);
-          ycrMD5_r(buf, key_len, id);
+          //MD5(buf, key_len, id);
         }
       }
     } else {
@@ -190,14 +191,14 @@ private:
 // Initialize the plugin.
 //
 int
-tsremap_init(TSREMAP_INTERFACE *api_info, char *errbuf, int errbuf_size)
+tsremap_init(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
 {
   if (!api_info) {
     strncpy(errbuf, "[tsremap_init] - Invalid TSREMAP_INTERFACE argument", errbuf_size - 1);
     return -1;
   }
 
-  if (api_info->size < sizeof(TSREMAP_INTERFACE)) {
+  if (api_info->size < sizeof(TSRemapInterface)) {
     strncpy(errbuf, "[tsremap_init] - Incorrect size of TSREMAP_INTERFACE structure", errbuf_size - 1);
     return -2;
   }
@@ -216,16 +217,19 @@ tsremap_init(TSREMAP_INTERFACE *api_info, char *errbuf, int errbuf_size)
 ///////////////////////////////////////////////////////////////////////////////
 // One instance per remap.config invocation.
 //
-int
-tsremap_new_instance(int argc, char *argv[], ihandle *ih, char *errbuf, int errbuf_size)
+TSReturnCode
+TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_size)
 {
+  (void) errbuf;
+  (void) errbuf_size;
+
   BalancerInstance* ri = new BalancerInstance;
 
-  *ih = static_cast<ihandle>(ri);
+  *ih = static_cast<void*>(ri);
 
   if (ri == NULL) {
     TSError("Unable to create remap instance");
-    return -5;
+    return TS_ERROR;
   }
 
   for (int ix=2; ix < argc; ++ix) {
@@ -310,13 +314,13 @@ tsremap_new_instance(int argc, char *argv[], ihandle *ih, char *errbuf, int errb
     }
   }
 
-  return 0;
+  return TS_SUCCESS;
 }
 
 void
-tsremap_delete_instance(ihandle ih)
+tsremap_delete_instance(void** ih)
 {
-  BalancerInstance* ri = static_cast<BalancerInstance*>(ih);
+  BalancerInstance* ri = static_cast<BalancerInstance*>(*ih);
 
   delete ri;
 }
@@ -325,8 +329,8 @@ tsremap_delete_instance(ihandle ih)
 ///////////////////////////////////////////////////////////////////////////////
 // This is the main "entry" point for the plugin, called for every request.
 //
-int
-tsremap_remap(ihandle ih, rhandle rh, REMAP_REQUEST_INFO *rri)
+TSRemapStatus
+TSRemapDoRemap(void** ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
 {
   BalancerInstance* balancer;
   int error = 0;
@@ -338,9 +342,9 @@ tsremap_remap(ihandle ih, rhandle rh, REMAP_REQUEST_INFO *rri)
 
   if (NULL == ih) {
     TSDebug("balancer", "Falling back to default URL on remap without rules");
-    return 0;
+    return TSREMAP_NO_REMAP;
   }
-  balancer = static_cast<BalancerInstance*>(ih);
+  balancer = static_cast<BalancerInstance*>(*ih);
 
   // Get the rotation name to use.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6688e60d/plugins/experimental/balancer/hashkey.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/hashkey.h b/plugins/experimental/balancer/hashkey.h
index 856c84f..9cec9fd 100644
--- a/plugins/experimental/balancer/hashkey.h
+++ b/plugins/experimental/balancer/hashkey.h
@@ -56,6 +56,9 @@ public:
   virtual int key(const void** data, Resources& resr) const = 0;
 
   virtual void free_key(const void* data, int len, Resources& resr) const {
+    (void) data;
+    (void) len;
+    (void) resr;
     // No-op by default
   }
 
@@ -86,8 +89,9 @@ class URLHashKey : public HashKey
  public:
   int
   key(const void** data, Resources& resr) const {
-    *data = resr.getRRI()->orig_url;
-    return resr.getRRI()->orig_url_size;
+    int size;
+    *data = resr.getUrl(&size);
+    return size;
   }
 };
 
@@ -100,8 +104,9 @@ class PathHashKey : public HashKey
  public:
   int
   key(const void** data, Resources& resr) const {
-    *data = resr.getRRI()->request_path;
-    return resr.getRRI()->request_path_size;
+    int size;
+    *data = TSUrlPathGet(resr._rri->requestBufp, resr._rri->requestUrl, &size);
+    return size;
   }
 };
 
@@ -152,9 +157,9 @@ class CookieHashKey : public HashKey
         const char* cookie;
 
         if (_sub) {
-          cookie = // TODO - get sub cookie
+          cookie = NULL; // TODO - get sub cookie
         } else {
-          cookie = // TODO - get full cookie
+          cookie = NULL; // TODO - get full cookie
         }
         if (cookie) {
           *data = cookie;
@@ -162,9 +167,9 @@ class CookieHashKey : public HashKey
         }
       }
     } else {
-      if (resr.getRRI()->request_cookie_size > 0) {
-        *data = resr.getRRI()->request_cookie;
-        return resr.getRRI()->request_cookie_size;
+      if (resr._cookie_size > 0) {
+        *data = resr._cookie;
+        return resr._cookie_size;
       }
     }
 
@@ -189,8 +194,10 @@ class IPHashKey : public HashKey
  public:
   int
   key(const void** data, Resources& resr) const {
-    *data = &(resr.getRRI()->client_ip);
-    return 4; // ToDo: This only works with IPV4, obviously
+    const struct sockaddr *addr = TSHttpTxnClientAddrGet(resr._txnp);
+    (void) addr;
+    *data = NULL; // TODO set the right pointer
+    return 4; // TODO set the right size
   }
 };
 
@@ -217,17 +224,12 @@ class HeaderHashKey : public HashKey
     TSMBuffer bufp = resr.getBufp();
     TSMLoc hdrLoc = resr.getHdrLoc();
     TSMLoc fieldLoc;
-    const char* val;
     int len = -1;
 
     // Note that hdrLoc is freed as part of the Resources dtor, and we free the "string" value
     // in the free_key() implementation (after we're done with it).
     if (bufp && hdrLoc && (fieldLoc = TSMimeHdrFieldFind(bufp, hdrLoc, _header, _header_len))) {
-      if (TS_ERROR != TSMimeHdrFieldValueStringGet(bufp, hdrLoc, fieldLoc, 0, &val, &len)) {
-        *data = val;
-      } else {
-        *data = NULL;
-      }
+      *data = TSMimeHdrFieldValueStringGet(bufp, hdrLoc, fieldLoc, 0, &len);
       TSHandleMLocRelease(bufp, hdrLoc, fieldLoc);
     } else {
       *data = NULL;
@@ -236,14 +238,6 @@ class HeaderHashKey : public HashKey
     return len;
   }
 
-  void free_key(const void* data, int len, Resources& resr) const {
-    TSMBuffer bufp = resr.getBufp();
-    TSMLoc hdrLoc = resr.getHdrLoc();
-
-    if (bufp && hdrLoc)
-      TSHandleStringRelease(bufp, hdrLoc, (const char*)data);
-  }
-
  private:
   const char* _header;
   int _header_len;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6688e60d/plugins/experimental/balancer/resources.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/resources.h b/plugins/experimental/balancer/resources.h
index 6188951..531278b 100644
--- a/plugins/experimental/balancer/resources.h
+++ b/plugins/experimental/balancer/resources.h
@@ -31,7 +31,7 @@
 
 #include <ts/remap.h>
 #include <ts/ts.h>
-
+#include <string.h>
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -41,7 +41,7 @@ class Resources
 {
 public:
   Resources(TSHttpTxn txnp, TSRemapRequestInfo *rri) :
-    _txnp(txnp), _rri(rri), _jar(NULL), _bufp(NULL), _hdrLoc(NULL)
+    _rri(rri), _txnp(txnp), _jar(NULL), _bufp(NULL), _hdrLoc(NULL), _urlString(NULL)
   { }
 
   ~Resources() {
@@ -54,24 +54,28 @@ public:
       TSDebug("balancer", "Destroying the cookie jar");
       // TODO - destroy cookies
     }
+
+    if (_urlString) {
+      TSfree(_urlString);
+    }
   }
 
   const TSHttpTxn getTxnp() const { return _txnp; }
     
   const TSRemapRequestInfo* getRRI() const { return _rri; }
 
-  const cookiejar_t
+  const char*
   getJar() {
     if (_jar)
       return _jar;
 
     // Setup the cookie jar for all processing
-    if (_rri->request_cookie_size > 0) {
-      char cookie_hdr[_rri->request_cookie_size + 1];
+    if (_cookie_size > 0) {
+      char cookie_hdr[_cookie_size + 1];
 
-      memcpy(cookie_hdr, _rri->request_cookie, _rri->request_cookie_size);
-      cookie_hdr[_rri->request_cookie_size] = '\0';
-      _jar = // TODO - create cookies
+      memcpy(cookie_hdr, _cookie, _cookie_size);
+      cookie_hdr[_cookie_size] = '\0';
+      _jar = NULL; // TODO - create cookies
       TSDebug("balancer", "Creating the cookie jar");
     }
 
@@ -99,12 +103,22 @@ public:
     return _hdrLoc;
   }
 
-private:
-  TSHttpTxn _txnp;
+  char* getUrl(int *size) {
+    _urlString = TSUrlStringGet(_rri->requestBufp, _rri->requestUrl, size);
+    _urlSize = *size;
+    return _urlString;
+  }
+
+public:
   TSRemapRequestInfo* _rri;
-  cookiejar_t _jar;
+  TSHttpTxn _txnp;
+  size_t _cookie_size;
+  char* _cookie;
+  char* _jar;
   TSMBuffer _bufp;
   TSMLoc _hdrLoc;
+  int _urlSize;
+  char* _urlString;
 };
 
 


[48/48] git commit: Merge remote-tracking branch 'origin/master' into 5.0.x

Posted by zw...@apache.org.
Merge remote-tracking branch 'origin/master' into 5.0.x


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d2774942
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d2774942
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d2774942

Branch: refs/heads/5.0.x
Commit: d2774942966500f17691b3feee6f74213829ba1c
Parents: 9aad786 cb9b0ff
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Sep 10 09:01:51 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Sep 10 09:01:51 2013 -0600

----------------------------------------------------------------------
 CHANGES                                         |  36 +++-
 build/xml.m4                                    |  79 +++++++-
 ci/jenkins/jobs.yaml                            |  56 +++---
 configure.ac                                    |   2 +-
 doc/admin/configuring-cache.en.rst              |  48 +++--
 doc/reference/commands/traffic_cop.en.rst       |  28 ++-
 .../configuration/records.config.en.rst         | 179 +++++++++++++------
 .../configuration/storage.config.en.rst         |  37 +++-
 doc/sdk/new-protocol-plugins.en.rst             |  63 ++++---
 iocore/eventsystem/UnixEThread.cc               |   4 +
 iocore/net/UnixNet.cc                           |   5 +
 lib/perl/Makefile.am                            |   3 +
 lib/ts/ink_lockfile.h                           |   4 -
 mgmt/RecordsConfig.cc                           |  14 +-
 mgmt/cli/ConfigCmd.cc                           |   9 +-
 mgmt/cli/ConfigCmd.h                            |   3 +-
 mgmt/cli/ShowCmd.cc                             |   9 +-
 mgmt/cli/cli_detailed_command_list.txt          |   6 +-
 mgmt/cluster/ClusterCom.cc                      |  10 +-
 mgmt/cluster/ClusterCom.h                       |   2 +
 mgmt/stats/StatProcessor.cc                     |  30 +++-
 mgmt/stats/StatProcessor.h                      |   8 +
 mgmt/stats/StatType.cc                          |   7 +
 mgmt/utils/XmlUtils.cc                          |  61 ++++++-
 plugins/experimental/healthchecks/README        |   4 +-
 .../experimental/healthchecks/healthchecks.c    |  46 +++--
 plugins/regex_remap/README                      |   1 +
 plugins/regex_remap/regex_remap.cc              |  19 +-
 proxy/InkAPI.cc                                 |   8 +-
 proxy/InkAPIInternal.h                          |  95 +++++++---
 proxy/api/ts/experimental.h                     |   5 +-
 proxy/config/records.config.default.in          |  29 ++-
 proxy/http/HttpConfig.cc                        |   8 +-
 proxy/http/HttpConfig.h                         |   9 +-
 proxy/http/HttpSM.cc                            |  39 +---
 proxy/http/HttpTransact.cc                      |  37 ++--
 proxy/http/HttpTransact.h                       |   2 -
 proxy/http/HttpTunnel.cc                        |   2 +-
 38 files changed, 702 insertions(+), 305 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d2774942/CHANGES
----------------------------------------------------------------------
diff --cc CHANGES
index 03d1713,868829d..3d1f7a7
--- a/CHANGES
+++ b/CHANGES
@@@ -1,18 -1,36 +1,42 @@@
                                                           -*- coding: utf-8 -*-
 +Changes with Apache Traffic Server 5.0.0
 +
 +  *) [TS-1919] Eliminate CacheLookupHttpConfig. This breaks cluster
 +   compatibility, so all cluster nodes should be upgraded simultaneously.
 +
 +
  Changes with Apache Traffic Server 4.1.0
  
-   *) [TS-2173] RECD_COUNTER type is missing in setTokenValue()
  
-   *) [TS-2165] Introduce cluster-wide logging stats
+   *) [TS-1637] Fix nodes as idle/dead if we have not heard from them in awhile
+ 
+   *) [TS-2185] Support to control ClusterCom::sendSharedData frequency.
+ 
+   *) [TS-2195] Deprecate experimental TSHttpTxnCacheLookupSkip API.
+ 
+   *) [TS-2176] Do not reset value of api_skip_cache_lookup when reading it.
+     Author: Corey Cossentino <co...@omniti.com>
+ 
+   *) [TS-2191] Do not reschedule http_sm when the sm_list`s lock is not
+    acquired. This can lose items for the WebUI, which will be fixed in a
+    separate bug.
+ 
+   *) [TS-2188] Fixes to make healthcheck plugin not segfault, and parse the
+    log files properly. Author: Scott Harris <sc...@harrisnet.id.au>.
+ 
+   *) [TS-1086] Avoid edge case returning 304 to an unconditional request.
+      Diagnosis and patch by Mohamad Khateeb.
+ 
+   *) [TS-2168] Make RecordsConfig.cc more inline with default builds.
+ 
+   *) [TS-2174] traffic_shell/traffic_line miss some stats value
+ 
+   *) [TS-2173] RECD_COUNTER type is missing in setTokenValue().
+ 
+   *) [TS-2165] Introduce cluster-wide logging stats.
  
    *) [TS-2167] Update apichecker.pl to give suggestions on additional
-    deprecated APIs
+    deprecated APIs.
  
    *) [TS-2163] Remove WDA_BILLING, ACC_ALARMS etc. code and definitions.
  

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d2774942/proxy/http/HttpSM.cc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d2774942/proxy/http/HttpTransact.h
----------------------------------------------------------------------


[27/48] git commit: ci: always build out of tree

Posted by zw...@apache.org.
ci: always build out of tree


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e172ba1d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e172ba1d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e172ba1d

Branch: refs/heads/5.0.x
Commit: e172ba1db1338c2198e93901c32a4fe4d3f70da8
Parents: 9cc5138
Author: James Peach <jp...@apache.org>
Authored: Thu Sep 5 09:06:05 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Sep 6 13:27:25 2013 -0700

----------------------------------------------------------------------
 ci/jenkins/jobs.yaml | 48 +++++++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e172ba1d/ci/jenkins/jobs.yaml
----------------------------------------------------------------------
diff --git a/ci/jenkins/jobs.yaml b/ci/jenkins/jobs.yaml
index cae3da1..e5c7f01 100644
--- a/ci/jenkins/jobs.yaml
+++ b/ci/jenkins/jobs.yaml
@@ -29,18 +29,20 @@
     builders:
         - shell: |
             git clean -d -f -x -q
+            mkdir -p "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             mkdir -p "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
             autoreconf -fi
         - shell: |
+            cd "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             export DEB_BUILD_HARDENING
             ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_WCCP $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
-        - shell: make -j2 V=1
-        - shell: make check
-        - shell: make install
-        - shell: |
+            make -j2 V=1
+            make check
+            make install
             "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"/bin/traffic_server -R 1
-        - shell: make distclean
+            make distclean
         - shell: |
+            rm -rf "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             rm -rf "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
 
 - builder:
@@ -48,21 +50,23 @@
     builders:
         - shell: |
             git clean -d -f -x -q
+            mkdir -p "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             mkdir -p "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
             autoreconf -fi
         - shell: |
+            cd "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             export CC=clang
             export CXX=clang++
             export CXXFLAGS="-Qunused-arguments -std=c++11"
             export WITH_LIBCPLUSPLUS=yes
             ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_WCCP $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
-        - shell: make -j2 V=1
-        - shell: make check
-        - shell: make install
-        - shell: |
+            make -j2 V=1
+            make check
+            make install
             "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"/bin/traffic_server -R 1
-        - shell: make distclean
+            make distclean
         - shell: |
+            rm -rf "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             rm -rf "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
 
 # XXX if we can pass down a $MAKE environment variable from the project, then we can
@@ -73,16 +77,18 @@
         - shell: |
             git clean -d -f -x -q
             mkdir -p "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
+            mkdir -p "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             autoreconf -fi
         - shell: |
+            cd "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_DEBUG
-        - shell: gmake -j2 V=1
-        - shell: gmake check
-        - shell: gmake install
-        - shell: |
+            gmake -j2 V=1
+            gmake check
+            gmake install
             "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"/bin/traffic_server -R 1
-        - shell: gmake distclean
+            gmake distclean
         - shell: |
+            rm -rf "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             rm -rf "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
 
 - builder:
@@ -91,8 +97,10 @@
         - shell: |
             git clean -d -f -x -q
             mkdir -p "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
+            mkdir -p "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             autoreconf -fi
         - shell: |
+            cd "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             export PATH=/sbin:~/bin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/omni/bin:/opt/gcc-4.6.3/bin/:/usr/ucb:/usr/ccs/bin:/usr/sfw/bin:/usr/dt/bin:/usr/openwin/bin
             export CC=/opt/gcc-4.6.3/bin/gcc
             export CXX=/opt/gcc-4.6.3/bin/g++
@@ -102,14 +110,14 @@
             export CPPFLAGS=-I/opt/omni/include
             export LDFLAGS="-L/opt/omni/lib/amd64 -R/opt/omni/lib/amd64"
             ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"  --with-tcl=/opt/omni/lib/amd64 --enable-experimental-plugins $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
-        - shell: gmake -j2 V=1
-        - shell: gmake check
-        - shell: gmake install
-        - shell: |
+            gmake -j2 V=1
+            gmake check
+            gmake install
             "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"/bin/traffic_server -R 1
-        - shell: gmake distclean
+            gmake distclean
         - shell: |
             rm -rf "${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"
+            rm -rf "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
 
 - job-template:
     name: '{node}-{branch}-{tag}-regression'


[40/48] git commit: Use proper sentences in CHANGES

Posted by zw...@apache.org.
Use proper sentences in CHANGES


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ddf36d25
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ddf36d25
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ddf36d25

Branch: refs/heads/5.0.x
Commit: ddf36d25179ac30387316cbe152f9c8f000cde51
Parents: b1845c4
Author: James Peach <jp...@apache.org>
Authored: Mon Sep 9 15:52:24 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Sep 9 15:52:24 2013 -0700

----------------------------------------------------------------------
 CHANGES | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ddf36d25/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9027adb..fd4076f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,7 +2,7 @@
 Changes with Apache Traffic Server 4.1.0
 
 
-  *) [TS-2176] do not reset value of api_skip_cache_lookup when reading it
+  *) [TS-2176] Do not reset value of api_skip_cache_lookup when reading it.
     Author: Corey Cossentino <co...@omniti.com>
 
   *) [TS-2191] Do not reschedule http_sm when the sm_list`s lock is not


[26/48] git commit: ci: fix configure path for out of tree builds

Posted by zw...@apache.org.
ci: fix configure path for out of tree builds


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9a7e6caa
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9a7e6caa
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9a7e6caa

Branch: refs/heads/5.0.x
Commit: 9a7e6caa7007133ccef8afd54f50f8e364016351
Parents: e172ba1
Author: James Peach <jp...@apache.org>
Authored: Fri Sep 6 13:27:18 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Sep 6 13:27:25 2013 -0700

----------------------------------------------------------------------
 ci/jenkins/jobs.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9a7e6caa/ci/jenkins/jobs.yaml
----------------------------------------------------------------------
diff --git a/ci/jenkins/jobs.yaml b/ci/jenkins/jobs.yaml
index e5c7f01..6db5bde 100644
--- a/ci/jenkins/jobs.yaml
+++ b/ci/jenkins/jobs.yaml
@@ -35,7 +35,7 @@
         - shell: |
             cd "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
             export DEB_BUILD_HARDENING
-            ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_WCCP $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
+            "${WORKSPACE}"/configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_WCCP $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
             make -j2 V=1
             make check
             make install
@@ -59,7 +59,7 @@
             export CXX=clang++
             export CXXFLAGS="-Qunused-arguments -std=c++11"
             export WITH_LIBCPLUSPLUS=yes
-            ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_WCCP $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
+            "${WORKSPACE}"/configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_WCCP $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
             make -j2 V=1
             make check
             make install
@@ -81,7 +81,7 @@
             autoreconf -fi
         - shell: |
             cd "${WORKSPACE}/build/${JOB_NAME}.${BUILD_NUMBER}"
-            ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_DEBUG
+            "${WORKSPACE}"/configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}" --enable-experimental-plugins $ENABLE_DEBUG
             gmake -j2 V=1
             gmake check
             gmake install
@@ -109,7 +109,7 @@
             export CXXFLAGS=-m64
             export CPPFLAGS=-I/opt/omni/include
             export LDFLAGS="-L/opt/omni/lib/amd64 -R/opt/omni/lib/amd64"
-            ./configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"  --with-tcl=/opt/omni/lib/amd64 --enable-experimental-plugins $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
+            "${WORKSPACE}"/configure --prefix="${WORKSPACE}/install/${JOB_NAME}.${BUILD_NUMBER}"  --with-tcl=/opt/omni/lib/amd64 --enable-experimental-plugins $ENABLE_DEBUG $ENABLE_EXPERIMENTAL
             gmake -j2 V=1
             gmake check
             gmake install


[10/48] git commit: TS-2168 Make RecordsConfig.cc more inline with default builds.

Posted by zw...@apache.org.
TS-2168 Make RecordsConfig.cc more inline with default builds.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/439e3ad0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/439e3ad0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/439e3ad0

Branch: refs/heads/5.0.x
Commit: 439e3ad07ba7e09c4e8ae2aec9b63ef9aee1ce08
Parents: 6688e60
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Sep 4 17:02:03 2013 -0600
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Sep 4 17:22:22 2013 -0700

----------------------------------------------------------------------
 CHANGES               | 2 ++
 mgmt/RecordsConfig.cc | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/439e3ad0/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 10259f3..a8b1318 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-2168] Make RecordsConfig.cc more inline with default builds.
+
   *) [TS-2174] traffic_shell/traffic_line miss some stats value
 
   *) [TS-2173] RECD_COUNTER type is missing in setTokenValue().

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/439e3ad0/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 3f7661d..81f0b2d 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1947,7 +1947,7 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.allocator.max_overage", RECD_INT, "3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "1", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.allocator.enable_reclaim", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.allocator.reclaim_factor", RECD_FLOAT, "0.3", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,


[36/48] git commit: TS-2188 healthcheck plugin doesn't parse config files properly

Posted by zw...@apache.org.
TS-2188 healthcheck plugin doesn't parse config files properly

This is part of the fixes to the healthcheck plugins, such that
we don't segfault. This part of the fix actually makes sure we
properly parse the configuration file as was expected.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/49d00ff1
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/49d00ff1
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/49d00ff1

Branch: refs/heads/5.0.x
Commit: 49d00ff1fe2d8097952aa857d1b4d79103825043
Parents: a27b9e7
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Sep 9 13:29:28 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Sep 9 13:37:28 2013 -0600

----------------------------------------------------------------------
 .../experimental/healthchecks/healthchecks.c    | 42 +++++++++++++-------
 1 file changed, 27 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49d00ff1/plugins/experimental/healthchecks/healthchecks.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/healthchecks/healthchecks.c b/plugins/experimental/healthchecks/healthchecks.c
index 3c550b7..47b4f7b 100644
--- a/plugins/experimental/healthchecks/healthchecks.c
+++ b/plugins/experimental/healthchecks/healthchecks.c
@@ -312,14 +312,11 @@ parse_configs(const char* fname)
     int state = 0;
     char *ok=NULL, *miss=NULL, *mime=NULL;
 
-    prev_finfo = finfo;
-    finfo = TSmalloc(sizeof(HCFileInfo));
-    memset(finfo, 0, sizeof(HCFileInfo));
-
-    if (NULL == head_finfo)
-      head_finfo = finfo;
-    if (prev_finfo)
-      prev_finfo->_next = finfo;
+    /* Allocate a new config-info, if we don't have one already */
+    if (!finfo) {
+      finfo = TSmalloc(sizeof(HCFileInfo));
+      memset(finfo, 0, sizeof(HCFileInfo));
+    }
 
     if (fgets(buf, sizeof(buf) - 1, fd)) {
       str = strtok_r(buf, SEPARATORS, &save);
@@ -353,12 +350,25 @@ parse_configs(const char* fname)
         str = strtok_r(NULL, SEPARATORS, &save);
       }
 
-      finfo->ok = gen_header(ok, mime, &finfo->o_len);
-      finfo->miss = gen_header(miss, mime, &finfo->m_len);
-      finfo->data = TSmalloc(sizeof(HCFileData));
-      memset(finfo->data, 0, sizeof(HCFileData));
-      reload_status_file(finfo, finfo->data);
-      TSDebug(PLUGIN_NAME, "Parsed: %s %s %s %s %s", finfo->path, finfo->fname, mime, ok, miss);
+      /* Fill in the info if everything was ok */
+      if (state > 4) {
+        TSDebug(PLUGIN_NAME, "Parsed: %s %s %s %s %s", finfo->path, finfo->fname, mime, ok, miss);
+        finfo->ok = gen_header(ok, mime, &finfo->o_len);
+        finfo->miss = gen_header(miss, mime, &finfo->m_len);
+        finfo->data = TSmalloc(sizeof(HCFileData));
+        memset(finfo->data, 0, sizeof(HCFileData));
+        reload_status_file(finfo, finfo->data);
+
+        /* Add it the linked list */
+        TSDebug(PLUGIN_NAME, "Adding path=%s to linked list", finfo->path);
+        if (NULL == head_finfo) {
+          head_finfo = finfo;
+        } else {
+          prev_finfo->_next = finfo;
+        }
+        prev_finfo = finfo;
+        finfo = NULL; /* We used this one up, get a new one next iteration */
+      }
     }
   }
   fclose(fd);
@@ -491,8 +501,10 @@ health_check_origin(TSCont contp ATS_UNUSED, TSEvent event ATS_UNUSED, void *eda
     const char* path = TSUrlPathGet(reqp, url_loc, &path_len);
 
     while (info) {
-      if (info->p_len == path_len && !memcmp(info->path, path, path_len))
+      if (info->p_len == path_len && !memcmp(info->path, path, path_len)) {
+        TSDebug(PLUGIN_NAME, "Found match for /%.*s", path_len, path);
         break;
+      }
       info = info->_next;
     }
 


[07/48] git commit: TS-2179 Added option for lowercase path

Posted by zw...@apache.org.
TS-2179 Added option for lowercase path


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ebe3502c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ebe3502c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ebe3502c

Branch: refs/heads/5.0.x
Commit: ebe3502c18362ac013845b0f197c09227bc03ef9
Parents: 1824053
Author: Bryan Call <bc...@apache.org>
Authored: Wed Sep 4 15:51:58 2013 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Sep 4 15:51:58 2013 -0700

----------------------------------------------------------------------
 plugins/regex_remap/README         |  1 +
 plugins/regex_remap/regex_remap.cc | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ebe3502c/plugins/regex_remap/README
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/README b/plugins/regex_remap/README
index f3dad4e..d2e0c3c 100644
--- a/plugins/regex_remap/README
+++ b/plugins/regex_remap/README
@@ -90,6 +90,7 @@ on the right hand side:
     $p     - The original port number
     $s     - The scheme (e.g. http) of the request
     $P     - The entire path of the request
+    $l     - The entire path of the request in lowercase
     $q     - The query part of the request
     $r     - The path parameters of the request (not implemented yet)
     $c     - The cookie string from the request

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ebe3502c/plugins/regex_remap/regex_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc
index 8b637f6..13955a1 100644
--- a/plugins/regex_remap/regex_remap.cc
+++ b/plugins/regex_remap/regex_remap.cc
@@ -41,6 +41,7 @@
 #include <iostream>
 #include <fstream>
 #include <string>
+#include <ctype.h>
 
 // Get some specific stuff from libts, yes, we can do that now that we build inside the core.
 #include "ink_platform.h"
@@ -67,6 +68,7 @@ enum ExtraSubstitutions {
   SUB_QUERY = 17,
   SUB_MATRIX = 18,
   SUB_CLIENT_IP = 19,
+  SUB_LOWER_PATH = 20,
 };
 
 
@@ -264,6 +266,9 @@ class RemapRegex
           case 'P':
             ix = SUB_PATH;
             break;
+          case 'l':
+            ix = SUB_LOWER_PATH;
+            break;
           case 'q':
             ix = SUB_QUERY;
             break;
@@ -348,6 +353,7 @@ class RemapRegex
           len += req_url->scheme_len;
           break;
         case SUB_PATH:
+        case SUB_LOWER_PATH:
           len += req_url->path_len;
           break;
         case SUB_QUERY:
@@ -411,6 +417,7 @@ class RemapRegex
             len = req_url->scheme_len;
             break;
           case SUB_PATH:
+          case SUB_LOWER_PATH:
             str = req_url->path;
             len = req_url->path_len;
             break;
@@ -434,7 +441,17 @@ class RemapRegex
           // If one of the rules fetched a read-only string, copy it in.
           if (str && len > 0) {
             memcpy(p1, str, len);
-            p1 += len;
+            if (ix == SUB_LOWER_PATH) {
+              TSDebug(PLUGIN_NAME, "lowercasing url: %.*s", len, str);
+              char *end = p1 + len;
+              while (p1 <= end) {
+                *p1 = tolower(*p1);
+                p1++;
+              }
+              p1 = end;
+            } else {
+              p1 += len;
+            }
           }
         }
         p2 += (_sub_pos[i] - prev + 2);


[17/48] git commit: TS-350 Add documentation for the new RAM cache options

Posted by zw...@apache.org.
TS-350 Add documentation for the new RAM cache options


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6648a786
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6648a786
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6648a786

Branch: refs/heads/5.0.x
Commit: 6648a786f8d370f0d682be71545d9dcb64187dca
Parents: 03b88fc
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Sep 5 13:14:04 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Sep 5 13:14:04 2013 -0600

----------------------------------------------------------------------
 doc/admin/configuring-cache.en.rst              | 22 +++++++++++
 .../configuration/records.config.en.rst         | 39 +++++++++++++++++++-
 2 files changed, 59 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6648a786/doc/admin/configuring-cache.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/configuring-cache.en.rst b/doc/admin/configuring-cache.en.rst
index 8b147cc..8eed8c7 100644
--- a/doc/admin/configuring-cache.en.rst
+++ b/doc/admin/configuring-cache.en.rst
@@ -65,6 +65,28 @@ and reduces load on disks, especially during temporary traffic peaks.
 You can configure the RAM cache size to suit your needs, as described in
 :ref:`changing-the-size-of-the-ram-cache` below.
 
+The RAM cache supports two cache eviction algorithms, a regular **LRU**
+(``Least Recently Used``) and the more advanced **CLFUS** (``Clocked Least
+Frequently Used by Size``). The default is to use **CLFUS**, and this is
+controlled via :ts:cv:`proxy.config.cache.ram_cache.algorithm`.
+
+Both the **LRU** and **CLFUS** RAM caches support a configuration to increase
+scan resistance. In a typical **LRU**, if you request all possible objects in
+sequence, you will effectively churn the cache on every request. The option
+:ts:cv:`proxy.config.cache.ram_cache.use_seen_filter` can be set to add some
+resistance against this problem.
+
+In addition, **CLFUS** also supports compressing in the RAM cache itself.
+This can be useful for content which is not compressed by itself (e.g.
+images). This should not be confused with ``Content-Encoding: gzip``, this
+feature is only thereto save space internally in the RAM cache itself. As
+such, it is completely transparent to the User-Agent. The RAM cache
+compression is enabled with the option
+:ts:cv:`proxy.config.cache.ram_cache.compress`. The default is 0, which means
+no compression. Other possible values are 1 for **fastlz**, 2 for **libz** and
+3 for **liblzma**.
+
+
 .. _changing-the-size-of-the-ram-cache:
 
 Changing the Size of the RAM Cache

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6648a786/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index 74867dd..f546187 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -1037,8 +1037,43 @@ RAM Cache
 
 .. :ts:cv:: CONFIG proxy.config.cache.ram_cache.size INT -1
 
-   By default the RAM cache size to is automatically determined, based on cache size (approximately 10 MB of RAM cache per GB of disk cache).
-   Alternatively, it can be set to a fixed value such as 21474836480 (20GB).
+   By default the RAM cache size is automatically determined, based on
+   disk cache size; approximately 10 MB of RAM cache per GB of disk cache.
+   Alternatively, it can be set to a fixed value such as
+   **20GB** (21474836480)
+
+.. :ts:cv:: CONFIG proxy.config.cache.ram_cache.algorithm INT 0
+
+   Two distinct RAM caches are supported, the default (0) being the **CLFUS**
+   (``Clocked Least Frequently Used by Size``). As an alternative, a simpler
+   **LRU** (``Least Recently Used``) cache is also available, by changing this
+   configuration to 1.
+
+.. :ts:cv:: CONFIG proxy.config.cache.ram_cache.use_seen_filter INT 0
+
+   Enabling this option will filter inserts into the RAM cache to ensure that
+   they have been seen at least once.  For the **LRU**, this provides scan
+   resistance. Note that **CLFUS** already requires that a document have history
+   before it is inserted, so for **CLFUS**, setting this option means that a
+   document must be seen three times before it is added to the RAM cache.
+
+.. :ts:cv:: CONFIG proxy.config.cache.ram_cache.compress INT 0
+
+   The **CLFUS** RAM cache also supports an optional in-memory compression.
+   This is not to be confused with ``Content-Encoding: gzip`` compression.
+   The RAM cache compression is intended to try to save space in the RAM,
+   and is not visible to the User-Agent (client).
+
+   Possible values are:
+
+   - ``0`` = no compression
+   - ``1`` = fastlz (extremely fast, relatively low compression)
+   - ``2`` = libz (moderate speed, reasonable compression)
+   - ``3`` = liblzma (very slow, high compression)
+
+   NOTE: compression runs on task threads.  To use more cores for
+   RAM cache compression, increase :ts:cv:`proxy.config.task_threads`.
+
 
 Heuristic Expiration
 ====================


[12/48] git commit: TS-2113 - Porting balancer over to ATS, still more work to be done

Posted by zw...@apache.org.
TS-2113 - Porting balancer over to ATS, still more work to be done


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ae49e166
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ae49e166
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ae49e166

Branch: refs/heads/5.0.x
Commit: ae49e16639b35e9304adf6a3ef41ce77bb2612f6
Parents: 5ba16cb
Author: Bryan Call <bc...@apache.org>
Authored: Wed Sep 4 17:31:12 2013 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Sep 4 17:31:12 2013 -0700

----------------------------------------------------------------------
 plugins/experimental/balancer/balancer.cc | 46 ++++++++++++--------------
 plugins/experimental/balancer/hashkey.h   | 44 +++++++++++++-----------
 plugins/experimental/balancer/resources.h | 36 ++++++--------------
 3 files changed, 57 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ae49e166/plugins/experimental/balancer/balancer.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/balancer.cc b/plugins/experimental/balancer/balancer.cc
index 8b8a5a1..adc91ad 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -41,8 +41,8 @@
 
 #include <string>
 
-#include <ts/ts.h>
 #include <ts/remap.h>
+#include <ts/ts.h>
 
 #include "resources.h"
 #include "hashkey.h"
@@ -151,25 +151,24 @@ public:
         if (TSIsDebugTagSet("balancer")) {
           TSDebug("balancer", "Making %s hash ID's using %s", secondary ? "secondary" : "primary", buf);
         }
-        //MD5(buf, key_len, id);
+        ycrMD5_r(buf, key_len, id);
       } else {
         if (secondary) {
           // Secondary ID defaults to IP (if none of the specified hashes computes)
           char buf[4];
 
-          
-          //*buf = resr.getRRI()->client_ip; // ToDo: this only works for IPv4
+          *buf = resr.getRRI()->client_ip; // ToDo: this only works for IPv4
 
           TSDebug("balancer", "Making secondary hash ID's using IP (default) = %s", buf);
-          //MD5(buf, key_len, id);
+          ycrMD5_r(buf, key_len, id);
         } else {
           // Primary ID defaults to URL (if none of the specified hashes computes)
-          char buf[resr._urlSize + 1];
+          char buf[resr.getRRI()->orig_url_size + 1];
 
-          memcpy(buf, resr._urlString, resr._urlSize);
-          buf[resr._urlSize] = '\0';
+          memcpy(buf, resr.getRRI()->orig_url, resr.getRRI()->orig_url_size);
+          buf[resr.getRRI()->orig_url_size] = '\0';
           TSDebug("balancer", "Making primary hash ID's using URL (default) = %s", buf);
-          //MD5(buf, key_len, id);
+          ycrMD5_r(buf, key_len, id);
         }
       }
     } else {
@@ -191,14 +190,14 @@ private:
 // Initialize the plugin.
 //
 int
-tsremap_init(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
+tsremap_init(TSREMAP_INTERFACE *api_info, char *errbuf, int errbuf_size)
 {
   if (!api_info) {
     strncpy(errbuf, "[tsremap_init] - Invalid TSREMAP_INTERFACE argument", errbuf_size - 1);
     return -1;
   }
 
-  if (api_info->size < sizeof(TSRemapInterface)) {
+  if (api_info->size < sizeof(TSREMAP_INTERFACE)) {
     strncpy(errbuf, "[tsremap_init] - Incorrect size of TSREMAP_INTERFACE structure", errbuf_size - 1);
     return -2;
   }
@@ -217,19 +216,16 @@ tsremap_init(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
 ///////////////////////////////////////////////////////////////////////////////
 // One instance per remap.config invocation.
 //
-TSReturnCode
-TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_size)
+int
+tsremap_new_instance(int argc, char *argv[], ihandle *ih, char *errbuf, int errbuf_size)
 {
-  (void) errbuf;
-  (void) errbuf_size;
-
   BalancerInstance* ri = new BalancerInstance;
 
-  *ih = static_cast<void*>(ri);
+  *ih = static_cast<ihandle>(ri);
 
   if (ri == NULL) {
     TSError("Unable to create remap instance");
-    return TS_ERROR;
+    return -5;
   }
 
   for (int ix=2; ix < argc; ++ix) {
@@ -314,13 +310,13 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_s
     }
   }
 
-  return TS_SUCCESS;
+  return 0;
 }
 
 void
-tsremap_delete_instance(void** ih)
+tsremap_delete_instance(ihandle ih)
 {
-  BalancerInstance* ri = static_cast<BalancerInstance*>(*ih);
+  BalancerInstance* ri = static_cast<BalancerInstance*>(ih);
 
   delete ri;
 }
@@ -329,8 +325,8 @@ tsremap_delete_instance(void** ih)
 ///////////////////////////////////////////////////////////////////////////////
 // This is the main "entry" point for the plugin, called for every request.
 //
-TSRemapStatus
-TSRemapDoRemap(void** ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
+int
+tsremap_remap(ihandle ih, rhandle rh, REMAP_REQUEST_INFO *rri)
 {
   BalancerInstance* balancer;
   int error = 0;
@@ -342,9 +338,9 @@ TSRemapDoRemap(void** ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
 
   if (NULL == ih) {
     TSDebug("balancer", "Falling back to default URL on remap without rules");
-    return TSREMAP_NO_REMAP;
+    return 0;
   }
-  balancer = static_cast<BalancerInstance*>(*ih);
+  balancer = static_cast<BalancerInstance*>(ih);
 
   // Get the rotation name to use.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ae49e166/plugins/experimental/balancer/hashkey.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/hashkey.h b/plugins/experimental/balancer/hashkey.h
index 9cec9fd..856c84f 100644
--- a/plugins/experimental/balancer/hashkey.h
+++ b/plugins/experimental/balancer/hashkey.h
@@ -56,9 +56,6 @@ public:
   virtual int key(const void** data, Resources& resr) const = 0;
 
   virtual void free_key(const void* data, int len, Resources& resr) const {
-    (void) data;
-    (void) len;
-    (void) resr;
     // No-op by default
   }
 
@@ -89,9 +86,8 @@ class URLHashKey : public HashKey
  public:
   int
   key(const void** data, Resources& resr) const {
-    int size;
-    *data = resr.getUrl(&size);
-    return size;
+    *data = resr.getRRI()->orig_url;
+    return resr.getRRI()->orig_url_size;
   }
 };
 
@@ -104,9 +100,8 @@ class PathHashKey : public HashKey
  public:
   int
   key(const void** data, Resources& resr) const {
-    int size;
-    *data = TSUrlPathGet(resr._rri->requestBufp, resr._rri->requestUrl, &size);
-    return size;
+    *data = resr.getRRI()->request_path;
+    return resr.getRRI()->request_path_size;
   }
 };
 
@@ -157,9 +152,9 @@ class CookieHashKey : public HashKey
         const char* cookie;
 
         if (_sub) {
-          cookie = NULL; // TODO - get sub cookie
+          cookie = // TODO - get sub cookie
         } else {
-          cookie = NULL; // TODO - get full cookie
+          cookie = // TODO - get full cookie
         }
         if (cookie) {
           *data = cookie;
@@ -167,9 +162,9 @@ class CookieHashKey : public HashKey
         }
       }
     } else {
-      if (resr._cookie_size > 0) {
-        *data = resr._cookie;
-        return resr._cookie_size;
+      if (resr.getRRI()->request_cookie_size > 0) {
+        *data = resr.getRRI()->request_cookie;
+        return resr.getRRI()->request_cookie_size;
       }
     }
 
@@ -194,10 +189,8 @@ class IPHashKey : public HashKey
  public:
   int
   key(const void** data, Resources& resr) const {
-    const struct sockaddr *addr = TSHttpTxnClientAddrGet(resr._txnp);
-    (void) addr;
-    *data = NULL; // TODO set the right pointer
-    return 4; // TODO set the right size
+    *data = &(resr.getRRI()->client_ip);
+    return 4; // ToDo: This only works with IPV4, obviously
   }
 };
 
@@ -224,12 +217,17 @@ class HeaderHashKey : public HashKey
     TSMBuffer bufp = resr.getBufp();
     TSMLoc hdrLoc = resr.getHdrLoc();
     TSMLoc fieldLoc;
+    const char* val;
     int len = -1;
 
     // Note that hdrLoc is freed as part of the Resources dtor, and we free the "string" value
     // in the free_key() implementation (after we're done with it).
     if (bufp && hdrLoc && (fieldLoc = TSMimeHdrFieldFind(bufp, hdrLoc, _header, _header_len))) {
-      *data = TSMimeHdrFieldValueStringGet(bufp, hdrLoc, fieldLoc, 0, &len);
+      if (TS_ERROR != TSMimeHdrFieldValueStringGet(bufp, hdrLoc, fieldLoc, 0, &val, &len)) {
+        *data = val;
+      } else {
+        *data = NULL;
+      }
       TSHandleMLocRelease(bufp, hdrLoc, fieldLoc);
     } else {
       *data = NULL;
@@ -238,6 +236,14 @@ class HeaderHashKey : public HashKey
     return len;
   }
 
+  void free_key(const void* data, int len, Resources& resr) const {
+    TSMBuffer bufp = resr.getBufp();
+    TSMLoc hdrLoc = resr.getHdrLoc();
+
+    if (bufp && hdrLoc)
+      TSHandleStringRelease(bufp, hdrLoc, (const char*)data);
+  }
+
  private:
   const char* _header;
   int _header_len;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ae49e166/plugins/experimental/balancer/resources.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/resources.h b/plugins/experimental/balancer/resources.h
index 531278b..6188951 100644
--- a/plugins/experimental/balancer/resources.h
+++ b/plugins/experimental/balancer/resources.h
@@ -31,7 +31,7 @@
 
 #include <ts/remap.h>
 #include <ts/ts.h>
-#include <string.h>
+
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -41,7 +41,7 @@ class Resources
 {
 public:
   Resources(TSHttpTxn txnp, TSRemapRequestInfo *rri) :
-    _rri(rri), _txnp(txnp), _jar(NULL), _bufp(NULL), _hdrLoc(NULL), _urlString(NULL)
+    _txnp(txnp), _rri(rri), _jar(NULL), _bufp(NULL), _hdrLoc(NULL)
   { }
 
   ~Resources() {
@@ -54,28 +54,24 @@ public:
       TSDebug("balancer", "Destroying the cookie jar");
       // TODO - destroy cookies
     }
-
-    if (_urlString) {
-      TSfree(_urlString);
-    }
   }
 
   const TSHttpTxn getTxnp() const { return _txnp; }
     
   const TSRemapRequestInfo* getRRI() const { return _rri; }
 
-  const char*
+  const cookiejar_t
   getJar() {
     if (_jar)
       return _jar;
 
     // Setup the cookie jar for all processing
-    if (_cookie_size > 0) {
-      char cookie_hdr[_cookie_size + 1];
+    if (_rri->request_cookie_size > 0) {
+      char cookie_hdr[_rri->request_cookie_size + 1];
 
-      memcpy(cookie_hdr, _cookie, _cookie_size);
-      cookie_hdr[_cookie_size] = '\0';
-      _jar = NULL; // TODO - create cookies
+      memcpy(cookie_hdr, _rri->request_cookie, _rri->request_cookie_size);
+      cookie_hdr[_rri->request_cookie_size] = '\0';
+      _jar = // TODO - create cookies
       TSDebug("balancer", "Creating the cookie jar");
     }
 
@@ -103,22 +99,12 @@ public:
     return _hdrLoc;
   }
 
-  char* getUrl(int *size) {
-    _urlString = TSUrlStringGet(_rri->requestBufp, _rri->requestUrl, size);
-    _urlSize = *size;
-    return _urlString;
-  }
-
-public:
-  TSRemapRequestInfo* _rri;
+private:
   TSHttpTxn _txnp;
-  size_t _cookie_size;
-  char* _cookie;
-  char* _jar;
+  TSRemapRequestInfo* _rri;
+  cookiejar_t _jar;
   TSMBuffer _bufp;
   TSMLoc _hdrLoc;
-  int _urlSize;
-  char* _urlString;
 };
 
 


[04/48] git commit: TS-2174: Assign proper type for uninitialized expression token

Posted by zw...@apache.org.
TS-2174: Assign proper type for uninitialized expression token

In librecords, not all token are register at initialization,
we must assign proper type if it is undefined.

Signed-off-by: Yunkai Zhang <qi...@taobao.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b71ca552
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b71ca552
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b71ca552

Branch: refs/heads/5.0.x
Commit: b71ca5521466b22b44500bd09adb128081a573ea
Parents: 0ec6fc7
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Thu Sep 5 02:01:49 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Thu Sep 5 02:18:55 2013 +0800

----------------------------------------------------------------------
 CHANGES                | 2 ++
 mgmt/stats/StatType.cc | 7 +++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b71ca552/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 2a8e2b8..10259f3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-2174] traffic_shell/traffic_line miss some stats value
+
   *) [TS-2173] RECD_COUNTER type is missing in setTokenValue().
 
   *) [TS-2165] Introduce cluster-wide logging stats.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b71ca552/mgmt/stats/StatType.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatType.cc b/mgmt/stats/StatType.cc
index 3e13d78..1f92abe 100644
--- a/mgmt/stats/StatType.cc
+++ b/mgmt/stats/StatType.cc
@@ -1123,6 +1123,13 @@ StatObjectList::Eval()
           }
           // scroll old values
           for (StatExprToken * token = object->m_postfix->first(); token; token = object->m_expression->next(token)) {
+
+            // in librecords, not all statistics are register at initialization
+            // must assign proper type if it is undefined.
+            if (!isOperator(token->m_arith_symbol) && token->m_token_type == RECD_NULL) {
+              token->assignTokenType();
+            }
+
             if (token->m_token_value_delta) {
               if (!varDataFromName(token->m_token_type, token->m_token_name,
                                    &tempValue)) {


[37/48] git commit: TS-2188 Never consider a simple / path as a healthcheck

Posted by zw...@apache.org.
TS-2188 Never consider a simple / path as a healthcheck

This is an optimization, and a safety net, such that a simple
/ path can never be considered for a healthcheck.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9e82415f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9e82415f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9e82415f

Branch: refs/heads/5.0.x
Commit: 9e82415fc2c40a628589f4053ad1103c5730bdb8
Parents: 49d00ff
Author: Scott Harris <sc...@harrisnet.id.au>
Authored: Mon Sep 9 13:36:22 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Sep 9 13:37:28 2013 -0600

----------------------------------------------------------------------
 CHANGES                                          | 3 +++
 plugins/experimental/healthchecks/README         | 4 +++-
 plugins/experimental/healthchecks/healthchecks.c | 4 ++++
 3 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9e82415f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 878b55b..6734ed8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,9 @@ Changes with Apache Traffic Server 4.1.0
   
   *) [TS-2191] not reschedule http_sm when the sm_list`s lock is not acquired.
 
+  *) [TS-2188] Fixes to make healthcheck plugin not segfault, and parse
+   the log files properly. Author: Scott Harris <sc...@harrisnet.id.au>.
+
   *) [TS-1086] Avoid edge case returning 304 to an unconditional request.
      Diagnosis and patch by Mohamad Khateeb.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9e82415f/plugins/experimental/healthchecks/README
----------------------------------------------------------------------
diff --git a/plugins/experimental/healthchecks/README b/plugins/experimental/healthchecks/README
index 920dbe7..ab156ac 100644
--- a/plugins/experimental/healthchecks/README
+++ b/plugins/experimental/healthchecks/README
@@ -6,8 +6,10 @@ This configuration contains one, or several, lines of the format
 
    <URI-path> <file-path> <mime> <file-exists-code> <file-missing-code>
 
+The URI-path can *not* be "/" only.
 
-For example,
+
+Examples:
 
    /__hc  /var/run/ts-alive  text/plain 200  403
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9e82415f/plugins/experimental/healthchecks/healthchecks.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/healthchecks/healthchecks.c b/plugins/experimental/healthchecks/healthchecks.c
index 47b4f7b..c7ae166 100644
--- a/plugins/experimental/healthchecks/healthchecks.c
+++ b/plugins/experimental/healthchecks/healthchecks.c
@@ -500,6 +500,10 @@ health_check_origin(TSCont contp ATS_UNUSED, TSEvent event ATS_UNUSED, void *eda
     int path_len = 0;
     const char* path = TSUrlPathGet(reqp, url_loc, &path_len);
 
+    /* Short circuit the / path, common case, and we won't allow healthecks on / */
+    if (!path || !path_len)
+      goto cleanup;
+
     while (info) {
       if (info->p_len == path_len && !memcmp(info->path, path, path_len)) {
         TSDebug(PLUGIN_NAME, "Found match for /%.*s", path_len, path);


[21/48] git commit: TS-361 Explain K, M, G and T

Posted by zw...@apache.org.
TS-361 Explain K, M, G and T


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d3917df3
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d3917df3
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d3917df3

Branch: refs/heads/5.0.x
Commit: d3917df32b01e701adc8aeee59fdb4f511c807f2
Parents: f15a255
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Sep 5 21:49:13 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Sep 5 21:49:13 2013 -0600

----------------------------------------------------------------------
 doc/reference/configuration/records.config.en.rst | 8 ++++----
 doc/reference/configuration/storage.config.en.rst | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d3917df3/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index 0652198..83e8bd4 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -57,10 +57,10 @@ e.g. *32768*. They can also be expressed using more human readable values
 using standard prefixes, e.g. *32K*. The following prefixes are supported
 for all ``INT` type configurations ::
 
-   -  ``K`` Kilobytes
-   -  ``M`` Megabytes
-   -  ``G`` Gigabytes
-   -  ``T`` Terabytes
+   -  ``K`` Kilobytes (1024 bytes)
+   -  ``M`` Megabytes (1,048,576 bytes)
+   -  ``G`` Gigabytes (1,073,741,824 bytes
+   -  ``T`` Terabytes (1,099,511,627,776 bytes)
 
 .. note::
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d3917df3/doc/reference/configuration/storage.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/storage.config.en.rst b/doc/reference/configuration/storage.config.en.rst
index 4b7575c..14d811e 100644
--- a/doc/reference/configuration/storage.config.en.rst
+++ b/doc/reference/configuration/storage.config.en.rst
@@ -61,10 +61,10 @@ more information.
 As with standard ``records.config`` integers, human readable prefixes are also
 supported. They include::
 
-   -  ``K`` Kilobytes
-   -  ``M`` Megabytes
-   -  ``G`` Gigabytes
-   -  ``T`` Terabytes
+   -  ``K`` Kilobytes (1024 bytes)
+   -  ``M`` Megabytes (1,048,576 bytes)
+   -  ``G`` Gigabytes (1,073,741,824 bytes
+   -  ``T`` Terabytes (1,099,511,627,776 bytes)
 
 
 Examples


[32/48] git commit: doc: document traffic_cop

Posted by zw...@apache.org.
doc: document traffic_cop


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f2882b8e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f2882b8e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f2882b8e

Branch: refs/heads/5.0.x
Commit: f2882b8e0770cfa3e16e0b2c3f170ab94b4f34e4
Parents: 2c19473
Author: James Peach <jp...@apache.org>
Authored: Sat Sep 7 21:30:20 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Sep 7 21:30:20 2013 -0700

----------------------------------------------------------------------
 doc/reference/commands/traffic_cop.en.rst | 28 +++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f2882b8e/doc/reference/commands/traffic_cop.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/commands/traffic_cop.en.rst b/doc/reference/commands/traffic_cop.en.rst
index 9dd4e99..a19c2a3 100644
--- a/doc/reference/commands/traffic_cop.en.rst
+++ b/doc/reference/commands/traffic_cop.en.rst
@@ -24,12 +24,38 @@ traffic_cop
 Description
 ===========
 
+:program:`traffic_cop` is a watchdog program that is responsible
+for starting :program:`traffic_manager` and :program:`traffic_server`
+and monitoring them for responsiveness. If either of these processes
+are determined to be unresponsive, :program:`traffic_cop` will kill
+and restart them.
+
+On Linux, :program:`traffic_cop` will also monitor available memory
+and swap space, restarting the watched processes if the available
+memory falls below a minimum threshold. The memory thresholds can
+be configured with the :ts:cv:`proxy.config.cop.linux_min_swapfree_kb`
+and :ts:cv:`proxy.config.cop.linux_min_memfree_kb` variables.
+
+The following options are available:
+
 .. option:: -stop
 
-   Kill children using ``SIGSTOP`` instead of ``SIGKILL``
+   Kill children using ``SIGSTOP`` instead of ``SIGKILL``. This
+   option is primarily for debugging.
 
 .. option:: -V
 
    Print version information and exit.
 
+:program:`traffic_cop` ordinarily logs to syslog, however for
+debugging purposes, the ``--enable-cop-debug`` build option
+causes it to log trace messages to
+:file:`/tmp/traffic_cop.trace`.
+
+See also
+========
+
+:manpage:`syslog(1)`,
+:manpage:`traffic_manager(8)`,
+:manpage:`traffic_server(8)`
 


[24/48] git commit: Make libxml2 the configuration default XML parser (so it should get a bit of test-driving).

Posted by zw...@apache.org.
Make libxml2 the configuration default XML parser
(so it should get a bit of test-driving).

Separate micro-commit so it's an easy distinction we can confine
to trunk even if the new code makes it into a release as an option
before it's well-tested.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/57fcef17
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/57fcef17
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/57fcef17

Branch: refs/heads/5.0.x
Commit: 57fcef17e1ef5020d475d3c8c71d71c6a7c7c337
Parents: 2184cc8
Author: Nick Kew <nk...@qualys.com>
Authored: Fri Sep 6 11:01:36 2013 +0100
Committer: Nick Kew <nk...@qualys.com>
Committed: Fri Sep 6 11:01:36 2013 +0100

----------------------------------------------------------------------
 build/xml.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/57fcef17/build/xml.m4
----------------------------------------------------------------------
diff --git a/build/xml.m4 b/build/xml.m4
index d342814..fc342a9 100644
--- a/build/xml.m4
+++ b/build/xml.m4
@@ -31,9 +31,9 @@ AC_DEFUN([TS_CHECK_XML], [
     elif test "$withval" = "libxml2" ; then
       TS_CHECK_XML_LIBXML2
     elif test "x$withval" = "x" ; then
-      TS_CHECK_XML_EXPAT
+      TS_CHECK_XML_LIBXML2
       if test "$enable_xml" = "no"; then
-        TS_CHECK_XML_LIBXML2
+        TS_CHECK_XML_EXPAT
       fi
     else
       AC_MSG_ERROR([Unrecognised --with-xml option])


[31/48] git commit: TS-2168: keep records.config in sync with RecordsConfig.cc at all time

Posted by zw...@apache.org.
TS-2168: keep records.config in sync with RecordsConfig.cc at all time

According a long discussion on TS-2168 ticket:

"Since we can't make it conditional on records.config, doing it only in
RecordsConfig.cc makes it impossible to properly implement the verification
features that was requested in a different ticket" -- Leif

Let's remove #if TS_USE_RECLAIMABLE_FREELIST to keep records.config in
sync with RecordsConfig.cc at all time.

Signed-off-by: Yunkai Zhang <qi...@taobao.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2c194735
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2c194735
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2c194735

Branch: refs/heads/5.0.x
Commit: 2c194735ff40ef4272002ff9dde0c3c977d04009
Parents: 9fab65b
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Sun Sep 8 01:26:17 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Sun Sep 8 01:29:32 2013 +0800

----------------------------------------------------------------------
 mgmt/RecordsConfig.cc | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2c194735/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index c1fec36..86ce925 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1938,7 +1938,6 @@ RecordElement RecordsConfig[] = {
   {RECT_CONFIG, "proxy.config.stat_api.max_stats_allowed", RECD_INT, "256", RECU_RESTART_TS, RR_NULL, RECC_INT, "[256-1000]", RECA_NULL}
   ,
 
-#if TS_USE_RECLAIMABLE_FREELIST
   //############
   //#
   //# Using for Reclaimable InkFreeList memory pool
@@ -1952,7 +1951,6 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.allocator.debug_filter", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, "[0-3]", RECA_NULL}
   ,
-#endif /* TS_USE_RECLAIMABLE_FREELIST */
 
   //############
   //#


[30/48] git commit: TS-2168: set 'enable_reclaim' to 1 as default in records.config

Posted by zw...@apache.org.
TS-2168: set 'enable_reclaim' to 1 as default in records.config

Signed-off-by: Yunkai Zhang <qi...@taobao.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9fab65b0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9fab65b0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9fab65b0

Branch: refs/heads/5.0.x
Commit: 9fab65b0136cdf822bbde8fb103d441345ec79ce
Parents: 2529257
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Sat Sep 7 15:39:03 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Sat Sep 7 15:44:24 2013 +0800

----------------------------------------------------------------------
 proxy/config/records.config.default.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9fab65b0/proxy/config/records.config.default.in
----------------------------------------------------------------------
diff --git a/proxy/config/records.config.default.in b/proxy/config/records.config.default.in
index 900d571..84701c3 100644
--- a/proxy/config/records.config.default.in
+++ b/proxy/config/records.config.default.in
@@ -612,7 +612,7 @@ CONFIG proxy.config.diags.show_location INT 0
 #	    --enable-reclaimable-freelist
 #
 ##############################################################################
-CONFIG proxy.config.allocator.enable_reclaim INT 0
+CONFIG proxy.config.allocator.enable_reclaim INT 1
   # The value of reclaim_factor should be in the 0.0 to 1.0 range. Allocators
   # use it to calculate size of unused memory, which is used to determine when
   # to reclaim memory. The larger the value, the more aggressive reclaims.


[22/48] git commit: TS-498 Document dedicate DNS thread configuration

Posted by zw...@apache.org.
TS-498 Document dedicate DNS thread configuration


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/194d2454
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/194d2454
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/194d2454

Branch: refs/heads/5.0.x
Commit: 194d2454dbf6328920c266f46f4012939350263d
Parents: d3917df
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Sep 5 22:04:40 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Sep 5 22:04:40 2013 -0600

----------------------------------------------------------------------
 doc/reference/configuration/records.config.en.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/194d2454/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index 83e8bd4..ae0c2d2 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -1243,6 +1243,14 @@ hostname to ``host_x.y.com``.
 
    Indicates whether to use SRV records for orgin server lookup.
 
+.. ts:cv:: CONFIG proxy.config.dns.dedicated_thread INT 0
+
+   Create and dedicate a thread entirely for DNS processing. This is probably
+   most useful on system which do a significant number of DNS lookups,
+   typically forward proxies. But even on other systems, it can avoid some
+   contention on the first worker thread (which otherwise takes on the burden of
+   all DNS lookups).
+
 HostDB
 ======
 


[34/48] git commit: TS-1086: Avoid returning 304 to an unconditional request. Diagnosis and patch by Mohamad Khateeb.

Posted by zw...@apache.org.
TS-1086: Avoid returning 304 to an unconditional request.
Diagnosis and patch by Mohamad Khateeb.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e8672a89
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e8672a89
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e8672a89

Branch: refs/heads/5.0.x
Commit: e8672a8934f468a4bf3fd34b3d573c783a5398cf
Parents: 8489d51
Author: Nick Kew <nk...@qualys.com>
Authored: Mon Sep 9 16:35:48 2013 +0100
Committer: Nick Kew <nk...@qualys.com>
Committed: Mon Sep 9 16:38:35 2013 +0100

----------------------------------------------------------------------
 CHANGES                    | 3 +++
 proxy/http/HttpTransact.cc | 7 +++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e8672a89/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a8b1318..1c7d948 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-1086] Avoid edge case returning 304 to an unconditional request.
+     Diagnosis and patch by Mohamad Khateeb.
+
   *) [TS-2168] Make RecordsConfig.cc more inline with default builds.
 
   *) [TS-2174] traffic_shell/traffic_line miss some stats value

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e8672a89/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index e39e7e9..512a1cc 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -2853,13 +2853,20 @@ HttpTransact::handle_cache_write_lock(State* s)
   //  we're tunneling response anyway
   if (remove_ims) {
     s->hdr_info.server_request.field_delete(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE);
+    s->hdr_info.server_request.field_delete(MIME_FIELD_IF_NONE_MATCH, MIME_LEN_IF_NONE_MATCH);
     MIMEField *c_ims = s->hdr_info.client_request.field_find(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE);
+    MIMEField *c_inm = s->hdr_info.client_request.field_find(MIME_FIELD_IF_NONE_MATCH, MIME_LEN_IF_NONE_MATCH);
 
     if (c_ims) {
       int len;
       const char *value = c_ims->value_get(&len);
       s->hdr_info.server_request.value_set(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE, value, len);
     }
+    if (c_inm) {
+      int len;
+      const char *value = c_inm->value_get(&len);
+      s->hdr_info.server_request.value_set(MIME_FIELD_IF_NONE_MATCH, MIME_LEN_IF_NONE_MATCH, value, len);
+    }
   }
 
   if (s->cache_info.write_lock_state == CACHE_WL_READ_RETRY) {