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 2014/01/03 18:18:32 UTC

[01/50] git commit: TS-2445: Fix problem with 204 responses closing POST requests

Updated Branches:
  refs/heads/5.0.x 93e7027b4 -> a44a12ab3


TS-2445: Fix problem with 204 responses closing POST requests


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

Branch: refs/heads/5.0.x
Commit: bd00203f2de428800e8531cd09baad20d0e99f0a
Parents: 90af89c
Author: finaldie <hy...@gmail.com>
Authored: Thu Dec 19 15:54:22 2013 +0000
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Dec 19 10:27:57 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bd00203f/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 7f440d0..0fa2974 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6753,7 +6753,7 @@ HttpTransact::handle_response_keep_alive_headers(State* s, HTTPVersion ver, HTTP
     ka_action = KA_DISABLED;
   }
   else if (heads->status_get() == HTTP_STATUS_NO_CONTENT &&
-      (s->current.server->transfer_encoding != NO_TRANSFER_ENCODING || s->hdr_info.request_content_length != 0)) {
+      (s->current.server->transfer_encoding != NO_TRANSFER_ENCODING || heads->get_content_length() != 0)) {
     // some systems hang until the connection closes when receiving a 204 regardless of the K-A headers
     // close if there is any body response from the origin
     ka_action = KA_CLOSE;


[02/50] git commit: TS-2445: Fix problem with 204 responses closing POST requests

Posted by zw...@apache.org.
TS-2445: Fix problem with 204 responses closing POST requests


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

Branch: refs/heads/5.0.x
Commit: 021d1a30b952cab511da95d88d3f59152ee5c95f
Parents: bd00203
Author: Bryan Call <bc...@apache.org>
Authored: Thu Dec 19 10:29:58 2013 -0800
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Dec 19 10:29:58 2013 -0800

----------------------------------------------------------------------
 CHANGES | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/021d1a30/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 5a786a3..bf132c8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2445] Fix problem with 204 responses closing POST requests
+
   *) [TS-2434] Use the FATAL error level to handle plugin errors.
 
   *) [TS-2203] Clarify syslog startup messages for standalone log programs.


[42/50] git commit: TS-2468: portability fixes

Posted by zw...@apache.org.
TS-2468: portability fixes


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

Branch: refs/heads/5.0.x
Commit: 52c2da6ed8ef225b94e3a21460a88990e31b61fc
Parents: 0a6ae3b
Author: James Peach <jp...@apache.org>
Authored: Thu Jan 2 14:27:43 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 2 14:27:43 2014 -0800

----------------------------------------------------------------------
 plugins/experimental/balancer/balancer.cc | 3 ++-
 plugins/experimental/balancer/hash.cc     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/52c2da6e/plugins/experimental/balancer/balancer.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/balancer.cc b/plugins/experimental/balancer/balancer.cc
index ea5150a..1eb0077 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -23,9 +23,10 @@
 
 #include "balancer.h"
 #include <ts/remap.h>
+#include <stdio.h>
 #include <getopt.h>
 #include <string.h>
-#include <functional>
+#include <iterator>
 
 // The policy type is the first comma-separated token.
 static BalancerInstance *

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/52c2da6e/plugins/experimental/balancer/hash.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/hash.cc b/plugins/experimental/balancer/hash.cc
index f6595a8..9d2a204 100644
--- a/plugins/experimental/balancer/hash.cc
+++ b/plugins/experimental/balancer/hash.cc
@@ -151,7 +151,7 @@ struct HashBalancer : public BalancerInstance
 
     MD5_Init(&ctx);
 
-    for (hash_part_type::const_iterator i = this->hash_parts.cbegin(); i != this->hash_parts.cend(); ++i) {
+    for (hash_part_type::const_iterator i = this->hash_parts.begin(); i != this->hash_parts.end(); ++i) {
       (*i)(txn, rri, &ctx);
     }
 


[20/50] git commit: document update for hipes and buffer_upload plugins

Posted by zw...@apache.org.
document update for hipes and buffer_upload plugins


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

Branch: refs/heads/5.0.x
Commit: b36a7e120e4b9c216fe2f13a97015a508911e0a4
Parents: 8d8507f
Author: Kit Chan <ki...@apache.org>
Authored: Sat Dec 28 09:06:04 2013 -0800
Committer: Kit Chan <ki...@apache.org>
Committed: Sat Dec 28 09:06:04 2013 -0800

----------------------------------------------------------------------
 doc/reference/plugins/buffer_upload.en.rst | 93 +++++++++++--------------
 doc/reference/plugins/hipes.en.rst         | 22 ++++--
 2 files changed, 58 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b36a7e12/doc/reference/plugins/buffer_upload.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/buffer_upload.en.rst b/doc/reference/plugins/buffer_upload.en.rst
index ab5f209..022d61e 100644
--- a/doc/reference/plugins/buffer_upload.en.rst
+++ b/doc/reference/plugins/buffer_upload.en.rst
@@ -18,72 +18,63 @@ Buffer Upload Plugin
   specific language governing permissions and limitations
   under the License.
 
+The Buffer Upload plugin offers the following features
 
-..  XXX Discribe what the heck this plugin actually does.
+Installation
+============
 
-Upload proxy specs for phase I:
+Configuration can be explicitly specified as a parameter in ``plugin.config`` ::
 
-1. Memory buffering (buffer the entire POST data in IOBuffer before
-   connecting to OS) 1.1. Memory buffer size is configured with
-   "mem_buffer_size" in config file. Default and minimum value is 32K
-   You can increase it in the config file. If the size of a request is
-   larger than the "mem_buffer_size" value specifiied in the config
-   file, then the upload proxy feature will be disabled for this
-   particular request
+    buffer_upload.so /FOOBAR/upload.conf
 
-2. Disk buffering (buffer the entire POST data on disk before connecting
-   to OS) 2.1. Use disk async IO. This involved some changes in ATS core
-   . new APIs wrapping around ink_aio_read() and ink_aio_write() .
-   change to distinguish between api call's AIO and cache's AIO .
-   guarantee api call's AIO only involves certain amount of threads .
-   the number of threads is configurable in plugin's config file
-   (default is 4)
+Memory buffering (buffer the entire POST data in IOBuffer before connecting to OS)
+==================================================================================
 
-3. 
+Memory buffer size is configured with "mem_buffer_size" in config file. Default and minimum value is 32K. You can
+increase it in the config file. If the size of a request is larger than the "mem_buffer_size" value specifiied in the
+config file, then the upload proxy feature will be disabled for this particular request
 
-   2. Directories and files generated on disk . base directory:
-      FOOBAR/var/buffer_upload_tmp/ (configurable in config file) .
-      number of subdirectories: 64 (configurable in config file) .
-      filename are randomly generated . files will be removed when the
-      entire data have been sent out to OS . remove dangling files (left
-      on disk due to transaction interruption or traffic server crash)
-      at startup time
+Disk buffering (buffer the entire POST data on disk before connecting to OS)
+============================================================================
 
-4. 
+1. Disk async IO is used. AIO api call only involves certain amount of threads. The number of threads is configurable in
+plugin's config file (default is 4)
 
-   3. Default chunk size when reading from disk: 16K, configurable in
-      config file
+2. Directories and files are generated on disk . Base directory is /FOOBAR/var/buffer_upload_tmp/ (configurable in
+config file). Number of subdirectories is 64 (configurable in config file). Filename are randomly generated. Files will
+be removed when the entire data have been sent out to OS . At startup time, dangling files are removed (left on disk due
+to transaction interruption or traffic server crash)
 
-5. Default buffering mode: disk aio buffering mode 3.1. to turn off disk
-   buffering, add a "use_disk_buffer 0" line in config file
+3. Default chunk size when reading from disk is 16K, configurable in config file
 
-6. Trigger POST buffering on certain URLs 4.1. certain URLs will be
-   provided in a plain text file (one URL each line) 4.2. specify
-   filename in config file by "url_list_file" 4.3. max length of each
-   URL: 4096 (configurable in config file) 4.4. use exact match, don't
-   support regex for now
+Trigger POST buffering on certain URLs
+======================================
 
-7. URL conversion for Mail's specific URL format 5.1. for now check if
-   the "host" part in the URL is same as the proxy server name, then
-   will do this conversion 5.2. To turn on URL conversion feature, set
-   "convert_url 1" in config file
+1. Certain URLs will be provided in a plain text file (one URL each line) 
+2. Specify filename in config file by "url_list_file" 
+3. max length of each URL is 4096 (configurable in config file) 
+4. use exact match, don't support regex for now
 
-8. All request headers inlcuding cookies plus the entire POST data will
-   be buffered (either in memory or on disk)
+Other Features 
+==============
 
-9. Config file can be explicitly sepcified as a parameter in command
-   line (in plugin.config file)
+1. Default buffering mode is disk aio buffering mode. To turn off disk buffering, add a "use_disk_buffer 0" line in
+config file
 
-a sample config file:
+2. All request headers inlcuding cookies plus the entire POST data will be buffered (either in memory or on disk)
 
-use_disk_buffer 1 convert_url 1 chunk_size 1024 url_list_file
-/tmp/url_list.conf max_url_length 10000 base_dir /tmp/test1
-subdir_num 100 thread_num 10 mem_buffer_size 40000
+Configuration File
+==================
 
-default config file: FOOBAR/etc/upload.conf
+sample config file ::
 
-default config values: use_disk_buffer 1 convert_url 0 chunk_size
-16384 url_list_file none max_url_length 4096 base_dir
-FOOBAR/var/buffer_upload_tmp subdir_num 64 thread_num 4
-mem_buffer_size 32768
+    use_disk_buffer 1 
+    convert_url 1 
+    chunk_size 1024 
+    url_list_file /tmp/url_list.conf 
+    max_url_length 10000 
+    base_dir /tmp/test1
+    subdir_num 100 
+    thread_num 10 
+    mem_buffer_size 40000
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b36a7e12/doc/reference/plugins/hipes.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/hipes.en.rst b/doc/reference/plugins/hipes.en.rst
index e74a58a..20c847b 100644
--- a/doc/reference/plugins/hipes.en.rst
+++ b/doc/reference/plugins/hipes.en.rst
@@ -62,7 +62,8 @@ only apply to the connection to the specific "service" host.
 Notes on HIPES
 ==============
 
-HTTP Pipes (aka HIPES and pronounced "Hippies") allows data services to be pipelined together, as illustrated by the example below.
+HTTP Pipes (aka HIPES and pronounced "Hippies") allows data services to be pipelined together, as illustrated by the
+example below. 
 
 Example
 =======
@@ -90,25 +91,34 @@ to this URL ::
 
     http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt
 
-5. In this example, the service ``svc_case.php`` fetches and transforms the response of ``http://127.0.0.1/test.txt`` (which ATS proxies the request to a local file) to upper case. And subsequently the service ``svc_reverse.php`` receives the response and reverse the order before the response is sent back to the client by ATS.
+5. In this example, the service ``svc_case.php`` fetches and transforms the response of ``http://127.0.0.1/test.txt``
+(which ATS proxies the request to a local file) to upper case. And subsequently the service ``svc_reverse.php`` receives
+the response and reverse the order before the response is sent back to the client by ATS. 
 
 Notes on reducing traffic 
 =========================
 
-There can be significant overhead using HIPES because the data can traverse through ATS many times. Caching can be important to reduce traffic to services/through ATS and can be achieved via a proper ``Cache-Control`` header returned by the services. Another way to reduce traffic through ATS is to have ATS to return 302 redirects to url for the requests made by service, instead of proxying the requests to that url. However, the service must then be able to follow the redirect. The down side is that we cannot use ATS to cache intermediate results. Below is an example of using redirect. 
+There can be significant overhead using HIPES because the data can traverse through ATS many times. Caching can be
+important to reduce traffic to services/through ATS and can be achieved via a proper ``Cache-Control`` header returned
+by the services. Another way to reduce traffic through ATS is to have ATS to return 302 redirects to url for the
+requests made by service, instead of proxying the requests to that url. However, the service must then be able to follow
+the redirect. The down side is that we cannot use ATS to cache intermediate results. Below is an example of using
+redirect.  
 
 Modification to above example to reduce traffic using redirect
 ==============================================================
 
-1. The service ``svc_reverse.php`` is modified to add a header of ``X-HIPES-Redirect: 2`` to the request made against ``url``.
+1. The service ``svc_reverse.php`` is modified to add a header of ``X-HIPES-Redirect: 2`` to the request made against
+``url``. 
 
 2. HIPES plugin will instruct ATS to return a redirect response to this url ::
 
     http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt
 
-for the following request
+for the following request ::
 
     http://127.0.0.1/svc_case;case=u/test.txt
 
-3.  The service ``svc_reverse.php`` is also modified to follow the redirect. Thus the response of the service of ``svc_case.php`` will not pass through ATS and will pass to ``svc_reverse.php`` service instead. 
+3.  The service ``svc_reverse.php`` is also modified to follow the redirect. Thus the response of the service of
+``svc_case.php`` will not pass through ATS and will pass to ``svc_reverse.php`` service instead.  
 


[05/50] git commit: TS-2448: Fix traffic_cop to work correctly if proxy.config.local_state_dir is set

Posted by zw...@apache.org.
TS-2448: Fix traffic_cop to work correctly if proxy.config.local_state_dir is set


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

Branch: refs/heads/5.0.x
Commit: b78aa56acccb74b3a507fd8642fdb847b34f76bf
Parents: 2772ae6
Author: James Peach <jp...@apache.org>
Authored: Mon Dec 16 15:51:32 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Fri Dec 20 15:23:09 2013 -0800

----------------------------------------------------------------------
 cmd/traffic_cop/traffic_cop.cc | 62 ++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b78aa56a/cmd/traffic_cop/traffic_cop.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_cop/traffic_cop.cc b/cmd/traffic_cop/traffic_cop.cc
index 21ea7d1..088be6a 100644
--- a/cmd/traffic_cop/traffic_cop.cc
+++ b/cmd/traffic_cop/traffic_cop.cc
@@ -61,9 +61,7 @@ static const char COP_TRACE_FILE[] = "/tmp/traffic_cop.trace";
 #define COP_WARNING  LOG_ERR
 #define COP_DEBUG    LOG_DEBUG
 
-static const char *root_dir;
 static const char *runtime_dir;
-static const char *config_dir;
 static char config_file[PATH_NAME_MAX];
 
 static char cop_lockfile[PATH_NAME_MAX];
@@ -1704,45 +1702,13 @@ init_signals()
 }
 
 static void
-init_config_dir()
-{
-
-  struct stat info;
-
-  cop_log_trace("Entering init_config_dir()\n");
-
-  root_dir = Layout::get()->prefix;
-  runtime_dir = config_read_runtime_dir();
-  config_dir = Layout::get()->sysconfdir;
-
-  if (chdir(root_dir) < 0) {
-    cop_log(COP_FATAL, "unable to change to root directory \"%s\" [%d '%s']\n", root_dir, errno, strerror(errno));
-    cop_log(COP_FATAL," please set correct path in env variable TS_ROOT \n");
-    exit(1);
-  }
-
-  if (stat(config_dir, &info) < 0) {
-    cop_log(COP_FATAL, "unable to locate config directory '%s'\n",config_dir);
-    cop_log(COP_FATAL, " please try setting correct root path in env variable TS_ROOT \n");
-    exit(1);
-  }
-
-  if (stat(runtime_dir, &info) < 0) {
-    cop_log(COP_FATAL, "unable to locate local state directory '%s'\n",runtime_dir);
-    cop_log(COP_FATAL, " please try setting correct root path in either env variable TS_ROOT \n");
-    exit(1);
-  }
-  cop_log_trace("Leaving init_config_dir()\n");
-}
-
-static void
 init_lockfiles()
 {
 
   cop_log_trace("Entering init_lockfiles()\n");
-  Layout::relative_to(cop_lockfile, sizeof(cop_lockfile), Layout::get()->runtimedir, COP_LOCK);
-  Layout::relative_to(manager_lockfile, sizeof(manager_lockfile), Layout::get()->runtimedir, MANAGER_LOCK);
-  Layout::relative_to(server_lockfile, sizeof(server_lockfile), Layout::get()->runtimedir, SERVER_LOCK);
+  Layout::relative_to(cop_lockfile, sizeof(cop_lockfile), runtime_dir, COP_LOCK);
+  Layout::relative_to(manager_lockfile, sizeof(manager_lockfile), runtime_dir, MANAGER_LOCK);
+  Layout::relative_to(server_lockfile, sizeof(server_lockfile), runtime_dir, SERVER_LOCK);
 
   cop_log_trace("Leaving init_lockfiles()\n");
 }
@@ -1757,8 +1723,17 @@ static void
 init_config_file()
 {
   struct stat info;
+  const char * config_dir;
 
   cop_log_trace("Entering init_config_file()\n");
+
+  config_dir = Layout::get()->sysconfdir;
+  if (stat(config_dir, &info) < 0) {
+    cop_log(COP_FATAL, "unable to locate config directory '%s'\n",config_dir);
+    cop_log(COP_FATAL, " please try setting correct root path in env variable TS_ROOT \n");
+    exit(1);
+  }
+
   Layout::relative_to(config_file, sizeof(config_file), config_dir, "records.config.shadow");
   if (stat(config_file, &info) < 0) {
     Layout::relative_to(config_file, sizeof(config_file), config_dir, "records.config");
@@ -1773,6 +1748,8 @@ init_config_file()
 static void
 init()
 {
+  struct stat info;
+
   cop_log_trace("Entering init()\n");
 
   RecConfigFileInit();
@@ -1780,9 +1757,16 @@ init()
   init_signals();
   init_syslog();
 
-  init_config_dir();
-
   init_config_file();
+  config_reload_records();
+
+  runtime_dir = config_read_runtime_dir();
+  if (stat(runtime_dir, &info) < 0) {
+    cop_log(COP_FATAL, "unable to locate local state directory '%s'\n",runtime_dir);
+    cop_log(COP_FATAL, " please try setting correct root path in either env variable TS_ROOT \n");
+    exit(1);
+  }
+
   init_lockfiles();
   check_lockfile();
 


[09/50] git commit: DOC: fix some syntax errors in documents

Posted by zw...@apache.org.
DOC: fix some syntax errors in documents


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

Branch: refs/heads/5.0.x
Commit: 9da35d28da42ba3159011af2e1624dbb640e9996
Parents: 9410b75
Author: Masakazu Kitajo <m4...@gmail.com>
Authored: Sun Dec 22 22:19:27 2013 +0900
Committer: James Peach <jp...@apache.org>
Committed: Sun Dec 22 19:56:20 2013 -0800

----------------------------------------------------------------------
 doc/admin/faqs.en.rst                            | 2 +-
 doc/reference/commands/traffic_top.en.rst        | 4 ++--
 doc/reference/configuration/cache.config.en.rst  | 1 +
 doc/reference/configuration/plugin.config.en.rst | 2 +-
 doc/reference/plugins/combo_handler.en.rst       | 1 +
 doc/reference/plugins/ts_lua.en.rst              | 3 ++-
 doc/sdk/mutex-guide.en.rst                       | 2 +-
 7 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9da35d28/doc/admin/faqs.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/faqs.en.rst b/doc/admin/faqs.en.rst
index 79e608f..3236aea 100644
--- a/doc/admin/faqs.en.rst
+++ b/doc/admin/faqs.en.rst
@@ -29,7 +29,7 @@ FAQs
 How do you create a raw disk for the cache if all your disks have mounted file systems?
 ---------------------------------------------------------------------------------------
 
-Create a large file on filesystem (with :manpage`dd(1)`) and mount it as loopback device.
+Create a large file on filesystem (with :manpage:`dd(1)`) and mount it as loopback device.
 This is accomplished with :manpage:`losetup(8)` on Linux, :manpage:`lofiadm(1m)` on Solaris
 and Illumos, and :manpage:`mdconfig(8)` on FreeBSD.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9da35d28/doc/reference/commands/traffic_top.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/commands/traffic_top.en.rst b/doc/reference/commands/traffic_top.en.rst
index dec0a05..3c73a1f 100644
--- a/doc/reference/commands/traffic_top.en.rst
+++ b/doc/reference/commands/traffic_top.en.rst
@@ -15,9 +15,9 @@
   specific language governing permissions and limitations
   under the License.
 
-==========
+===========
 traffic_top
-==========
+===========
 
 .. program:: traffic_top
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9da35d28/doc/reference/configuration/cache.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/cache.config.en.rst b/doc/reference/configuration/cache.config.en.rst
index e9a691e..e8c875a 100644
--- a/doc/reference/configuration/cache.config.en.rst
+++ b/doc/reference/configuration/cache.config.en.rst
@@ -128,6 +128,7 @@ The following list shows possible actions and their allowed values.
       this content to be stored locally on every cluster node.
 
 .. _cache-responses-to-cookies:
+
 ``cache-responses-to-cookies``
    Change the style of caching with regard to cookies. This effectively
    overrides the configuration parameter

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9da35d28/doc/reference/configuration/plugin.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/plugin.config.en.rst b/doc/reference/configuration/plugin.config.en.rst
index f846a2e..ca069b5 100644
--- a/doc/reference/configuration/plugin.config.en.rst
+++ b/doc/reference/configuration/plugin.config.en.rst
@@ -54,7 +54,7 @@ Server configuration can be changed. If a plugin requires the current
 value, it must obtain that using the management API.
 
 Examples
-=======
+========
 
 ::
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9da35d28/doc/reference/plugins/combo_handler.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/combo_handler.en.rst b/doc/reference/plugins/combo_handler.en.rst
index a1a70be..eb79002 100644
--- a/doc/reference/plugins/combo_handler.en.rst
+++ b/doc/reference/plugins/combo_handler.en.rst
@@ -69,6 +69,7 @@ file paths can be extracted and specified separately using a 'p' query
 parameter. Successive file path parameters are appended to this prefix
 to create complete file paths. The prefix will remain active until
 changed or cleared (set to an empty string). For example, the query ::
+
     "/file1&p=/path1/&file2&file3&p=&/file4&p=/dir:path2/&file5&file6"
 
 results in these file paths being "reconstructed"::

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9da35d28/doc/reference/plugins/ts_lua.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/ts_lua.en.rst b/doc/reference/plugins/ts_lua.en.rst
index c5015be..e2c896a 100644
--- a/doc/reference/plugins/ts_lua.en.rst
+++ b/doc/reference/plugins/ts_lua.en.rst
@@ -218,6 +218,7 @@ Synopsis
 **test_server_intercept.lua**
 
 ::
+
     require 'os'
 
     function send_data()
@@ -561,7 +562,7 @@ ts.client_request.header.HEADER
 
 **description**: Set, add to, clear or get the current request's HEADER.
 
-Here is an example:
+Here is an example:::
 
     function do_remap()
         local req_host = ts.client_request.header.Host

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9da35d28/doc/sdk/mutex-guide.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/mutex-guide.en.rst b/doc/sdk/mutex-guide.en.rst
index 5320754..0aa6239 100644
--- a/doc/sdk/mutex-guide.en.rst
+++ b/doc/sdk/mutex-guide.en.rst
@@ -116,7 +116,7 @@ accessed by other continuations or processes. Here's how:
        mutexp = TSMutexCreate ();
 
 2. | When you create the continuation, specify this mutex as the
-   continuation's mutex.
+     continuation's mutex.
    | For example:
 
    ::


[32/50] git commit: Added TS-2459

Posted by zw...@apache.org.
Added TS-2459


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

Branch: refs/heads/5.0.x
Commit: a407f5f98142e7ddcbff79f8d7a254e50c2447ed
Parents: a19a444
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Dec 31 11:28:25 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 11:28:25 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a407f5f9/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 96b7ba8..a799472 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2459] Fix wrong name for a couple of librecord APIs.
+    Author: Yu Qing <ha...@yahoo.com.cn>.
+
   *) [TS-2463] Crash regression around slow-log feature, when logging an
    event. This fixes commit c290ce0df2a.
 


[46/50] git commit: Added TS-1365 to CHANGES, fixed default config value in docs

Posted by zw...@apache.org.
Added TS-1365 to CHANGES, fixed default config value in docs


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

Branch: refs/heads/5.0.x
Commit: f78c83a82d6eb6f2bfc23fc86ceb430121548049
Parents: 037d8cc
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 2 15:33:47 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 2 15:33:47 2014 -0700

----------------------------------------------------------------------
 CHANGES                                           | 6 ++++++
 doc/reference/configuration/records.config.en.rst | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f78c83a8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 6d01fca..7e4ae1e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-1365] Add a new configuration option, proxy.config.net.poll_timeout,
+   with the same behavior as the command line option --poll_timeout. Also
+   adjust AIO scheduling to correlate to this setting, to avoid additional
+   CPU load. Note that this configuration is generally not necessary to
+   configure, unless you are concerned with system idle CPU consumption.
+
   *) [TS-2468] Bring back the load balancer plugin.
 
   *) [TS-2465] libxml2 detection generates an invalid linker path.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f78c83a8/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 08aaf1a..79e4975 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2225,7 +2225,7 @@ Sockets
 
    Same as the command line option ``--accept_mss`` that sets the MSS for all incoming requests.
 
-.. ts:cv:: CONFIG proxy.config.net.poll_timeout INT 0
+.. ts:cv:: CONFIG proxy.config.net.poll_timeout INT 10 (or 30 on Solaris)
 
    Same as the command line option ``--poll_timeout``, or ``-t``, which
    specifies the timeout used for the polling mechanism used. This timeout is


[18/50] git commit: Fix unused variable warnings from malloc_from_chunk()

Posted by zw...@apache.org.
Fix unused variable warnings from malloc_from_chunk()

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/a4778175
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a4778175
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a4778175

Branch: refs/heads/5.0.x
Commit: a47781759e9c52e7e304d30ddfefae853b35a05f
Parents: 6f810cd
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Sat Dec 28 16:11:10 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Sat Dec 28 16:24:02 2013 +0800

----------------------------------------------------------------------
 lib/ts/ink_queue_ext.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a4778175/lib/ts/ink_queue_ext.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_queue_ext.cc b/lib/ts/ink_queue_ext.cc
index aff1eb4..b34ecc8 100644
--- a/lib/ts/ink_queue_ext.cc
+++ b/lib/ts/ink_queue_ext.cc
@@ -389,7 +389,8 @@ malloc_whole_chunk(InkFreeList *f, InkThreadCache *pCache, InkChunkInfo *pChunk)
 }
 
 static inline void *
-malloc_from_chunk(InkFreeList *f, InkThreadCache *pCache, InkChunkInfo *pChunk)
+malloc_from_chunk(InkFreeList * /* f ATS_UNUSED */,
+                  InkThreadCache *pCache, InkChunkInfo *pChunk)
 {
   void *item;
 


[10/50] git commit: TS-2452: Can't access a deleted object

Posted by zw...@apache.org.
TS-2452: Can't access a deleted object

It's an obvious bug, blame me:(.

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/fb60e203
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fb60e203
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fb60e203

Branch: refs/heads/5.0.x
Commit: fb60e203baffad9aa18c9dec5dc335034052b842
Parents: 9da35d2
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Wed Dec 25 22:36:49 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Wed Dec 25 22:49:25 2013 +0800

----------------------------------------------------------------------
 CHANGES                    | 2 ++
 proxy/logging/LogObject.cc | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fb60e203/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index eb361c0..e600391 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2452] Can't access a deleted object.
+
   *) [TS-2363] Fix assertion of "Unknown file format type!".
 
   *) [TS-2448] Fix traffic_cop and traffic_manager to obey the proxy.config.local_state_dir setting.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fb60e203/proxy/logging/LogObject.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc
index 4869448..8790948 100644
--- a/proxy/logging/LogObject.cc
+++ b/proxy/logging/LogObject.cc
@@ -48,12 +48,12 @@ LogBufferManager::preproc_buffers(LogBufferSink *sink) {
       // Still has outstanding references.
       write_list.push(b);
     } else if (_num_flush_buffers > FLUSH_ARRAY_SIZE) {
-      delete b;
       ink_atomic_increment(&_num_flush_buffers, -1);
       Warning("Dropping log buffer, can't keep up.");
       RecIncrRawStat(log_rsb, this_thread()->mutex->thread_holding,
                      log_stat_bytes_lost_before_preproc_stat,
                      b->header()->byte_count);
+      delete b;
     } else {
       new_q.push(b);
     }


[08/50] git commit: TS-2363: Fix assertion of "Unknown file format type!"

Posted by zw...@apache.org.
TS-2363: Fix assertion of "Unknown file format type!"

What leading to this assertion is that LogFile object passed to
flush thread has been destroyed within Log::periodic_tasks()
when accessing it.

This patch introduces refcount for LogFile object to avoid been
destroyed untimely.

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/9410b755
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9410b755
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9410b755

Branch: refs/heads/5.0.x
Commit: 9410b755e99322fa81ed24212b0c7902cb153e47
Parents: 3421c6e
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Sun Dec 22 14:29:46 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Sun Dec 22 18:01:39 2013 +0800

----------------------------------------------------------------------
 CHANGES                    | 2 ++
 proxy/logging/Log.h        | 2 +-
 proxy/logging/LogFile.h    | 2 +-
 proxy/logging/LogHost.cc   | 3 +--
 proxy/logging/LogHost.h    | 2 +-
 proxy/logging/LogObject.cc | 8 ++------
 proxy/logging/LogObject.h  | 2 +-
 7 files changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9410b755/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index d5d4fc7..eb361c0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2363] Fix assertion of "Unknown file format type!".
+
   *) [TS-2448] Fix traffic_cop and traffic_manager to obey the proxy.config.local_state_dir setting.
 
   *) [TS-2445] Fix problem with 204 responses closing POST requests

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9410b755/proxy/logging/Log.h
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.h b/proxy/logging/Log.h
index a646275..92c4525 100644
--- a/proxy/logging/Log.h
+++ b/proxy/logging/Log.h
@@ -316,7 +316,7 @@ class LogFlushData
 {
 public:
   LINK(LogFlushData, link);
-  LogFile *m_logfile;
+  Ptr<LogFile> m_logfile;
   LogBuffer *logbuffer;
   void *m_data;
   int m_len;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9410b755/proxy/logging/LogFile.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFile.h b/proxy/logging/LogFile.h
index 1995ee7..1f8c275 100644
--- a/proxy/logging/LogFile.h
+++ b/proxy/logging/LogFile.h
@@ -122,7 +122,7 @@ public:
   LogFile
   -------------------------------------------------------------------------*/
 
-class LogFile:public LogBufferSink
+class LogFile:public LogBufferSink, public RefCountObj
 {
 public:
   LogFile(const char *name, const char *header, LogFileFormat format, uint64_t signature,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9410b755/proxy/logging/LogHost.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogHost.cc b/proxy/logging/LogHost.cc
index c764f77..89647aa 100644
--- a/proxy/logging/LogHost.cc
+++ b/proxy/logging/LogHost.cc
@@ -335,7 +335,7 @@ LogHost::clear()
 
   ats_free(m_name);
   delete m_sock;
-  delete m_orphan_file;
+  m_orphan_file.clear();
 
   ink_zero(m_ip);
   m_port = 0;
@@ -344,7 +344,6 @@ LogHost::clear()
   m_sock = NULL;
   m_sock_fd = -1;
   m_connected = false;
-  m_orphan_file = NULL;
 }
 
 bool LogHost::authenticated()

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9410b755/proxy/logging/LogHost.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogHost.h b/proxy/logging/LogHost.h
index cc7cc6d..8442656 100644
--- a/proxy/logging/LogHost.h
+++ b/proxy/logging/LogHost.h
@@ -87,7 +87,7 @@ private:
   LogSock *m_sock;
   int m_sock_fd;
   bool m_connected;
-  LogFile *m_orphan_file;
+  Ptr<LogFile> m_orphan_file;
   LogCollationClientSM *m_log_collation_client_sm;
 
 public:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9410b755/proxy/logging/LogObject.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc
index 5109469..4869448 100644
--- a/proxy/logging/LogObject.cc
+++ b/proxy/logging/LogObject.cc
@@ -184,7 +184,6 @@ LogObject::~LogObject()
       m_host_list.clear();
     }
   }
-  delete m_logFile;
   ats_free(m_basename);
   ats_free(m_filename);
   ats_free(m_alt_filename);
@@ -311,12 +310,9 @@ LogObject::add_loghost(LogHost * host, bool copy)
 
   // A LogObject either writes to a file, or sends to a collation host, but
   // not both. By default, it writes to a file. If a LogHost is specified,
-  // then delete the LogFile object
+  // then clear the intelligent Ptr containing LogFile.
   //
-  if (m_logFile) {
-    delete m_logFile;
-    m_logFile = NULL;
-  }
+  m_logFile.clear();
 }
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9410b755/proxy/logging/LogObject.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.h b/proxy/logging/LogObject.h
index 06bf4c9..1c67082 100644
--- a/proxy/logging/LogObject.h
+++ b/proxy/logging/LogObject.h
@@ -203,7 +203,7 @@ public:
 public:
   bool m_auto_created;
   LogFormat * m_format;
-  LogFile *m_logFile;
+  Ptr<LogFile> m_logFile;
   LogFilterList m_filter_list;
   LogHostList m_host_list;
 


[11/50] git commit: Fix sockaddr length member detection

Posted by zw...@apache.org.
Fix sockaddr length member detection


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

Branch: refs/heads/5.0.x
Commit: f4dcd6dce16ee7b07a7c039c6b8f345117ab1c2f
Parents: fb60e20
Author: James Peach <jp...@apache.org>
Authored: Wed Dec 25 13:25:38 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Wed Dec 25 13:25:38 2013 -0800

----------------------------------------------------------------------
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f4dcd6dc/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index c16f89f..5581625 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1653,17 +1653,17 @@ AC_CHECK_MEMBER([struct sockaddr.sa_len], [], [], [#include <netinet/in.h>])
 AC_CHECK_MEMBER([struct sockaddr_in.sin_len], [], [], [#include <netinet/in.h>])
 AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len], [], [], [#include <netinet/in.h>])
 
-if test "x${ac_cv_member_sockaddr_sa_len}" = xyes; then
+if test "x${ac_cv_member_struct_sockaddr_sa_len}" = xyes; then
     AC_DEFINE(HAVE_STRUCT_SOCKADDR_SA_LEN, 1,
 	    [Whether struct sockaddr_in has the sa_len member])
 fi
 
-if test "x${ac_cv_member_sockaddr_in_sin_len}" = xyes ; then
+if test "x${ac_cv_member_struct_sockaddr_in_sin_len}" = xyes ; then
 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN, 1,
 	    [Whether struct sockaddr_in has the sin_len member])
 fi
 
-if test "x${ac_cv_member_sockaddr_in6_sin6_len}" = xyes; then
+if test "x${ac_cv_member_struct_sockaddr_in6_sin6_len}" = xyes; then
     AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN, 1,
 	    [Whether struct sockaddr_in6 has the sin6_len member])
 fi


[50/50] git commit: Merge branch 'master' into 5.0.x

Posted by zw...@apache.org.
Merge branch '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/a44a12ab
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a44a12ab
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a44a12ab

Branch: refs/heads/5.0.x
Commit: a44a12ab390ccef595aec435c663136571cf78ca
Parents: 93e7027 17f0102
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 3 10:17:16 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 3 10:17:16 2014 -0700

----------------------------------------------------------------------
 CHANGES                                         | 150 +++++--
 build/xml.m4                                    |   2 +-
 ci/tsqa/functions                               | 244 ++++++++++
 ci/tsqa/test-bootstrap                          |  41 ++
 ci/tsqa/test-log-configuration                  |  63 +++
 cmd/traffic_cop/traffic_cop.cc                  |  62 +--
 cmd/traffic_shell/traffic_shell.cc              |   2 +
 configure.ac                                    |  10 +-
 doc/admin/configuring-cache.en.rst              |  10 +-
 doc/admin/faqs.en.rst                           |   2 +-
 doc/admin/reverse-proxy-http-redirects.en.rst   |   2 +-
 doc/admin/security-options.en.rst               |   4 +-
 doc/arch/cache/cache-arch.en.rst                | 148 +++---
 doc/arch/cache/ram-cache.en.rst                 |  88 ++++
 doc/glossary.en.rst                             |  42 +-
 doc/reference/commands/traffic_server.en.rst    |   2 +-
 doc/reference/commands/traffic_top.en.rst       |   4 +-
 doc/reference/configuration/cache.config.en.rst |  38 +-
 .../configuration/congestion.config.en.rst      |   2 +-
 .../configuration/logs_xml.config.en.rst        |  16 +-
 .../configuration/plugin.config.en.rst          |  54 ++-
 .../configuration/records.config.en.rst         |  85 +++-
 doc/reference/configuration/remap.config.en.rst |  88 +++-
 .../configuration/ssl_multicert.config.en.rst   |   2 +-
 .../configuration/storage.config.en.rst         |   2 +-
 doc/reference/plugins/balancer.en.rst           | 117 +++--
 doc/reference/plugins/buffer_upload.en.rst      |  93 ++--
 doc/reference/plugins/cacheurl.en.rst           |   3 +-
 doc/reference/plugins/combo_handler.en.rst      |   5 +-
 doc/reference/plugins/gzip.en.rst               |   3 +-
 doc/reference/plugins/header_filter.en.rst      |   3 +-
 doc/reference/plugins/header_rewrite.en.rst     | 174 ++++++++
 doc/reference/plugins/hipes.en.rst              |  74 ++-
 doc/reference/plugins/index.en.rst              |   1 -
 doc/reference/plugins/ts_lua.en.rst             |   3 +-
 ...viewing-statistics-using-traffic-line.en.rst |   2 +-
 doc/sdk/mutex-guide.en.rst                      |   2 +-
 example/protocol/Protocol.c                     |  12 +-
 iocore/aio/AIO.cc                               |   6 +-
 iocore/aio/test_AIO.cc                          |   8 +
 iocore/eventsystem/I_SocketManager.h            |   3 +-
 iocore/net/I_Net.h                              |   8 -
 iocore/net/Net.cc                               |   2 +-
 iocore/net/P_Connection.h                       |   1 +
 iocore/net/P_SSLUtils.h                         |   9 +
 iocore/net/P_UnixPollDescriptor.h               |   4 +
 iocore/net/SSLConfig.cc                         |   6 +
 iocore/net/SSLUtils.cc                          |  21 +-
 iocore/net/UnixConnection.cc                    |  10 +-
 iocore/net/UnixNet.cc                           |   7 +-
 iocore/net/UnixUDPNet.cc                        |   6 +-
 lib/atscppapi/src/include/atscppapi/Headers.h   |   2 +-
 lib/records/I_RecCore.h                         |   8 +-
 lib/records/RecCore.cc                          |   7 +-
 lib/records/RecMessage.cc                       |   3 +-
 lib/ts/ink_atomic.h                             |  39 +-
 lib/ts/ink_inet.cc                              |   2 +-
 lib/ts/ink_queue_ext.cc                         |   5 +-
 mgmt/LocalManager.cc                            |   3 +-
 mgmt/Main.cc                                    |   5 +-
 mgmt/RecordsConfig.cc                           |  12 +
 mgmt/api/CoreAPIRemote.cc                       |   2 +
 plugins/experimental/Makefile.am                |   2 +
 plugins/experimental/balancer/Makefile.am       |  22 +
 plugins/experimental/balancer/README            |  93 ----
 plugins/experimental/balancer/balancer.cc       | 446 ++++---------------
 plugins/experimental/balancer/balancer.h        |  46 ++
 plugins/experimental/balancer/hash.cc           | 207 +++++++++
 plugins/experimental/balancer/hashkey.h         | 254 -----------
 plugins/experimental/balancer/resources.h       | 111 -----
 plugins/experimental/balancer/roundrobin.cc     |  72 +++
 plugins/experimental/hipes/Makefile.am          |  22 +
 plugins/experimental/hipes/hipes.cc             | 285 ++++++------
 plugins/experimental/ts_lua/Makefile.am         |   2 +-
 .../experimental/ts_lua/ts_lua_client_request.c |  45 +-
 plugins/experimental/ts_lua/ts_lua_remap.c      |  67 +++
 plugins/experimental/ts_lua/ts_lua_remap.h      |  28 ++
 plugins/experimental/ts_lua/ts_lua_util.c       |   3 +
 proxy/ICP.cc                                    |  22 +-
 proxy/ICP.h                                     |   1 +
 proxy/ICPConfig.cc                              |   7 +
 proxy/InkAPI.cc                                 |   6 +-
 proxy/Main.cc                                   |  22 +-
 proxy/Main.h                                    |   1 -
 proxy/Plugin.cc                                 |  14 +-
 proxy/hdrs/HTTP.cc                              |   9 +-
 proxy/http/HttpSM.cc                            |   6 +-
 proxy/http/HttpTransact.cc                      |  30 +-
 proxy/http/HttpTransactHeaders.cc               |  70 ---
 proxy/http/HttpTransactHeaders.h                |   6 -
 proxy/http/HttpTunnel.cc                        |   5 +-
 proxy/logging/Log.h                             |   2 +-
 proxy/logging/LogFile.h                         |   2 +-
 proxy/logging/LogHost.cc                        |   3 +-
 proxy/logging/LogHost.h                         |   2 +-
 proxy/logging/LogObject.cc                      |  10 +-
 proxy/logging/LogObject.h                       |   2 +-
 proxy/logging/LogStandalone.cc                  |  14 +-
 tools/tsxs.in                                   |   5 +
 99 files changed, 2301 insertions(+), 1477 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a44a12ab/CHANGES
----------------------------------------------------------------------
diff --cc CHANGES
index c6dfb60,2a0771c..75890e1
--- a/CHANGES
+++ b/CHANGES
@@@ -1,12 -1,65 +1,70 @@@
                                                           -*- coding: utf-8 -*-
 -Changes with Apache Traffic Server 4.2.0
 +Changes with Apache Traffic Server 5.0.0
 +
 +  *) [TS-1919] Eliminate CacheLookupHttpConfig. This breaks cluster
 +   compatibility, so all cluster nodes should be upgraded simultaneously.
  
+   *) [TS-2467] traffic_shell doesn't work with tcl 8.6.
+    Author: Ben Aitchison <be...@meh.net.nz>
+ 
+   *) [TS-1365] Add a new configuration option, proxy.config.net.poll_timeout,
+    with the same behavior as the command line option --poll_timeout. Also
+    adjust AIO scheduling to correlate to this setting, to avoid additional
+    CPU load. Note that this configuration is generally not necessary to
+    configure, unless you are concerned with system idle CPU consumption.
+ 
+   *) [TS-2468] Bring back the load balancer plugin.
+ 
+   *) [TS-2465] libxml2 detection generates an invalid linker path.
+    Author: Radim Kolar <hs...@sendmail.cz>
+ 
+   *) [TS-2271] Threaded plugin support with 3rd party libraries.
+    Author: Heikki Hannikainen <he...@hes.iki.fi>
+ 
+   *) [TS-2464] Remove useless and buggy connection header handling
+ 
+   *) [TS-2457] Protocol.c: change usage of atoi to strtol.
+    Author: Radim Kolar <hs...@sendmail.cz>
+ 
+   *) [TS-2459] Fix wrong name for a couple of librecord APIs.
+     Author: Yu Qing <ha...@yahoo.com.cn>
+ 
+   *) [TS-2463] Crash regression around slow-log feature, when logging an
+    event. This fixes commit c290ce0df2a.
+ 
+   *) [TS-32] Fix ICP. Author: Gota Adachi <ad...@iij.ad.jp>
+ 
+   *) [TS-2248] Segmentation fault in HttpTunnel with flow control.
+    Author: bettydramit <b1...@gmail.com>
+ 
+   *) [TS-2454] Fix undefined reference to `__sync_fetch_and_sub_8' on ARM
+    32bit system.
+ 
+   *) [TS-2450] Fix assertion failure for T61String type.
+ 
+   *) [TS-2117] make hipes plugin build.
+ 
+   *) [TS-2452] Can't access a deleted object.
+ 
+   *) [TS-2363] Fix assertion of "Unknown file format type!".
+ 
+   *) [TS-2448] Fix traffic_cop and traffic_manager to obey the
+    proxy.config.local_state_dir setting.
+ 
+   *) [TS-2445] Fix problem with 204 responses closing POST requests.
+ 
+   *) [TS-2434] Use the FATAL error level to handle plugin errors.
+ 
+   *) [TS-2203] Clarify syslog startup messages for standalone log programs.
+ 
+   *) [TS-2436] Add a simple integration test harness.
+ 
+   *) [TS-2355] ATS 4.0.x crashes when using OpenSSL 1.0.1e.
+ 
+   *) [TS-2432] Fix a race in aio_err_callblk.
  
 +Changes with Apache Traffic Server 4.2.0
 +
    *) [TS-2251] Simplify LogBuffer reference counting.
  
    *) [TS-2190] Remove cache.log from the cachurl plugin.

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

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


[16/50] git commit: TS-2117: update CHANGES for making hipes plugin build

Posted by zw...@apache.org.
TS-2117: update CHANGES for making hipes plugin build


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

Branch: refs/heads/5.0.x
Commit: 6413af54eeaa9ccee093fad22ab51259df94971f
Parents: cc46db7
Author: Kit Chan <ki...@apache.org>
Authored: Thu Dec 26 16:51:35 2013 -0800
Committer: Kit Chan <ki...@apache.org>
Committed: Thu Dec 26 16:51:35 2013 -0800

----------------------------------------------------------------------
 CHANGES | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6413af54/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index e600391..2d3cb33 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2117] make hipes plugin build
+
   *) [TS-2452] Can't access a deleted object.
 
   *) [TS-2363] Fix assertion of "Unknown file format type!".


[30/50] git commit: TS-2463] Crash regression around slow-log feature

Posted by zw...@apache.org.
TS-2463] Crash regression around slow-log feature

This happens when logging a slow event, and fixes commit c290ce0df2a.


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

Branch: refs/heads/5.0.x
Commit: 5cc64bf4552f331d115ce595f8f28202fb4c455e
Parents: 1018957
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Dec 31 11:01:39 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 11:01:39 2013 -0700

----------------------------------------------------------------------
 CHANGES              | 6 ++++--
 proxy/hdrs/HTTP.cc   | 9 +++++++--
 proxy/http/HttpSM.cc | 4 +++-
 3 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5cc64bf4/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 168a087..96b7ba8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
-  *) [TS-32] Fix ICP.
-   Author: Gota Adachi <ad...@iij.ad.jp>
+  *) [TS-2463] Crash regression around slow-log feature, when logging an
+   event. This fixes commit c290ce0df2a.
+
+  *) [TS-32] Fix ICP. Author: Gota Adachi <ad...@iij.ad.jp>
 
   *) [TS-2248] Segmentation fault in HttpTunnel with flow control.
    Author: bettydramit <b1...@gmail.com>.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5cc64bf4/proxy/hdrs/HTTP.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/HTTP.cc b/proxy/hdrs/HTTP.cc
index 6ecaf35..b9b8dc6 100644
--- a/proxy/hdrs/HTTP.cc
+++ b/proxy/hdrs/HTTP.cc
@@ -1576,7 +1576,8 @@ class UrlPrintHack {
 };
 
 char*
-HTTPHdr::url_string_get(Arena* arena, int* length) {
+HTTPHdr::url_string_get(Arena* arena, int* length)
+{
   char* zret = 0;
   UrlPrintHack hack(this);
 
@@ -1594,7 +1595,11 @@ HTTPHdr::url_string_get(Arena* arena, int* length) {
 }
 
 int
-HTTPHdr::url_print(char* buff, int length, int* offset, int* skip) {
+HTTPHdr::url_print(char* buff, int length, int* offset, int* skip)
+{
+  ink_release_assert(offset);
+  ink_release_assert(skip);
+
   int zret = 0;
   UrlPrintHack hack(this);
   if (hack.is_valid()) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5cc64bf4/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index e224527..df9dac5 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -6596,8 +6596,10 @@ HttpSM::update_stats()
       ink_hrtime_from_msec(t_state.http_config_param->slow_log_threshold) < total_time) {
     URL* url = t_state.hdr_info.client_request.url_get();
     char url_string[256] = "";
+    int offset = 0;
+    int skip = 0;
 
-    t_state.hdr_info.client_request.url_print(url_string, sizeof url_string, 0, 0);
+    t_state.hdr_info.client_request.url_print(url_string, sizeof url_string, &offset, &skip);
 
     // unique id
     char unique_id_string[128] = "";


[12/50] git commit: TS-2117 make hipes plugin build

Posted by zw...@apache.org.
TS-2117 make hipes plugin build


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

Branch: refs/heads/5.0.x
Commit: e7a1b8ffb2b5f152e3f443a2932b1157a6d05975
Parents: f4dcd6d
Author: Kit Chan <ki...@apache.org>
Authored: Thu Dec 26 08:39:52 2013 -0800
Committer: Kit Chan <ki...@apache.org>
Committed: Thu Dec 26 08:39:52 2013 -0800

----------------------------------------------------------------------
 configure.ac                           |   1 +
 doc/reference/plugins/hipes.en.rst     |  64 ++++++-
 plugins/experimental/Makefile.am       |   1 +
 plugins/experimental/hipes/Makefile.am |  22 +++
 plugins/experimental/hipes/hipes.cc    | 285 +++++++++++++++-------------
 5 files changed, 239 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e7a1b8ff/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5581625..5d50b12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1928,6 +1928,7 @@ AC_CONFIG_FILES([
   plugins/experimental/esi/Makefile
   plugins/experimental/geoip_acl/Makefile
   plugins/experimental/lua/Makefile
+  plugins/experimental/hipes/Makefile
   plugins/experimental/ts_lua/Makefile
   plugins/experimental/metalink/Makefile
   plugins/experimental/rfc5861/Makefile

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e7a1b8ff/doc/reference/plugins/hipes.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/hipes.en.rst b/doc/reference/plugins/hipes.en.rst
index 2651c67..2d6daa5 100644
--- a/doc/reference/plugins/hipes.en.rst
+++ b/doc/reference/plugins/hipes.en.rst
@@ -1,5 +1,5 @@
-HIPES system (undocumented)
-***************************
+HIPES plugin
+************
 
 .. Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
@@ -19,14 +19,11 @@ HIPES system (undocumented)
   under the License.
 
 
-This plugin implements the HIPES system.
+This is a remap plugin used in the HIPES system.
 
 Configuration
 =============
 
-``server:<host>``
-    Name of the server to send this request to
-
 ``urlp:<name>``
     Default: ``url``
     Name of the query parameter for the service URL
@@ -59,6 +56,59 @@ Configuration
     The DNS timeout
 
 The timeout options override the server defaults (from
-```records.config`` <../../configuration-files/records.config>`_), and
+```records.config``), and
 only apply to the connection to the specific "service" host.
 
+Notes on HIPES
+==============
+
+HTTP Pipes (aka HIPES and pronounced "Hippies") allows data services to be pipelined together, as illustrated by the example below.
+
+Example
+=======
+1. ATS is run on port 80 and apache HTTP web server is run on port 8080
+
+2. The HIPES plugin is used in ``remap.config`` ::
+
+    map http://127.0.0.1/svc_case http://nosuchhost @plugin=hipes.so @pparam=service:127.0.0.1:8080 @pparam=path:svc_case.php @pparam=server:127.0.0.1
+    map http://127.0.0.1/svc_reverse http://nosuchhost @plugin=hipes.so @pparam=service:127.0.0.1:8080 @pparam=path:svc_reverse.php @pparam=server:127.0.0.1 
+    map http://127.0.0.1/test.txt http://127.0.0.1:8080/test.txt
+
+3. The plugin remaps the incoming URL such as 
+   
+    ``http://127.0.0.1/svc_reverse/svc_case;case=u/test.txt``  
+
+to the following
+ 
+    ``http://127.0.0.1:8080/svc_reverse?url=http%3A%2F%2F127.0.0.1%2Fsvc_case%3Bcase%3Du%2Ftest.txt``
+
+3. The service ``svc_reverse.php`` fetches the ``url`` from the ATS again and the plugin remaps the URL
+
+    ``http://127.0.0.1/svc_case;case=u/test.txt``
+
+to this URL 
+
+    ``http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt``
+
+4. In this example, the service ``svc_case.php`` fetches and transforms the response of ``http://127.0.0.1/test.txt`` (which ATS proxies the request to a local file) to upper case. And subsequently the service ``svc_reverse.php`` receives the response and reverse the order before the response is sent back to the client by ATS.
+
+Notes on reducing traffic 
+=========================
+
+There can be significant overhead using HIPES because the data can traverse through ATS many times. Caching can be important to reduce traffic to services/through ATS and can be achieved via a proper ``Cache-Control`` header returned by the services. Another way to reduce traffic through ATS is to have ATS to return 302 redirects to url for the requests made by service, instead of proxying the requests to that url. However, the service must then be able to follow the redirect. The down side is that we cannot use ATS to cache intermediate results. Below is an example of using redirect. 
+
+Modification to above example to reduce traffic using redirect
+==============================================================
+
+1. The service ``svc_reverse.php`` is modified to add a header of ``X-HIPES-Redirect: 2`` to the request made against ``url``.
+
+2. HIPES plugin will instruct ATS to return a redirect response to this url 
+
+    ``http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt``
+
+for the following request
+
+    ``http://127.0.0.1/svc_case;case=u/test.txt``
+
+3.  The service ``svc_reverse.php`` is also modified to follow the redirect. Thus the response of the service of ``svc_case`` will not pass through ATS and will pass to ``svc_reverse`` service instead. 
+

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e7a1b8ff/plugins/experimental/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/Makefile.am b/plugins/experimental/Makefile.am
index 3d5a453..7b4da79 100644
--- a/plugins/experimental/Makefile.am
+++ b/plugins/experimental/Makefile.am
@@ -25,6 +25,7 @@ SUBDIRS = \
  geoip_acl \
  healthchecks \
  lua \
+ hipes \
  metalink \
  remap_stats \
  rfc5861 \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e7a1b8ff/plugins/experimental/hipes/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/hipes/Makefile.am b/plugins/experimental/hipes/Makefile.am
new file mode 100644
index 0000000..650ce56
--- /dev/null
+++ b/plugins/experimental/hipes/Makefile.am
@@ -0,0 +1,22 @@
+#  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
+#
+#      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.
+
+include $(top_srcdir)/build/plugins.mk
+
+pkglib_LTLIBRARIES = hipes.la
+
+hipes_la_SOURCES = hipes.cc
+hipes_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e7a1b8ff/plugins/experimental/hipes/hipes.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/hipes/hipes.cc b/plugins/experimental/hipes/hipes.cc
index 76fcfa5..2f0cafa 100644
--- a/plugins/experimental/hipes/hipes.cc
+++ b/plugins/experimental/hipes/hipes.cc
@@ -24,12 +24,14 @@
 #include <stdlib.h>
 #include <string>
 
-#include <ts/remap.h>
 #include <ts/ts.h>
+#include <ts/remap.h>
 
 static const char* PLUGIN_NAME = "hipes";
 static const char* HIPES_SERVER_NAME = "hipes.example.com";
 
+static const int MAX_PATH_SIZE = 2048;
+static const int MAX_REDIRECT_URL = 2048;
 
 ///////////////////////////////////////////////////////////////////////////////
 // Escape a URL string.
@@ -158,11 +160,11 @@ struct HIPESService
 ///////////////////////////////////////////////////////////////////////////////
 // Initialize the plugin.
 //
-int
-TSRemapInit(TSREMAP_INTERFACE *api_info, char *errbuf, int errbuf_size)
+TSReturnCode
+TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
 {
   if (!api_info) {
-    strncpy(errbuf, "[tsremap_init] - Invalid TSREMAP_INTERFACE argument", errbuf_size - 1);
+    strncpy(errbuf, "[tsremap_init] - Invalid TSRemapInterface argument", errbuf_size - 1);
     return TS_ERROR;
   }
 
@@ -172,7 +174,7 @@ TSRemapInit(TSREMAP_INTERFACE *api_info, char *errbuf, int errbuf_size)
     return TS_ERROR;
   }
 
-  INKDebug("hipes", "plugin is successfully initialized");
+  TSDebug(PLUGIN_NAME, "plugin is successfully initialized");
   return TS_SUCCESS;
 }
 
@@ -180,16 +182,16 @@ TSRemapInit(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 ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
 {
-  HIPESService* ri = new HIPESService;
+  HIPESService* ri = new HIPESService();
 
-  *ih = static_cast<ihandle>(ri);
+  *ih = (void*)ri;
 
   if (ri == NULL) {
-    INKError("Unable to create remap instance");
-    return -5;
+    TSError("Unable to create remap instance");
+    return TS_ERROR;
   }
 
   for (int ix=2; ix < argc; ++ix) {
@@ -197,7 +199,7 @@ tsremap_new_instance(int argc, char *argv[], ihandle *ih, char *errbuf, int errb
     std::string::size_type sep = arg.find_first_of(":");
 
     if (sep == std::string::npos) {
-      INKError("Malformed options in url_remap: %s", argv[ix]);
+      TSError("Malformed options in url_remap: %s", argv[ix]);
     } else {
       std::string arg_val = arg.substr(sep + 1, std::string::npos);
 
@@ -238,16 +240,16 @@ tsremap_new_instance(int argc, char *argv[], ihandle *ih, char *errbuf, int errb
       } else if (arg.compare(0, 11, "dns_timeout") == 0) {
         ri->dns_timeout = atoi(arg_val.c_str());
       } else {
-        INKError("Unknown url_remap option: %s", argv[ix]);
+        TSError("Unknown url_remap option: %s", argv[ix]);
       }
     }
   }
 
-  return 0;
+  return TS_SUCCESS;
 }
 
 void
-tsremap_delete_instance(ihandle ih)
+TSRemapDeleteInstance(void* ih)
 {
   HIPESService* ri = static_cast<HIPESService*>(ih);
 
@@ -258,99 +260,118 @@ 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)
 {
   const char* slash;
   char* ptr;
-  HIPESService* h_conf = static_cast<HIPESService*>(ih);
+  HIPESService* h_conf = (HIPESService*)ih;
+
+  char new_query[MAX_PATH_SIZE];
+  int new_query_size;
+  char redirect_url[MAX_REDIRECT_URL];
+  int redirect_url_size;
 
   if (NULL == h_conf) {
-    INKDebug("hipes", "Falling back to default URL on URL remap without rules");
-    return 0;
+    TSDebug(PLUGIN_NAME, "Falling back to default URL on URL remap without rules");
+    return TSREMAP_NO_REMAP;
   }
 
+  int param_len = 0;
+  const char *param = TSUrlHttpParamsGet(rri->requestBufp, rri->requestUrl, &param_len);
+
   // Make sure we have a matrix parameter, anything without is a bogus request.
-  if (rri->request_matrix_size <= 0) {
-    INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_BAD_REQUEST);
-    return 0;
+  if (param_len <= 0) {
+    TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_BAD_REQUEST);
+    return TSREMAP_NO_REMAP;
   }
 
-  // Don't think this can/should happen, but safety first ...
-  if (rri->request_matrix_size > TSREMAP_RRI_MAX_PATH_SIZE) {
-    INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_REQUEST_URI_TOO_LONG);
-    return 0;
+  if(param_len > MAX_PATH_SIZE) {
+    TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG);
+    return TSREMAP_NO_REMAP;
   }
 
   // If there is a '/' in the matrix parameters, we know there are multiple service requests in
   // the incoming URL, so nibble off the first one, and pass the rest as a HIPES URL to the service.
-  if ((slash = static_cast<const char*>(memchr(rri->request_matrix, '/', rri->request_matrix_size)))) {
-    char svc_url[TSREMAP_RRI_MAX_PATH_SIZE + 1];
-    char svc_url_esc[TSREMAP_RRI_MAX_PATH_SIZE + 1];
+  if ((slash = static_cast<const char*>(memchr(param, '/', param_len)))) {
+    char svc_url[MAX_PATH_SIZE + 1];
+    char svc_url_esc[MAX_PATH_SIZE + 1];
     int len, query_len;
 
     // Create the escaped URL, which gets passed over to the service as a url= param.
-    len = 8 + h_conf->hipes_server.size() + (rri->request_matrix_size - (slash - rri->request_matrix) - 1);
-    if (len > TSREMAP_RRI_MAX_PATH_SIZE) {
-      INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_REQUEST_URI_TOO_LONG);
-      return 0;
+    char port[6];
+    snprintf(port, 6, ":%d", h_conf->hipes_port);
+
+    if(h_conf->hipes_port != 80) {
+      len = 8 + h_conf->hipes_server.size() + strlen(port) + (param_len - (slash - param) - 1);
+    } else {
+      len = 8 + h_conf->hipes_server.size() + (param_len - (slash - param) - 1);
+    } 
+    if (len > MAX_PATH_SIZE) {
+      TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG);
+      return TSREMAP_NO_REMAP;
+    }  
+    if(h_conf->hipes_port != 80) {
+      snprintf(svc_url, MAX_PATH_SIZE, "http://%s%s/%.*s", h_conf->hipes_server.c_str(), port, len, slash + 1);
+    } else {
+      snprintf(svc_url, MAX_PATH_SIZE, "http://%s/%.*s", h_conf->hipes_server.c_str(), len, slash + 1);
     }
-    snprintf(svc_url, TSREMAP_RRI_MAX_PATH_SIZE, "http://%s/%.*s", h_conf->hipes_server.c_str(), len, slash + 1);
-    INKDebug("hipes", "Service URL is %s", svc_url);
+    TSDebug(PLUGIN_NAME, "Service URL is %s", svc_url);
 
-    len = escapify_url(svc_url, len, svc_url_esc, TSREMAP_RRI_MAX_PATH_SIZE);
+    len = escapify_url(svc_url, len, svc_url_esc, MAX_PATH_SIZE);
     if (len < 0) {
-      return 0;
+      TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_BAD_REQUEST); 
+      return TSREMAP_NO_REMAP;
     }
-    INKDebug("hipes", "Escaped service URL is %s(%d)", svc_url_esc, len);
+    TSDebug(PLUGIN_NAME, "Escaped service URL is %s(%d)", svc_url_esc, len);
 
     // Prepare the new query arguments, make sure it fits
-    if (( (slash - rri->request_matrix) + 2 + h_conf->url_param.size() + len) > TSREMAP_RRI_MAX_PATH_SIZE) {
-      INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_REQUEST_URI_TOO_LONG);
-      return 0;
+    if (( (slash - param) + 2 + h_conf->url_param.size() + len) > MAX_PATH_SIZE) {
+      TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG);
+      return TSREMAP_NO_REMAP;
     }
 
-    query_len = (slash - rri->request_matrix);
-    memcpy(rri->new_query, rri->request_matrix, query_len);
-    ptr = rri->new_query;
-    while ((ptr = static_cast<char*>(memchr(ptr, ';', (rri->new_query + query_len) - ptr))))
+    query_len = (slash - param);
+    memcpy(new_query, param, query_len);
+    ptr = new_query;
+    while ((ptr = static_cast<char*>(memchr(ptr, ';', (new_query + query_len) - ptr))))
       *ptr = '&';
 
-    rri->new_query[query_len++] = '&';
-    memcpy(rri->new_query + query_len, h_conf->url_param.c_str(), h_conf->url_param.size());
+    new_query[query_len++] = '&';
+    memcpy(new_query + query_len, h_conf->url_param.c_str(), h_conf->url_param.size());
     query_len += h_conf->url_param.size();
-    rri->new_query[query_len++] = '=';
+    new_query[query_len++] = '=';
 
-    memcpy(rri->new_query + query_len, svc_url_esc, len);
-    rri->new_query_size = query_len + len;
-    INKDebug("hipes", "New query is %.*s(%d)", rri->new_query_size, rri->new_query, rri->new_query_size);
+    memcpy(new_query + query_len, svc_url_esc, len);
+    new_query_size = query_len + len;
+    TSDebug(PLUGIN_NAME, "New query is %.*s(%d)", new_query_size, new_query, new_query_size);
   } else {
     // This is the "final" step in this HIPES URL, so don't point back to HIPES (or we'll never leave)
-    rri->new_query_size = rri->request_matrix_size;
-    memcpy(rri->new_query, rri->request_matrix, rri->request_matrix_size);
-    ptr = rri->new_query;
-    while ((ptr = static_cast<char*>(memchr(ptr, ';', (rri->new_query + rri->new_query_size) - ptr))))
+    new_query_size = param_len;
+    memcpy(new_query, param, param_len);
+    ptr = new_query;
+    while ((ptr = static_cast<char*>(memchr(ptr, ';', (new_query + new_query_size) - ptr))))
       *ptr = '&';
 
-    INKDebug("hipes", "New query is %.*s(%d)", rri->new_query_size, rri->new_query, rri->new_query_size);
+    TSDebug(PLUGIN_NAME, "New query is %.*s(%d)", new_query_size, new_query, new_query_size);
   }
 
   // Test if we should redirect or not
   bool do_redirect = false;
   int redirect_flag = h_conf->default_redirect_flag;
-  char* pos = rri->new_query;
+  char* pos = new_query;
 
-  while (pos && (pos = (char*)memchr(pos, '_', rri->new_query_size - (pos - rri->new_query)))) {
+  while (pos && (pos = (char*)memchr(pos, '_', new_query_size - (pos - new_query)))) {
     if (pos) {
       ++pos;
-      if ((rri->new_query_size - (pos - rri->new_query)) < 10) { // redirect=n
+      if ((new_query_size - (pos - new_query)) < 10) { // redirect=n
         pos = NULL;
       } else {
         if ((*pos == 'r') && (!strncmp(pos, "redirect=", 9))) {
           redirect_flag = *(pos + 9) - '0';
           if ((redirect_flag < 0) || (redirect_flag > 2))
             redirect_flag = h_conf->default_redirect_flag;
-          INKDebug("hipes", "Found _redirect flag in URL: %d\n", redirect_flag);
+          TSDebug(PLUGIN_NAME, "Found _redirect flag in URL: %d\n", redirect_flag);
           pos = NULL;
         }
       }
@@ -359,50 +380,57 @@ tsremap_remap(ihandle ih, rhandle rh, REMAP_REQUEST_INFO *rri)
 
   if (redirect_flag > 0) {
     // Now check the incoming request header, and match up.
-    INKMBuffer bufp;
-    INKMLoc hdr_loc, field_loc;
+    TSMBuffer bufp;
+    TSMLoc hdr_loc, field_loc;
     bool has_error = false;
 
-    if (INKHttpTxnClientReqGet((INKHttpTxn)rh, &bufp, &hdr_loc)) {
-      field_loc = INKMimeHdrFieldFind(bufp, hdr_loc, h_conf->x_hipes_header.c_str(), h_conf->x_hipes_header.size());
+    if (TSHttpTxnClientReqGet(rh, &bufp, &hdr_loc) == TS_SUCCESS) {
+      field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, h_conf->x_hipes_header.c_str(), h_conf->x_hipes_header.size());
       if (field_loc) {
         int hdr_flag;
 
-        if (INKMimeHdrFieldValueIntGet(bufp, hdr_loc, field_loc, 0, &hdr_flag) == INK_SUCCESS) {
-          // Alright, now match up this header flag with the request (or default) flag
-          INKDebug("hipes", "Extracted %s header with value %d", h_conf->x_hipes_header.c_str(), hdr_flag);
-          switch (redirect_flag) {
-          case 0:
-            if (hdr_flag == 2) {
-              INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_BAD_REQUEST);
-              has_error = true;
-            } // Everything else is a "no"
-            break;
-          case 1:
-            if (hdr_flag == 2) {
-              do_redirect = true;
-            } // Everything else is a "no"
-            break;
-          case 2:
-            if (hdr_flag == 2) {
-              do_redirect = true;
-            } else {
-              INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_BAD_REQUEST);
-              has_error = true;
-            }
-            break;
-          default:
-            INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_BAD_REQUEST);
+        hdr_flag = TSMimeHdrFieldValueIntGet(bufp, hdr_loc, field_loc, 0);
+        // Alright, now match up this header flag with the request (or default) flag
+        TSDebug(PLUGIN_NAME, "Extracted %s header with value %d", h_conf->x_hipes_header.c_str(), hdr_flag);
+        switch (redirect_flag) {
+        case 0:
+          if (hdr_flag == 2) {
+            TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_BAD_REQUEST);
+            has_error = true;
+          } // Everything else is a "no"
+          break;
+        case 1:
+          if (hdr_flag == 2) {
+            do_redirect = true;
+          } // Everything else is a "no"
+          break;
+        case 2:
+          if (hdr_flag == 2) {
+            do_redirect = true;
+          } else {
+            TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_BAD_REQUEST);
             has_error = true;
-            break;
           }
+          break;
+        default:
+          TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_BAD_REQUEST);
+          has_error = true;
+          break;
+        }
+        TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+      } else {
+        if(redirect_flag == 2) {
+          TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_BAD_REQUEST);
+          has_error=true;
         }
-        INKHandleMLocRelease(bufp, hdr_loc, field_loc);
       }
-      INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+      TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+    } else {
+      TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_BAD_REQUEST);
+      has_error=true;
     }
     if (has_error)
-      return 1;
+      return TSREMAP_NO_REMAP;
   }
 
   // If we redirect, just generate a 302 URL, otherwise update the RRI struct properly.
@@ -411,19 +439,19 @@ tsremap_remap(ihandle ih, rhandle rh, REMAP_REQUEST_INFO *rri)
 
     if (h_conf->ssl) {
       // https://<host>:<port>/<path>?<query?\0
-      len = 5 + 3 + h_conf->svc_server.size() + 6 + 1 + h_conf->path.size() + 1 + rri->new_query_size + 1;
+      len = 5 + 3 + h_conf->svc_server.size() + 6 + 1 + h_conf->path.size() + 1 + new_query_size + 1;
     } else {
       // http://<host>:<port>/<path>?<query?\0
-      len = 4 + 3 + h_conf->svc_server.size() + 6 + 1 + h_conf->path.size() + 1 + rri->new_query_size + 1;
+      len = 4 + 3 + h_conf->svc_server.size() + 6 + 1 + h_conf->path.size() + 1 + new_query_size + 1;
     }
 
-    if (len > TSREMAP_RRI_MAX_REDIRECT_URL) {
-      INKError("Redirect in HIPES URL too long");
-      INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, (INKHttpStatus)414);
+    if (len > MAX_REDIRECT_URL) {
+      TSError("Redirect in HIPES URL too long");
+      TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG);
     } else {
       int port = -1;
 
-      pos = rri->redirect_url;
+      pos = redirect_url;
 
       // HTTP vs HTTPS
       if (h_conf->ssl) {
@@ -454,64 +482,67 @@ tsremap_remap(ihandle ih, rhandle rh, REMAP_REQUEST_INFO *rri)
       }
 
       // Query
-      if (rri->new_query_size > 0) {
+      if (new_query_size > 0) {
         *(pos++) = '?';
-        memcpy(pos, rri->new_query, rri->new_query_size);
-        pos += rri->new_query_size;
+        memcpy(pos, new_query, new_query_size);
+        pos += new_query_size;
       }
 
       // NULL terminate the URL.
       *pos = '\0';
 
-      rri->redirect_url_size = pos - rri->redirect_url + 1;
-      INKDebug("hipes", "Redirecting to %.*s", rri->redirect_url_size, rri->redirect_url);
-      *(rri->new_query) = '\0';
-      rri->new_query_size = 0;
-      INKHttpTxnSetHttpRetStatus((INKHttpTxn)rh, INK_HTTP_STATUS_MOVED_TEMPORARILY);
+      redirect_url_size = pos - redirect_url + 1;
+      TSDebug(PLUGIN_NAME, "Redirecting to %.*s", redirect_url_size, redirect_url);
+      const char *start = redirect_url; 
+      const char *end = start + redirect_url_size;
+      rri->redirect = 1;
+      TSUrlParse(rri->requestBufp, rri->requestUrl, &start, end);  
+      TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_MOVED_TEMPORARILY);
     }
   } else { // Not a redirect, so proceed normally
     // Set timeouts (if requested)
     if (h_conf->active_timeout > -1) {
-      INKDebug("hipes", "Setting active timeout to %d", h_conf->active_timeout);
-      INKHttpTxnActiveTimeoutSet((INKHttpTxn)rh, h_conf->active_timeout);
+      TSDebug(PLUGIN_NAME, "Setting active timeout to %d", h_conf->active_timeout);
+      TSHttpTxnActiveTimeoutSet(rh, h_conf->active_timeout);
     }
     if (h_conf->no_activity_timeout > -1) {
-      INKDebug("hipes", "Setting no activity timeout to %d", h_conf->no_activity_timeout);
-      INKHttpTxnNoActivityTimeoutSet((INKHttpTxn)rh, h_conf->no_activity_timeout);
+      TSDebug(PLUGIN_NAME, "Setting no activity timeout to %d", h_conf->no_activity_timeout);
+      TSHttpTxnNoActivityTimeoutSet(rh, h_conf->no_activity_timeout);
     }
     if (h_conf->connect_timeout > -1) {
-      INKDebug("hipes", "Setting connect timeout to %d", h_conf->connect_timeout);
-      INKHttpTxnConnectTimeoutSet((INKHttpTxn)rh, h_conf->connect_timeout);
+      TSDebug(PLUGIN_NAME, "Setting connect timeout to %d", h_conf->connect_timeout);
+      TSHttpTxnConnectTimeoutSet(rh, h_conf->connect_timeout);
     }
     if (h_conf->dns_timeout > -1) {
-      INKDebug("hipes", "Setting DNS timeout to %d", h_conf->dns_timeout);
-      INKHttpTxnDNSTimeoutSet((INKHttpTxn)rh, h_conf->dns_timeout);
+      TSDebug(PLUGIN_NAME, "Setting DNS timeout to %d", h_conf->dns_timeout);
+      TSHttpTxnDNSTimeoutSet(rh, h_conf->dns_timeout);
     }
 
     // Set server ...
-    rri->new_host_size = h_conf->svc_server.size();
-    memcpy(rri->new_host, h_conf->svc_server.c_str(), rri->new_host_size);
-    INKDebug("hipes", "New server is %.*s", rri->new_host_size, rri->new_host);
+    TSUrlHostSet(rri->requestBufp, rri->requestUrl, h_conf->svc_server.c_str(), h_conf->svc_server.size()); 
+    TSDebug(PLUGIN_NAME, "New server is %.*s", (int) h_conf->svc_server.size(), h_conf->svc_server.c_str());
 
     // ... and port
-    rri->new_port = h_conf->svc_port;
-    INKDebug("hipes", "New port is %d", rri->new_port);
+    TSUrlPortSet(rri->requestBufp, rri->requestUrl, h_conf->svc_port);
+    TSDebug(PLUGIN_NAME, "New port is %d", h_conf->svc_port);
 
     // Update the path
-    rri->new_path_size = h_conf->path.size();
-    memcpy(rri->new_path, h_conf->path.c_str(), rri->new_path_size);
-    INKDebug("hipes", "New path is %.*s", rri->new_path_size, rri->new_path);
+    TSUrlPathSet(rri->requestBufp, rri->requestUrl, h_conf->path.c_str(), h_conf->path.size());
+    TSDebug(PLUGIN_NAME, "New path is %.*s", (int) h_conf->path.size(), h_conf->path.c_str());
 
     // Enable SSL?
     if (h_conf->ssl)
-      rri->require_ssl = 1;
+      TSUrlSchemeSet(rri->requestBufp, rri->requestUrl, "https", 5);
 
     // Clear previous matrix params
-    rri->new_matrix_size = -1;
+    TSUrlHttpParamsSet(rri->requestBufp, rri->requestUrl, "", 0);
+
+    // set query
+    TSUrlHttpQuerySet(rri->requestBufp, rri->requestUrl, new_query, new_query_size);
   }
 
   // Step 3: Profit
-  return 1;
+  return TSREMAP_DID_REMAP;
 }
 
 


[33/50] git commit: TS-2457 Protocol.c: change usage of atoi to strtol.

Posted by zw...@apache.org.
TS-2457 Protocol.c: change usage of atoi to strtol.


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

Branch: refs/heads/5.0.x
Commit: 47982165a1f1beb0bb3d8145fcdf8447f59dbcad
Parents: a407f5f
Author: Radim Kolar <hs...@sendmail.cz>
Authored: Tue Dec 31 13:43:27 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 13:43:27 2013 -0700

----------------------------------------------------------------------
 example/protocol/Protocol.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47982165/example/protocol/Protocol.c
----------------------------------------------------------------------
diff --git a/example/protocol/Protocol.c b/example/protocol/Protocol.c
index 5d71430..1258294 100644
--- a/example/protocol/Protocol.c
+++ b/example/protocol/Protocol.c
@@ -104,6 +104,7 @@ void
 TSPluginInit(int argc, const char *argv[])
 {
   TSPluginRegistrationInfo info;
+  char *end;
 
   info.plugin_name = "output-header";
   info.vendor_name = "MyCompany";
@@ -124,8 +125,9 @@ TSPluginInit(int argc, const char *argv[])
     printf("[protocol_plugin] Usage: protocol.so accept_port server_port\n");
     printf("[protocol_plugin] Wrong arguments. Using deafult ports.\n");
   } else {
-    if (!isnan(atoi(argv[1]))) {
-      accept_port = atoi(argv[1]);
+    strtol(argv[1], &end, 10);
+    if (*end == '\0') {
+      accept_port = strtol(argv[1], &end, 10);
       TSDebug("protocol", "using accept_port %d", accept_port);
       printf("[protocol_plugin] using accept_port %d\n", accept_port);
     } else {
@@ -133,8 +135,9 @@ TSPluginInit(int argc, const char *argv[])
       printf("Using deafult port %d\n", accept_port);
     }
 
-    if (!isnan(atoi(argv[2]))) {
-      server_port = atoi(argv[2]);
+    strtol(argv[2], &end, 10);
+    if (*end == '\0') {
+      server_port = strtol(argv[2], &end, 10);
       TSDebug("protocol", "using server_port %d", server_port);
       printf("[protocol_plugin] using server_port %d\n", server_port);
     } else {


[35/50] git commit: TS-2464: Remove useless and buggy connection header handling

Posted by zw...@apache.org.
TS-2464: Remove useless and buggy connection header handling


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

Branch: refs/heads/5.0.x
Commit: 1ef60098387c4e14ae0d75454e47f13815aa94bb
Parents: 3be2c67
Author: Uri Shachar <us...@apache.org>
Authored: Wed Jan 1 01:30:59 2014 +0200
Committer: Uri Shachar <us...@apache.org>
Committed: Wed Jan 1 01:30:59 2014 +0200

----------------------------------------------------------------------
 CHANGES                           |  2 +
 proxy/http/HttpTransact.cc        |  2 -
 proxy/http/HttpTransactHeaders.cc | 70 ----------------------------------
 proxy/http/HttpTransactHeaders.h  |  6 ---
 4 files changed, 2 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1ef60098/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 603ba4b..8599e7d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2464] Remove useless and buggy connection header handling
+
   *) [TS-2457] Protocol.c: change usage of atoi to strtol.
    Author: Radim Kolar <hs...@sendmail.cz>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1ef60098/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 0fa2974..14207f0 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -7541,7 +7541,6 @@ HttpTransact::build_request(State* s, HTTPHdr* base_request, HTTPHdr* outgoing_r
 
   HttpTransactHeaders::copy_header_fields(base_request, outgoing_request, s->txn_conf->fwd_proxy_auth_to_parent);
   add_client_ip_to_outgoing_request(s, outgoing_request);
-  HttpTransactHeaders::process_connection_headers(base_request, outgoing_request);
   HttpTransactHeaders::remove_privacy_headers_from_request(s->http_config_param, s->txn_conf, outgoing_request);
   HttpTransactHeaders::add_global_user_agent_header_to_request(s->http_config_param, outgoing_request);
   handle_request_keep_alive_headers(s, outgoing_version, outgoing_request);
@@ -7664,7 +7663,6 @@ HttpTransact::build_response(State* s, HTTPHdr* base_response, HTTPHdr* outgoing
   } else {
     if ((status_code == HTTP_STATUS_NONE) || (status_code == base_response->status_get())) {
       HttpTransactHeaders::copy_header_fields(base_response, outgoing_response, s->txn_conf->fwd_proxy_auth_to_parent);
-      HttpTransactHeaders::process_connection_headers(base_response, outgoing_response);
 
       if (s->txn_conf->insert_age_in_response)
         HttpTransactHeaders::insert_time_and_age_headers_in_response(s->request_sent_time, s->response_received_time,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1ef60098/proxy/http/HttpTransactHeaders.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransactHeaders.cc b/proxy/http/HttpTransactHeaders.cc
index 06cd98f..7c9a3e6 100644
--- a/proxy/http/HttpTransactHeaders.cc
+++ b/proxy/http/HttpTransactHeaders.cc
@@ -971,76 +971,6 @@ HttpTransactHeaders::insert_basic_realm_in_proxy_authenticate(const char *realm,
 }
 
 
-inline void
-HttpTransactHeaders::process_connection_field_in_outgoing_header(HTTPHdr *base, HTTPHdr *header)
-{
-  _process_xxx_connection_field_in_outgoing_header(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, base, header);
-}
-
-inline void
-HttpTransactHeaders::process_proxy_connection_field_in_outgoing_header(HTTPHdr *base, HTTPHdr *header)
-{
-  _process_xxx_connection_field_in_outgoing_header(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, base, header);
-}
-
-
-void
-HttpTransactHeaders::process_connection_headers(HTTPHdr *base, HTTPHdr *outgoing)
-{
-  process_connection_field_in_outgoing_header(base, outgoing);
-  process_proxy_connection_field_in_outgoing_header(base, outgoing);
-}
-
-
-void
-HttpTransactHeaders::_process_xxx_connection_field_in_outgoing_header(const char *wks_field_name,
-                                                                      int wks_field_name_len,
-                                                                      HTTPHdr *base, HTTPHdr *header)
-{
-  MIMEField *con_hdr;
-  con_hdr = base->field_find(wks_field_name, wks_field_name_len);
-
-  if (con_hdr) {
-    int val_len;
-    const char *val;
-
-    if (!con_hdr->has_dups()) { // try fastpath first
-      val = con_hdr->value_get(&val_len);
-      if ((ptr_len_casecmp(val, val_len, "keep-alive", 10) == 0) || (ptr_len_casecmp(val, val_len, "close", 5) == 0)) {
-        return;
-      }
-    }
-    {
-      HdrCsvIter iter;
-      val = iter.get_first(con_hdr, &val_len);
-
-      while (val) {
-
-        const char *wks = hdrtoken_string_to_wks(val, val_len);
-        if (wks) {
-          if ((wks != HTTP_VALUE_KEEP_ALIVE) && (wks != HTTP_VALUE_CLOSE) &&
-              (wks != MIME_FIELD_HOST) && (wks != MIME_FIELD_DATE)) {
-            int wks_length = hdrtoken_wks_to_length(wks);
-            header->field_delete(wks, wks_length);
-          }
-        } else {
-          // the following are needed to delete non-standard HTTP headers.
-          MIMEHdrImpl *m_hdr_impl = header->m_http->m_fields_impl;
-          MIMEField *hdr_to_remove;
-
-          // The specified header is not a standard HTTP header.
-          hdr_to_remove = _mime_hdr_field_list_search_by_string(m_hdr_impl, val, val_len);
-          if (hdr_to_remove)
-            header->field_delete(hdr_to_remove);
-        }
-
-        val = iter.get_next(&val_len);
-      }
-    }
-  }
-}
-
-
 void
 HttpTransactHeaders::remove_conditional_headers(HTTPHdr *outgoing)
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1ef60098/proxy/http/HttpTransactHeaders.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransactHeaders.h b/proxy/http/HttpTransactHeaders.h
index fd61bf1..8dbbdab 100644
--- a/proxy/http/HttpTransactHeaders.h
+++ b/proxy/http/HttpTransactHeaders.h
@@ -77,12 +77,6 @@ public:
 
   static void insert_basic_realm_in_proxy_authenticate(const char *realm, HTTPHdr * header, bool bRevPrxy);
 
-  static void process_connection_headers(HTTPHdr * base, HTTPHdr * outgoing);
-  static void process_connection_field_in_outgoing_header(HTTPHdr * base, HTTPHdr * header);
-  static void process_proxy_connection_field_in_outgoing_header(HTTPHdr * base, HTTPHdr * header);
-  static void _process_xxx_connection_field_in_outgoing_header(const char *wks_field_name, int wks_field_name_len,
-                                                               HTTPHdr * base, HTTPHdr * header);
-
   static void remove_conditional_headers(HTTPHdr * outgoing);
   static void remove_host_name_from_url(HTTPHdr * outgoing_request);
   static void add_global_user_agent_header_to_request(HttpConfigParams *http_config_param, HTTPHdr * header);


[40/50] git commit: TS-2465: libxml2 detection broken

Posted by zw...@apache.org.
TS-2465: libxml2 detection broken

There is problem with libxml2 detection in configure script. It
inserts library path into ld options without any prefix causing any
next compile attempts to fail. Tested on freebsd 10.0


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

Branch: refs/heads/5.0.x
Commit: 96abfc7cd17a9eb36bc989f6bfcb2eb511280f05
Parents: 551bac5
Author: Radim Kolar <hs...@sendmail.cz>
Authored: Thu Jan 2 09:06:39 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 2 09:08:17 2014 -0800

----------------------------------------------------------------------
 CHANGES      | 3 +++
 build/xml.m4 | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/96abfc7c/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9d68599..464e054 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2465] libxml2 detection generates an invalid linker path.
+   Author: Radim Kolar <hs...@sendmail.cz>
+
   *) [TS-2271] Threaded plugin support with 3rd party libraries.
    Author: Heikki Hannikainen <he...@hes.iki.fi>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/96abfc7c/build/xml.m4
----------------------------------------------------------------------
diff --git a/build/xml.m4 b/build/xml.m4
index 806a997..b639054 100644
--- a/build/xml.m4
+++ b/build/xml.m4
@@ -59,7 +59,7 @@ AC_DEFUN([TS_CHECK_XML_LIBXML2], [
       elif test "$withval" != "no"; then
         enable_libxml2=yes
         libxml2_include="$withval/include/libxml2"
-        libxml2_ldflags="$withval/lib"
+        libxml2_ldflags="-L$withval/lib"
       fi
     fi
   ])


[36/50] git commit: TS-2457 Fix usage around strtol, bad review on my part

Posted by zw...@apache.org.
TS-2457 Fix usage around strtol, bad review on my part


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

Branch: refs/heads/5.0.x
Commit: 74af2183c3641a3c0f2b7f024b17d5d0db814e93
Parents: 1ef6009
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Dec 31 19:54:29 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 19:54:29 2013 -0700

----------------------------------------------------------------------
 example/protocol/Protocol.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/74af2183/example/protocol/Protocol.c
----------------------------------------------------------------------
diff --git a/example/protocol/Protocol.c b/example/protocol/Protocol.c
index 1258294..d065c9d 100644
--- a/example/protocol/Protocol.c
+++ b/example/protocol/Protocol.c
@@ -105,6 +105,7 @@ TSPluginInit(int argc, const char *argv[])
 {
   TSPluginRegistrationInfo info;
   char *end;
+  int tmp;
 
   info.plugin_name = "output-header";
   info.vendor_name = "MyCompany";
@@ -125,9 +126,9 @@ TSPluginInit(int argc, const char *argv[])
     printf("[protocol_plugin] Usage: protocol.so accept_port server_port\n");
     printf("[protocol_plugin] Wrong arguments. Using deafult ports.\n");
   } else {
-    strtol(argv[1], &end, 10);
+    tmp = strtol(argv[1], &end, 10);
     if (*end == '\0') {
-      accept_port = strtol(argv[1], &end, 10);
+      accept_port = tmp;
       TSDebug("protocol", "using accept_port %d", accept_port);
       printf("[protocol_plugin] using accept_port %d\n", accept_port);
     } else {
@@ -135,9 +136,9 @@ TSPluginInit(int argc, const char *argv[])
       printf("Using deafult port %d\n", accept_port);
     }
 
-    strtol(argv[2], &end, 10);
+    tmp = strtol(argv[2], &end, 10);
     if (*end == '\0') {
-      server_port = strtol(argv[2], &end, 10);
+      server_port = tmp;
       TSDebug("protocol", "using server_port %d", server_port);
       printf("[protocol_plugin] using server_port %d\n", server_port);
     } else {


[25/50] git commit: TS-32: minimum FIX to let ICP work

Posted by zw...@apache.org.
TS-32: minimum FIX to let ICP work

Fixed an error on access to class member that was not initialized and
restored former implementation based on a change in TS-320.

And commented out the forced termination code in
UDPReadContinuation::readPollEvent().
Please tell me if you know what seems to be the problem in this
implementation.

Signed-off-by: Zhao Yongming <mi...@gmail.com>


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

Branch: refs/heads/5.0.x
Commit: 05f7bfb57517e60a364a62dd171e5cc65824aa4a
Parents: c049469
Author: Gota Adachi <ad...@iij.ad.jp>
Authored: Tue Dec 24 15:15:38 2013 +0800
Committer: Zhao Yongming <mi...@gmail.com>
Committed: Sun Dec 29 18:39:20 2013 +0800

----------------------------------------------------------------------
 iocore/net/UnixNet.cc    |  7 +++++--
 iocore/net/UnixUDPNet.cc |  6 +++++-
 proxy/ICP.cc             | 21 ++++++++++++++++++---
 proxy/ICP.h              |  1 +
 proxy/ICPConfig.cc       |  7 +++++++
 5 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05f7bfb5/iocore/net/UnixNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index 5e72b0c..69b620f 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -71,13 +71,13 @@ struct InactivityCop : public Continuation {
 };
 #endif
 
-PollCont::PollCont(ProxyMutex *m, int pt):Continuation(m), net_handler(NULL), poll_timeout(pt) {
+PollCont::PollCont(ProxyMutex *m, int pt):Continuation(m), net_handler(NULL), nextPollDescriptor(NULL), poll_timeout(pt) {
   pollDescriptor = NEW(new PollDescriptor);
   pollDescriptor->init();
   SET_HANDLER(&PollCont::pollEvent);
 }
 
-PollCont::PollCont(ProxyMutex *m, NetHandler *nh, int pt):Continuation(m), net_handler(nh), poll_timeout(pt)
+PollCont::PollCont(ProxyMutex *m, NetHandler *nh, int pt):Continuation(m), net_handler(nh), nextPollDescriptor(NULL), poll_timeout(pt)
 {
   pollDescriptor = NEW(new PollDescriptor);
   pollDescriptor->init();
@@ -86,6 +86,9 @@ PollCont::PollCont(ProxyMutex *m, NetHandler *nh, int pt):Continuation(m), net_h
 
 PollCont::~PollCont() {
   delete pollDescriptor;
+  if (nextPollDescriptor != NULL) {
+    delete nextPollDescriptor;
+  }
 }
 
 //

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05f7bfb5/iocore/net/UnixUDPNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index 0237e9c..ee9c6f9 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -298,6 +298,10 @@ UDPReadContinuation::setupPollDescriptor()
   Pollfd *pfd;
   EThread *et = (EThread *) this_thread();
   PollCont *pc = get_PollCont(et);
+  if (pc->nextPollDescriptor == NULL) {
+    pc->nextPollDescriptor = NEW(new PollDescriptor);
+    pc->nextPollDescriptor->init();
+  }
   pfd = pc->nextPollDescriptor->alloc();
   pfd->fd = fd;
   ifd = pfd - pc->nextPollDescriptor->pfd;
@@ -337,7 +341,7 @@ UDPReadContinuation::readPollEvent(int event_, Event * e)
   }
   //ink_assert(ifd < 0 || event_ == EVENT_INTERVAL || (event_ == EVENT_POLL && pc->pollDescriptor->nfds > ifd && pc->pollDescriptor->pfd[ifd].fd == fd));
   //if (ifd < 0 || event_ == EVENT_INTERVAL || (pc->pollDescriptor->pfd[ifd].revents & POLLIN)) {
-  ink_assert(!"incomplete");
+  //ink_assert(!"incomplete");
   c = completionUtil::getContinuation(event);
   // do read
   socklen_t tmp_fromlen = *fromaddrlen;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05f7bfb5/proxy/ICP.cc
----------------------------------------------------------------------
diff --git a/proxy/ICP.cc b/proxy/ICP.cc
index 4ed8e29..7e78925 100644
--- a/proxy/ICP.cc
+++ b/proxy/ICP.cc
@@ -2174,8 +2174,8 @@ ICPProcessor::SetupListenSockets()
   Peer *P;
   int status;
   int index;
+  ip_port_text_buffer ipb, ipb2;
   for (index = 0; index < (_nPeerList + 1); ++index) {
-    ip_port_text_buffer ipb, ipb2;
 
     if ((P = _PeerList[index])) {
 
@@ -2183,7 +2183,7 @@ ICPProcessor::SetupListenSockets()
           || (P->GetType() == PEER_SIBLING)) {
         ParentSiblingPeer *pPS = (ParentSiblingPeer *) P;
 
-	pPS->GetChan()->setRemote(pPS->GetIP());
+        pPS->GetChan()->setRemote(pPS->GetIP());
 
       } else if (P->GetType() == PEER_MULTICAST) {
         MultiCastPeer *pMC = (MultiCastPeer *) P;
@@ -2219,7 +2219,22 @@ ICPProcessor::SetupListenSockets()
   //
   ParentSiblingPeer *pPS = (ParentSiblingPeer *) ((Peer *) _LocalPeer);
 
-  pPS->GetChan()->setRemote(pPS->GetIP());
+  NetVCOptions options;
+  options.local_ip.assign(pPS->GetIP());
+  options.local_port = pPS->GetICPPort();
+  options.ip_proto = NetVCOptions::USE_UDP;
+  options.addr_binding = NetVCOptions::INTF_ADDR;
+  status = pPS->GetChan()->open(options);
+  if (status) {
+    // coverity[uninit_use_in_call] ?
+    Warning("ICP bind_connect failed, res=%d, ip=%s",
+      status,
+      ats_ip_nptop(pPS->GetIP(), ipb, sizeof(ipb))
+    );
+    REC_SignalWarning(REC_SIGNAL_CONFIG_ERROR, "ICP bind_connect for localhost failed");
+    return 1;             // Failed
+  }
+
   return 0;                     // Success
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05f7bfb5/proxy/ICP.h
----------------------------------------------------------------------
diff --git a/proxy/ICP.h b/proxy/ICP.h
index e44e6ea..5ccf7b4 100644
--- a/proxy/ICP.h
+++ b/proxy/ICP.h
@@ -613,6 +613,7 @@ public:
       delete _pconfig;
   }
   int GetProxyPort();
+  int GetICPPort();
   virtual sockaddr* GetIP();
   virtual Action *SendMsg_re(Continuation *, void *, struct msghdr *, struct sockaddr const* to);
   virtual Action *RecvFrom_re(Continuation *, void *, IOBufferBlock *, int, struct sockaddr *, socklen_t *);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05f7bfb5/proxy/ICPConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/ICPConfig.cc b/proxy/ICPConfig.cc
index b5192d2..2463050 100644
--- a/proxy/ICPConfig.cc
+++ b/proxy/ICPConfig.cc
@@ -857,6 +857,13 @@ ParentSiblingPeer::GetProxyPort()
   return _pconfig->GetProxyPort();
 }
 
+int
+ParentSiblingPeer::GetICPPort()
+{
+  return _pconfig->GetICPPort();
+}
+
+
 sockaddr*
 ParentSiblingPeer::GetIP()
 {


[26/50] git commit: TS-32: FIX to perform multicast ICP communication

Posted by zw...@apache.org.
TS-32: FIX to perform multicast ICP communication

Signed-off-by: Zhao Yongming <mi...@gmail.com>


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

Branch: refs/heads/5.0.x
Commit: cf054cb3ad57157a05f0e4d37b5065950f6bcbc6
Parents: 05f7bfb
Author: Gota Adachi <ad...@iij.ad.jp>
Authored: Tue Dec 24 15:15:55 2013 +0800
Committer: Zhao Yongming <mi...@gmail.com>
Committed: Sun Dec 29 18:42:01 2013 +0800

----------------------------------------------------------------------
 iocore/net/P_Connection.h    |  1 +
 iocore/net/UnixConnection.cc | 10 ++++++++--
 lib/ts/ink_inet.cc           |  2 +-
 proxy/ICP.cc                 |  1 +
 4 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf054cb3/iocore/net/P_Connection.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_Connection.h b/iocore/net/P_Connection.h
index 7abaa8e..e2fed75 100644
--- a/iocore/net/P_Connection.h
+++ b/iocore/net/P_Connection.h
@@ -131,6 +131,7 @@ struct Connection
                     unsigned char mc_ttl = 1, bool mc_loopback = DISABLE_MC_LOOPBACK, Continuation * c = NULL);
 
   int setup_mc_receive(sockaddr const* from,
+                       sockaddr const* my_addr,
                        bool non_blocking = NON_BLOCKING, Connection * sendchan = NULL, Continuation * c = NULL);
 
   int close();                  // 0 on success, -errno on failure

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf054cb3/iocore/net/UnixConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixConnection.cc b/iocore/net/UnixConnection.cc
index 98b931a..9a03c0e 100644
--- a/iocore/net/UnixConnection.cc
+++ b/iocore/net/UnixConnection.cc
@@ -53,6 +53,7 @@ Connection::setup_mc_send(
   ink_assert(fd == NO_FD);
   int res = 0;
   int enable_reuseaddr = 1;
+  in_addr_t mc_if = ats_ip4_addr_cast(my_addr);
 
   if ((res = socketManager.mc_socket(my_addr->sa_family, SOCK_DGRAM, 0, non_blocking)) < 0)
     goto Lerror;
@@ -82,6 +83,9 @@ Connection::setup_mc_send(
   if ((res = safe_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &mc_ttl, sizeof(mc_ttl)) < 0))
     goto Lerror;
 
+  // Set MultiCast Interface to specified value
+  if ((res = safe_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (char *) &mc_if, sizeof(mc_if)) < 0))
+    goto Lerror;
 
   // Disable MultiCast loopback if requested
   if (!mc_loopback) {
@@ -102,6 +106,7 @@ Lerror:
 int
 Connection::setup_mc_receive(
   sockaddr const* mc_addr,
+  sockaddr const* my_addr,
   bool non_blocking, Connection * sendChan, Continuation * c
 ) {
   ink_assert(fd == NO_FD);
@@ -109,6 +114,7 @@ Connection::setup_mc_receive(
   (void) c;
   int res = 0;
   int enable_reuseaddr = 1;
+  IpAddr inaddr_any(INADDR_ANY);
 
   if ((res = socketManager.socket(mc_addr->sa_family, SOCK_DGRAM, 0)) < 0)
     goto Lerror;
@@ -123,7 +129,7 @@ Connection::setup_mc_receive(
   if ((res = safe_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &enable_reuseaddr, sizeof(enable_reuseaddr)) < 0))
     goto Lerror;
 
-  ats_ip_copy(&addr, mc_addr);
+  addr.assign(inaddr_any, ats_ip_port_cast(mc_addr));
 
   if ((res = socketManager.ink_bind(fd, &addr.sa, ats_ip_size(&addr.sa), IPPROTO_TCP)) < 0)
     goto Lerror;
@@ -136,7 +142,7 @@ Connection::setup_mc_receive(
     struct ip_mreq mc_request;
     // Add ourselves to the MultiCast group
     mc_request.imr_multiaddr.s_addr = ats_ip4_addr_cast(mc_addr);
-    mc_request.imr_interface.s_addr = INADDR_ANY;
+    mc_request.imr_interface.s_addr = ats_ip4_addr_cast(my_addr);
 
     if ((res = safe_setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mc_request, sizeof(mc_request)) < 0))
       goto Lerror;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf054cb3/lib/ts/ink_inet.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_inet.cc b/lib/ts/ink_inet.cc
index 397e7da..3221ab2 100644
--- a/lib/ts/ink_inet.cc
+++ b/lib/ts/ink_inet.cc
@@ -348,7 +348,7 @@ IpAddr::toString(char* dest, size_t len) const {
 
 bool
 IpAddr::isMulticast() const {
-  return (AF_INET == _family && 0xe == _addr._byte[0]) ||
+  return (AF_INET == _family && 0xe == (_addr._byte[0] >> 4)) ||
     (AF_INET6 == _family && IN6_IS_ADDR_MULTICAST(&_addr._ip6))
     ;
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf054cb3/proxy/ICP.cc
----------------------------------------------------------------------
diff --git a/proxy/ICP.cc b/proxy/ICP.cc
index 7e78925..8124a44 100644
--- a/proxy/ICP.cc
+++ b/proxy/ICP.cc
@@ -2201,6 +2201,7 @@ ICPProcessor::SetupListenSockets()
         }
 
         status = pMC->GetRecvChan()->setup_mc_receive(pMC->GetIP(),
+                                                      _LocalPeer->GetIP(),
                                                       NON_BLOCKING, pMC->GetSendChan(), _mcastCB_handler);
         if (status) {
           // coverity[uninit_use_in_call]


[19/50] git commit: TS-2454: Fix undefined reference to `__sync_fetch_and_sub_8' on ARM 32bit system

Posted by zw...@apache.org.
TS-2454: Fix undefined reference to `__sync_fetch_and_sub_8' on ARM 32bit system

Signed-off-by: Yunkai Zhang <yu...@redstar.celldoft.com>


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

Branch: refs/heads/5.0.x
Commit: 8d8507f3fb9108fdc58b8e7da924b12de8fcbcd0
Parents: a477817
Author: Yunkai Zhang <yu...@redstar.celldoft.com>
Authored: Sat Dec 28 19:59:33 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Sat Dec 28 20:10:16 2013 +0800

----------------------------------------------------------------------
 CHANGES             |  2 ++
 lib/ts/ink_atomic.h | 39 ++++++++++++++++++++++++++++++++-------
 2 files changed, 34 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8d8507f3/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index c17904a..29079c0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) TS-2454: Fix undefined reference to `__sync_fetch_and_sub_8' on ARM 32bit system.
+
   *) [TS-2450] Fix assertion failure for T61String type.
 
   *) [TS-2117] make hipes plugin build

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8d8507f3/lib/ts/ink_atomic.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_atomic.h b/lib/ts/ink_atomic.h
index 51d87c0..fc8a9f3 100644
--- a/lib/ts/ink_atomic.h
+++ b/lib/ts/ink_atomic.h
@@ -50,6 +50,7 @@ typedef volatile int8_t vint8;
 typedef volatile int16_t vint16;
 typedef volatile int32_t vint32;
 typedef volatile int64_t vint64;
+typedef volatile uint64_t vuint64;
 typedef volatile long vlong;
 typedef volatile void *vvoidp;
 
@@ -57,6 +58,7 @@ typedef vint8 *pvint8;
 typedef vint16 *pvint16;
 typedef vint32 *pvint32;
 typedef vint64 *pvint64;
+typedef vuint64 *pvuint64;
 typedef vlong *pvlong;
 typedef vvoidp *pvvoidp;
 
@@ -194,9 +196,8 @@ ink_atomic_cas<int64_t>(pvint64 mem, int64_t old, int64_t new_value) {
   return 0;
 }
 
-template<>
-inline int64_t
-ink_atomic_increment<int64_t>(pvint64 mem, int64_t value) {
+template<typename Amount> static inline int64_t
+ink_atomic_increment(pvint64 mem, Amount value) {
   int64_t curr;
   ink_mutex_acquire(&__global_death);
   curr = *mem;
@@ -205,10 +206,34 @@ ink_atomic_increment<int64_t>(pvint64 mem, int64_t value) {
   return curr;
 }
 
-template<>
-inline int64_t
-ink_atomic_increment<int64_t>(pvint64 mem, int value) {
-  return ink_atomic_increment(mem, static_cast<int64_t>(value));
+template<typename Amount> static inline int64_t
+ink_atomic_decrement(pvint64 mem, Amount value) {
+  int64_t curr;
+  ink_mutex_acquire(&__global_death);
+  curr = *mem;
+  *mem = curr - value;
+  ink_mutex_release(&__global_death);
+  return curr;
+}
+
+template<typename Amount> static inline uint64_t
+ink_atomic_increment(pvuint64 mem, Amount value) {
+  uint64_t curr;
+  ink_mutex_acquire(&__global_death);
+  curr = *mem;
+  *mem = curr + value;
+  ink_mutex_release(&__global_death);
+  return curr;
+}
+
+template<typename Amount> static inline uint64_t
+ink_atomic_decrement(pvuint64 mem, Amount value) {
+  uint64_t curr;
+  ink_mutex_acquire(&__global_death);
+  curr = *mem;
+  *mem = curr - value;
+  ink_mutex_release(&__global_death);
+  return curr;
 }
 
 #endif /* Special hacks for ARM 32-bit */


[44/50] git commit: TS-1365 Fix doc for --poll_timeout

Posted by zw...@apache.org.
TS-1365 Fix doc for --poll_timeout


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

Branch: refs/heads/5.0.x
Commit: 037d8cc2c54e6ddbd83dc95f055d8756c078a6ca
Parents: a74ef5a
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 2 15:22:18 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 2 15:30:53 2014 -0700

----------------------------------------------------------------------
 doc/reference/commands/traffic_server.en.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/037d8cc2/doc/reference/commands/traffic_server.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/commands/traffic_server.en.rst b/doc/reference/commands/traffic_server.en.rst
index 442a369..2c8b586 100644
--- a/doc/reference/commands/traffic_server.en.rst
+++ b/doc/reference/commands/traffic_server.en.rst
@@ -62,7 +62,7 @@ Description
 
 .. option:: --accept_mss MSS
 
-.. option:: -t SECS, --poll_timeout SECS
+.. option:: -t MSECS, --poll_timeout MSECS
 
 .. option:: -h, --help
 


[23/50] git commit: Add TS-2248.

Posted by zw...@apache.org.
Add TS-2248.


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

Branch: refs/heads/5.0.x
Commit: 510c46aebf217c9016655ba370db0618ac2e968d
Parents: 6a88b7d
Author: Leif Hedstrom <le...@ogre.com>
Authored: Sat Dec 28 14:04:21 2013 -0700
Committer: Leif Hedstrom <le...@ogre.com>
Committed: Sat Dec 28 14:04:21 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/510c46ae/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index ca28d6c..46c6802 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2248] Segmentation fault HttpTunnel and throttling.
+   Author: bettydramit <b1...@gmail.com>.
+
   *) [TS-2454] Fix undefined reference to `__sync_fetch_and_sub_8' on ARM
    32bit system.
 


[47/50] git commit: TS-1365 Fix AIO unit test

Posted by zw...@apache.org.
TS-1365 Fix AIO unit test


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

Branch: refs/heads/5.0.x
Commit: d96ac78d036d2ea52356a178da57bcf4733bfa76
Parents: f78c83a
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 2 16:30:39 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 2 16:30:39 2014 -0700

----------------------------------------------------------------------
 iocore/aio/test_AIO.cc | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d96ac78d/iocore/aio/test_AIO.cc
----------------------------------------------------------------------
diff --git a/iocore/aio/test_AIO.cc b/iocore/aio/test_AIO.cc
index 817d8a2..3ff731a 100644
--- a/iocore/aio/test_AIO.cc
+++ b/iocore/aio/test_AIO.cc
@@ -34,6 +34,14 @@ Diags *diags;
 int diags_init = 0;
 #define DIAGS_LOG_FILE "diags.log"
 
+// Necessary for AIO
+#if defined(solaris)
+int net_config_poll_timeout = 30;
+#else
+int net_config_poll_timeout = 10;
+#endif
+
+
 //////////////////////////////////////////////////////////////////////////////
 //
 //      void reconfigure_diags()


[48/50] git commit: TS-2467: traffic_shell doesn't work with tcl 8.6, works with 8.5

Posted by zw...@apache.org.
TS-2467: traffic_shell doesn't work with tcl 8.6, works with 8.5

Segfault in libtcl8.6.so when calling Tcl_SetMainLoop(Tcl_ReadlineMain).
If setting Tcl MainLoop, we should call Tcl_FindExecutable(NULL),
which fixes TCL 8.6 and should also work with older versions.


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

Branch: refs/heads/5.0.x
Commit: 8901e65da2c0affa742227b56d966f45e9d3e8a6
Parents: d96ac78
Author: Ben Aitchison <be...@meh.net.nz>
Authored: Thu Jan 2 15:37:40 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 2 15:39:42 2014 -0800

----------------------------------------------------------------------
 CHANGES                            | 3 +++
 cmd/traffic_shell/traffic_shell.cc | 2 ++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8901e65d/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 7e4ae1e..2a0771c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2467] traffic_shell doesn't work with tcl 8.6.
+   Author: Ben Aitchison <be...@meh.net.nz>
+
   *) [TS-1365] Add a new configuration option, proxy.config.net.poll_timeout,
    with the same behavior as the command line option --poll_timeout. Also
    adjust AIO scheduling to correlate to this setting, to avoid additional

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8901e65d/cmd/traffic_shell/traffic_shell.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/traffic_shell.cc b/cmd/traffic_shell/traffic_shell.cc
index 8da720a..29978c7 100644
--- a/cmd/traffic_shell/traffic_shell.cc
+++ b/cmd/traffic_shell/traffic_shell.cc
@@ -73,6 +73,8 @@ main(int argc, char *argv[])
     exit(0);
   }
 
+  Tcl_FindExecutable(argv[0]);
+
   // traffic_shell binary should use printf to display information onscreen
   CliDisplayPrintf = 1;
 


[17/50] git commit: TS-2450 make the T61String type not trigger the assertion failure if build with --enable-debug.

Posted by zw...@apache.org.
TS-2450 make the T61String type not trigger the assertion failure if
build with --enable-debug.


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

Branch: refs/heads/5.0.x
Commit: 6f810cd3c90ab6d031a13b259c8ab7efe558073f
Parents: 6413af5
Author: weijin <ta...@taobao.com>
Authored: Fri Dec 27 11:35:51 2013 +0800
Committer: weijin <ta...@taobao.com>
Committed: Fri Dec 27 11:43:37 2013 +0800

----------------------------------------------------------------------
 CHANGES                | 2 ++
 iocore/net/SSLUtils.cc | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6f810cd3/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 2d3cb33..c17904a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2450] Fix assertion failure for T61String type.
+
   *) [TS-2117] make hipes plugin build
 
   *) [TS-2452] Can't access a deleted object.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6f810cd3/iocore/net/SSLUtils.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 686194b..5ddbc52 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -600,7 +600,8 @@ asn1_strdup(ASN1_STRING * s)
   // Make sure we have an 8-bit encoding.
   ink_assert(ASN1_STRING_type(s) == V_ASN1_IA5STRING ||
     ASN1_STRING_type(s) == V_ASN1_UTF8STRING ||
-    ASN1_STRING_type(s) == V_ASN1_PRINTABLESTRING);
+    ASN1_STRING_type(s) == V_ASN1_PRINTABLESTRING ||
+    ASN1_STRING_type(s) == V_ASN1_T61STRING);
 
   return ats_strndup((const char *)ASN1_STRING_data(s), ASN1_STRING_length(s));
 }


[31/50] git commit: TS-2459 Fix wrong name for a couple of librecord APIs.

Posted by zw...@apache.org.
TS-2459 Fix wrong name for a couple of librecord APIs.


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

Branch: refs/heads/5.0.x
Commit: a19a444c266cbf6c6ed2edd1bc12d31dd603a8e8
Parents: 5cc64bf
Author: Yu Qing <ha...@yahoo.com.cn>
Authored: Tue Dec 31 11:26:59 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 11:26:59 2013 -0700

----------------------------------------------------------------------
 lib/records/I_RecCore.h | 8 ++++----
 lib/records/RecCore.cc  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a19a444c/lib/records/I_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecCore.h b/lib/records/I_RecCore.h
index 39d2e9d..4b3088c 100644
--- a/lib/records/I_RecCore.h
+++ b/lib/records/I_RecCore.h
@@ -100,8 +100,8 @@ int RecRegisterConfigCounter(RecT rec_type, const char *name,
 //-------------------------------------------------------------------------
 
 int RecLinkConfigInt(const char *name, RecInt * rec_int);
-int RecLinkConfigInk32(const char *name, int32_t * p_int32);
-int RecLinkConfigInkU32(const char *name, uint32_t * p_uint32);
+int RecLinkConfigInt32(const char *name, int32_t * p_int32);
+int RecLinkConfigUInt32(const char *name, uint32_t * p_uint32);
 int RecLinkConfigFloat(const char *name, RecFloat * rec_float);
 int RecLinkConfigCounter(const char *name, RecCounter * rec_counter);
 int RecLinkConfigString(const char *name, RecString * rec_string);
@@ -199,12 +199,12 @@ void RecSignalManager(int, const char *);
 } while (0)
 
 #define REC_EstablishStaticConfigInt32(_var, _config_var_name) do { \
-  RecLinkConfigInk32(_config_var_name, &_var); \
+  RecLinkConfigInt32(_config_var_name, &_var); \
   _var = (int32_t)REC_ConfigReadInteger(_config_var_name); \
 } while (0)
 
 #define REC_EstablishStaticConfigInt32U(_var, _config_var_name) do { \
-  RecLinkConfigInkU32(_config_var_name, &_var); \
+  RecLinkConfigUInt32(_config_var_name, &_var); \
   _var = (int32_t)REC_ConfigReadInteger(_config_var_name); \
 } while (0)
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a19a444c/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index b81b3d1..532aecc 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -228,13 +228,13 @@ RecLinkConfigInt(const char *name, RecInt * rec_int)
 }
 
 int
-RecLinkConfigInk32(const char *name, int32_t * p_int32)
+RecLinkConfigInt32(const char *name, int32_t * p_int32)
 {
   return RecRegisterConfigUpdateCb(name, link_int32, (void *) p_int32);
 }
 
 int
-RecLinkConfigInkU32(const char *name, uint32_t * p_uint32)
+RecLinkConfigUInt32(const char *name, uint32_t * p_uint32)
 {
   return RecRegisterConfigUpdateCb(name, link_uint32, (void *) p_uint32);
 }


[45/50] git commit: TS-1365 Make the -t option work as intended.

Posted by zw...@apache.org.
TS-1365 Make the -t option work as intended.

This also adds a new configuration option, proxy.config.net.poll_timeout.


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

Branch: refs/heads/5.0.x
Commit: eccb33cc01b109c55d8e21ae10d7366e4044993f
Parents: 52c2da6
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Dec 31 13:38:56 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 2 15:30:53 2014 -0700

----------------------------------------------------------------------
 iocore/aio/AIO.cc                    |  5 ++---
 iocore/eventsystem/I_SocketManager.h |  3 ++-
 iocore/net/I_Net.h                   |  8 --------
 iocore/net/Net.cc                    |  2 +-
 mgmt/RecordsConfig.cc                |  8 ++++++++
 proxy/Main.cc                        | 16 +++++++++++++++-
 6 files changed, 28 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eccb33cc/iocore/aio/AIO.cc
----------------------------------------------------------------------
diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index 2e3e91f..ac8ea0f 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -538,9 +538,8 @@ aio_thread_main(void *arg)
         op->thread->schedule_imm_signal(op);
       ink_mutex_acquire(&my_aio_req->aio_mutex);
     } while (1);
-    timespec ten_msec_timespec = ink_based_hrtime_to_timespec(ink_get_hrtime() + HRTIME_MSECONDS(10));
-    ink_cond_timedwait(&my_aio_req->aio_cond, &my_aio_req->aio_mutex,
-                       &ten_msec_timespec);
+    timespec timedwait_msec = ink_based_hrtime_to_timespec(ink_get_hrtime() + HRTIME_MSECONDS(net_config_poll_timeout));
+    ink_cond_timedwait(&my_aio_req->aio_cond, &my_aio_req->aio_mutex, &timedwait_msec);
   }
   return 0;
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eccb33cc/iocore/eventsystem/I_SocketManager.h
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/I_SocketManager.h b/iocore/eventsystem/I_SocketManager.h
index 57802f4..d294a5c 100644
--- a/iocore/eventsystem/I_SocketManager.h
+++ b/iocore/eventsystem/I_SocketManager.h
@@ -40,6 +40,7 @@
 #define DEFAULT_OPEN_MODE                         0644
 
 class Thread;
+extern int net_config_poll_timeout;
 
 #define SOCKET int
 
@@ -85,7 +86,7 @@ struct SocketManager
   int epoll_create(int size);
   int epoll_close(int eps);
   int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
-  int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout);
+  int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout = net_config_poll_timeout);
 #endif
 #if TS_USE_KQUEUE
   int kqueue();

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eccb33cc/iocore/net/I_Net.h
----------------------------------------------------------------------
diff --git a/iocore/net/I_Net.h b/iocore/net/I_Net.h
index d6464e5..78f3d62 100644
--- a/iocore/net/I_Net.h
+++ b/iocore/net/I_Net.h
@@ -62,14 +62,6 @@
 
 static int const NO_FD = -1;
 
-static unsigned int const DEFAULT_POLL_TIMEOUT =
-#if defined(solaris)
-                                                  30  /* mseconds */
-#else
-                                                  10  /* mseconds */
-#endif
-  ;
-
 extern int net_config_poll_timeout;
 
 #define NET_EVENT_OPEN                    (NET_EVENT_EVENTS_START)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eccb33cc/iocore/net/Net.cc
----------------------------------------------------------------------
diff --git a/iocore/net/Net.cc b/iocore/net/Net.cc
index 2ae2c99..485aef1 100644
--- a/iocore/net/Net.cc
+++ b/iocore/net/Net.cc
@@ -32,7 +32,7 @@
 #include "P_Net.h"
 
 RecRawStatBlock *net_rsb = NULL;
-int net_config_poll_timeout = DEFAULT_POLL_TIMEOUT;
+int net_config_poll_timeout = -1; // This will get set via either command line or records.config.
 
 static inline void
 configure_net(void)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eccb33cc/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 134e029..72a905f 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -796,6 +796,14 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.net.sock_mss_in", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.net.poll_timeout", RECD_INT,
+#if defined(solaris)
+  "30",
+#else
+  "10",
+#endif
+   RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
 
   //##############################################################################
   //#

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eccb33cc/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 114ade8..1947621 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -153,6 +153,7 @@ HttpBodyFactory *body_factory = NULL;
 
 static int accept_mss = 0;
 static int cmd_line_dprintf_level = 0;  // default debug output level from ink_dprintf function
+static int poll_timeout = -1; // No value set.
 
 // 1: delay listen, wait for cache.
 // 0: Do not delay, start listen ASAP.
@@ -213,7 +214,7 @@ static const ArgumentDescription argument_descriptions[] = {
 #endif
 
   {"accept_mss", ' ', "MSS for client connections", "I", &accept_mss, NULL, NULL},
-  {"poll_timeout", 't', "poll timeout in milliseconds", "I", &net_config_poll_timeout, NULL, NULL},
+  {"poll_timeout", 't', "poll timeout in milliseconds", "I", &poll_timeout, NULL, NULL},
   {"help", 'h', "HELP!", NULL, NULL, NULL, usage},
 };
 
@@ -1451,6 +1452,19 @@ main(int /* argc ATS_UNUSED */, char **argv)
   size_t stacksize;
   REC_ReadConfigInteger(stacksize, "proxy.config.thread.default.stacksize");
 
+  // This has some special semantics, in that providing this configuration on
+  // command line has higher priority than what is set in records.config.
+  if (-1 != poll_timeout) {
+    net_config_poll_timeout = poll_timeout;
+  } else {
+    REC_ReadConfigInteger(net_config_poll_timeout, "proxy.config.net.poll_timeout");
+  }
+
+  // This shouldn't happen, but lets make sure we run somewhat reasonable.
+  if (net_config_poll_timeout < 0) {
+    net_config_poll_timeout = 30; // This is the solaris default value.
+  }
+
   ink_event_system_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));
   ink_net_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));
   ink_aio_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));


[39/50] git commit: TS-2271: update CHANGES

Posted by zw...@apache.org.
TS-2271: update CHANGES


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

Branch: refs/heads/5.0.x
Commit: 551bac5cdb2737ed176fd18777027d80a127fb99
Parents: d706b7d
Author: James Peach <jp...@apache.org>
Authored: Thu Jan 2 08:42:29 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 2 08:42:29 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/551bac5c/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 8599e7d..9d68599 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2271] Threaded plugin support with 3rd party libraries.
+   Author: Heikki Hannikainen <he...@hes.iki.fi>
+
   *) [TS-2464] Remove useless and buggy connection header handling
 
   *) [TS-2457] Protocol.c: change usage of atoi to strtol.


[34/50] git commit: Added Ts-2457.

Posted by zw...@apache.org.
Added Ts-2457.


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

Branch: refs/heads/5.0.x
Commit: 3be2c67b87f12fc84ce2f3dfe0943a0497daa066
Parents: 4798216
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Dec 31 13:45:12 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 13:45:12 2013 -0700

----------------------------------------------------------------------
 CHANGES | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3be2c67b/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a799472..603ba4b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2457] Protocol.c: change usage of atoi to strtol.
+   Author: Radim Kolar <hs...@sendmail.cz>
+
   *) [TS-2459] Fix wrong name for a couple of librecord APIs.
-    Author: Yu Qing <ha...@yahoo.com.cn>.
+    Author: Yu Qing <ha...@yahoo.com.cn>
 
   *) [TS-2463] Crash regression around slow-log feature, when logging an
    event. This fixes commit c290ce0df2a.
@@ -10,7 +13,7 @@ Changes with Apache Traffic Server 4.2.0
   *) [TS-32] Fix ICP. Author: Gota Adachi <ad...@iij.ad.jp>
 
   *) [TS-2248] Segmentation fault in HttpTunnel with flow control.
-   Author: bettydramit <b1...@gmail.com>.
+   Author: bettydramit <b1...@gmail.com>
 
   *) [TS-2454] Fix undefined reference to `__sync_fetch_and_sub_8' on ARM
    32bit system.


[37/50] git commit: TS-2271: Change the OpenSSL init + callbacks to use raw pthread functions

Posted by zw...@apache.org.
TS-2271: Change the OpenSSL init + callbacks to use raw pthread functions


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

Branch: refs/heads/5.0.x
Commit: 698db8bfbb26b0004651df79f1fc51618604bb11
Parents: 74af218
Author: Heikki Hannikainen <he...@hes.iki.fi>
Authored: Mon Dec 30 12:29:52 2013 +0200
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 2 08:39:00 2014 -0800

----------------------------------------------------------------------
 iocore/net/SSLUtils.cc | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/698db8bf/iocore/net/SSLUtils.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 5ddbc52..45682ef 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -81,7 +81,7 @@ struct ssl_ticket_key_t
 };
 
 static int ssl_session_ticket_index = 0;
-static ProxyMutex ** sslMutexArray;
+static pthread_mutex_t *mutex_buf = NULL;
 static bool open_ssl_initialized = false;
 
 struct ats_file_bio
@@ -106,11 +106,15 @@ private:
   ats_file_bio& operator=(const ats_file_bio&);
 };
 
+/* Using pthread thread ID and mutex functions directly, instead of
+ * ATS this_ethread / ProxyMutex, so that other linked libraries
+ * may use pthreads and openssl without confusing us here. (TS-2271).
+ */
+
 static unsigned long
 SSL_pthreads_thread_id()
 {
-  EThread *eth = this_ethread();
-  return (unsigned long) (eth->id);
+  return (unsigned long)pthread_self();
 }
 
 static void
@@ -119,9 +123,9 @@ SSL_locking_callback(int mode, int type, const char * /* file ATS_UNUSED */, int
   ink_assert(type < CRYPTO_num_locks());
 
   if (mode & CRYPTO_LOCK) {
-    MUTEX_TAKE_LOCK(sslMutexArray[type], this_ethread());
+    pthread_mutex_lock(&mutex_buf[type]);
   } else if (mode & CRYPTO_UNLOCK) {
-    MUTEX_UNTAKE_LOCK(sslMutexArray[type], this_ethread());
+    pthread_mutex_unlock(&mutex_buf[type]);
   } else {
     Debug("ssl", "invalid SSL locking mode 0x%x", mode);
     ink_assert(0);
@@ -298,10 +302,10 @@ SSLInitializeLibrary()
     SSL_load_error_strings();
     SSL_library_init();
 
-    sslMutexArray = (ProxyMutex **) OPENSSL_malloc(CRYPTO_num_locks() * sizeof(ProxyMutex *));
+    mutex_buf = (pthread_mutex_t *) OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
 
     for (int i = 0; i < CRYPTO_num_locks(); i++) {
-      sslMutexArray[i] = new_ProxyMutex();
+      pthread_mutex_init(&mutex_buf[i], NULL);
     }
 
     CRYPTO_set_locking_callback(SSL_locking_callback);


[03/50] git commit: fix another typo jpeach pointed out

Posted by zw...@apache.org.
fix another typo jpeach pointed out


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

Branch: refs/heads/5.0.x
Commit: 2548cbcf6ec840601355372fbb0f09be6d0a823d
Parents: 021d1a3
Author: Igor Galić <i....@brainsware.org>
Authored: Thu Dec 19 22:32:01 2013 +0100
Committer: Igor Galić <i....@brainsware.org>
Committed: Thu Dec 19 22:32:01 2013 +0100

----------------------------------------------------------------------
 .../adding-statistics/viewing-statistics-using-traffic-line.en.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2548cbcf/doc/sdk/adding-statistics/viewing-statistics-using-traffic-line.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/adding-statistics/viewing-statistics-using-traffic-line.en.rst b/doc/sdk/adding-statistics/viewing-statistics-using-traffic-line.en.rst
index 706deb0..0e8785e 100644
--- a/doc/sdk/adding-statistics/viewing-statistics-using-traffic-line.en.rst
+++ b/doc/sdk/adding-statistics/viewing-statistics-using-traffic-line.en.rst
@@ -18,7 +18,7 @@ Viewing Statistics Using Traffic Line
   specific language governing permissions and limitations
   under the License.
 
-.. XXX: This documentation seems to be dupplicated from the admin docs.
+.. XXX: This documentation seems to be duplicated from the admin docs.
 
 To view statistics for your plugin, follow the steps below:
 


[13/50] git commit: TS-2117 make hipes plugin build

Posted by zw...@apache.org.
TS-2117 make hipes plugin build


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

Branch: refs/heads/5.0.x
Commit: 65630cd93849ebfaa66f68c757770ac7a6dd6196
Parents: e7a1b8f
Author: Kit Chan <ki...@apache.org>
Authored: Thu Dec 26 08:59:28 2013 -0800
Committer: Kit Chan <ki...@apache.org>
Committed: Thu Dec 26 08:59:28 2013 -0800

----------------------------------------------------------------------
 plugins/experimental/hipes/hipes.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/65630cd9/plugins/experimental/hipes/hipes.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/hipes/hipes.cc b/plugins/experimental/hipes/hipes.cc
index 2f0cafa..03908b7 100644
--- a/plugins/experimental/hipes/hipes.cc
+++ b/plugins/experimental/hipes/hipes.cc
@@ -326,7 +326,7 @@ TSRemapDoRemap(void* ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
     TSDebug(PLUGIN_NAME, "Escaped service URL is %s(%d)", svc_url_esc, len);
 
     // Prepare the new query arguments, make sure it fits
-    if (( (slash - param) + 2 + h_conf->url_param.size() + len) > MAX_PATH_SIZE) {
+    if (( (slash - param) + 2 + (int) h_conf->url_param.size() + len) > MAX_PATH_SIZE) {
       TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG);
       return TSREMAP_NO_REMAP;
     }


[21/50] git commit: TS-2248 Segmentation fault HttpTunnel and throttling

Posted by zw...@apache.org.
TS-2248 Segmentation fault HttpTunnel and throttling

Reviews: amc and zwoop


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

Branch: refs/heads/5.0.x
Commit: 40a49e312afe6846869fa3ce2808aaf4f6eb078f
Parents: b36a7e1
Author: bettydramit <b1...@gmail.com>
Authored: Sat Dec 28 13:53:46 2013 -0700
Committer: Leif Hedstrom <le...@ogre.com>
Committed: Sat Dec 28 13:53:46 2013 -0700

----------------------------------------------------------------------
 proxy/http/HttpTunnel.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/40a49e31/proxy/http/HttpTunnel.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index 4ba3b33..ca2f60c 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -1190,15 +1190,14 @@ HttpTunnel::consumer_reenable(HttpTunnelConsumer* c)
     // greater) to the target, we use strict comparison only for
     // checking low water, otherwise the flow control can stall out.
     uint64_t backlog = (flow_state.enabled_p && p->is_source())
-      ? p->backlog(flow_state.high_water)
-      : 0;
+      ? p->backlog(flow_state.high_water) : 0;
 
     if (backlog >= flow_state.high_water) {
       if (is_debug_tag_set("http_tunnel"))
         Debug("http_tunnel", "Throttle   %p %" PRId64 " / %" PRId64, p, backlog, p->backlog());
       p->throttle(); // p becomes srcp for future calls to this method
     } else {
-      if (srcp && c->is_sink()) {
+      if (srcp && srcp->alive && c->is_sink()) {
         // Check if backlog is below low water - note we need to check
         // against the source producer, not necessarily the producer
         // for this consumer. We don't have to recompute the backlog


[27/50] git commit: TS-32: temp fix the overrun problem in PollDescriptor::alloc()

Posted by zw...@apache.org.
TS-32: temp fix the overrun problem in PollDescriptor::alloc()

may need better solution on pollfd.

Signed-off-by: Zhao Yongming <mi...@gmail.com>


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

Branch: refs/heads/5.0.x
Commit: 1d01716ceb2febf4fdcde2f2aae38f55e369d414
Parents: cf054cb
Author: Gota Adachi <ad...@iij.ad.jp>
Authored: Tue Dec 24 15:16:12 2013 +0800
Committer: Zhao Yongming <mi...@gmail.com>
Committed: Sun Dec 29 18:45:20 2013 +0800

----------------------------------------------------------------------
 iocore/net/P_UnixPollDescriptor.h | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d01716c/iocore/net/P_UnixPollDescriptor.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_UnixPollDescriptor.h b/iocore/net/P_UnixPollDescriptor.h
index f694670..af3d9e7 100644
--- a/iocore/net/P_UnixPollDescriptor.h
+++ b/iocore/net/P_UnixPollDescriptor.h
@@ -106,6 +106,10 @@ struct PollDescriptor
   Pollfd *alloc()
   {
 #if TS_USE_EPOLL
+    // XXX : We need restrict max size based on definition.
+    if (nfds >= POLL_DESCRIPTOR_SIZE) {
+      nfds = 0;
+    }
     return &pfd[nfds++];
 #else
     return 0;


[41/50] git commit: TS-2468: bring back the load balancer plugin

Posted by zw...@apache.org.
TS-2468: bring back the load balancer plugin

Rework the load balancer plugin, to remove ties to Yahoo internal
infrastructure and make a simple balancer plugin with no external
dependencies.


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

Branch: refs/heads/5.0.x
Commit: 0a6ae3b89cdfd08ef1a18a5f4d379d73ed858632
Parents: 96abfc7
Author: James Peach <jp...@apache.org>
Authored: Sun Dec 22 19:55:19 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 2 13:43:10 2014 -0800

----------------------------------------------------------------------
 CHANGES                                     |   2 +
 configure.ac                                |   1 +
 doc/reference/plugins/balancer.en.rst       | 117 +++---
 plugins/experimental/Makefile.am            |   1 +
 plugins/experimental/balancer/Makefile.am   |  22 ++
 plugins/experimental/balancer/README        |  93 -----
 plugins/experimental/balancer/balancer.cc   | 443 ++++-------------------
 plugins/experimental/balancer/balancer.h    |  46 +++
 plugins/experimental/balancer/hash.cc       | 207 +++++++++++
 plugins/experimental/balancer/hashkey.h     | 254 -------------
 plugins/experimental/balancer/resources.h   | 111 ------
 plugins/experimental/balancer/roundrobin.cc |  72 ++++
 12 files changed, 479 insertions(+), 890 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 464e054..6d01fca 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2468] Bring back the load balancer plugin.
+
   *) [TS-2465] libxml2 detection generates an invalid linker path.
    Author: Radim Kolar <hs...@sendmail.cz>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 296246d..fdc88ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1922,6 +1922,7 @@ AC_CONFIG_FILES([
   plugins/conf_remap/Makefile
   plugins/experimental/Makefile
   plugins/experimental/authproxy/Makefile
+  plugins/experimental/balancer/Makefile
   plugins/experimental/buffer_upload/Makefile
   plugins/experimental/channel_stats/Makefile
   plugins/experimental/custom_redirect/Makefile

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/doc/reference/plugins/balancer.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/balancer.en.rst b/doc/reference/plugins/balancer.en.rst
index 43aa3ed..a31c1aa 100644
--- a/doc/reference/plugins/balancer.en.rst
+++ b/doc/reference/plugins/balancer.en.rst
@@ -21,68 +21,55 @@ Balancer Plugin
   under the License.
 
 
-This is a plugin for Traffic Server, that allows you to configure
-mapping rules.
-
-To use this plugin, configure a remap.config rule like this::
-
-   map http://foo.com http://bar.com @plugin=balancer.so @pparam=rotation:news
-
-The "To-Url" in the remap.config rule is generally not used, unless the
-lookup completely fails (i.e. this is a backup URL for extreme error
-cases).
-
-This is a list of all available options (set via @pparam)::
-
-    rotation      The name of the rotation (e.g. news) [to-host in remap]
-    hash      What to hash on, url, path, cookie, ip, header (primary)
-    hash2     Optional, secondary hash, to hash within a multi-host bucket
-    bucketw   Width of each hash bucket [1]
-
-The rotation parameter specifies which rotation to do the lookup on. If
-not specified, we will default to the same name as used in the To URL in
-the remap rule.
-
-The bucket width specifies how many hosts a particular hash bucket
-should contain, for example::
-
-    @pparam=bucketw:2
-
-The hash parameter can be used zero or more times, without it, no
-hashing is done at all. If you have more than one hash keys, they are
-concatenated in the order specified. For example::
-
-    @pparam=hash:ip @pparam=hash:cookie/B
-
-The "header" hash key takes a required extra value, for example::
-
-    @pparam=hash:header/Host
-
-For "cookie" hash keys, you can optionally specify an identifier for
-which cookie to use (without it, the entire cookie header is used). For
-example::
-
-    @pparam=hash:cookie/B
-
-The secondary hash ("hash2") is used to provide "stickiness" within a
-bucket that's larger than one host (i.e. bucketw > 1). This allows you
-to (for example) have a primary hash on the URL, where each URL is
-served by some number of servers. A secondary hash on B-cookie would
-then provide user stickiness, so that for a particular URL, a particular
-user will always hit the same server.
-
-If the hashes you've requested (either "hash" or "hash2") can not be
-generated, we default to using the URL instead for the primary hash. For
-the secondary hash, if set, we'll default to the src-IP. If these
-defaults are not desirable, make sure that you have at least one hash
-key that is guaranteed to exist (e.g. @pparam=hash:ip).
-
-If no "hash" parameters are specified, no hashing is done. This is the
-default behavior, obviously. In this cash, the "hash2" directive has no
-effect as well.
-
-Finally, a couple of "flag" options (parameters) are available, to
-control some of the lookup mechanisms:
-
--  @pparam=hostip will use the IP returned by the lookup
-
+The ``balancer`` balances requests across multiple origin servers.
+To use this plugin, configure it in a :file:`remap.config` rule, specifying
+a balancing policy and a set of origin servers. For example::
+
+   map http://foo.com http://foo.com \
+      @plugin=balancer.so @pparam=--policy=hash,url @pparam=one.bar.com @pparam=two.bar.com
+
+The ``replacement`` URL in the mapping rule is not used. The argument
+to the ``--policy`` option is a comma-separated list of keywords.
+The first keyword is the name of a balancing policy. The subsequent
+keywords are used to refine the requested policy.
+
+Hash Balancing Policy
+---------------------
+
+The ``hash`` balancing policy performs a consistent hash across the
+set of origins. This minimizes the number of hash entries that must
+be moved when the set of origin servers changes. An optional list
+of hash fields follows the ``hash`` keyword. Each specified hash
+field is hashed to select an outbound origin server.
+
+The following fields can be supplied to the hash:
+
+key
+  The request cache key. Note that the cache key will only be
+  set if you have already chained a plugin that sets a custom
+  cache key.
+
+url
+  The request URL. This is the default hash field that is used if
+  no other fields are specified.
+
+srcaddr
+  The source IP address of the request.
+
+Round Robin Balancing Policy
+----------------------------
+
+The ``roundrobin`` balancing policy simply allocates requests to
+origin servers in order. Over time, the number of requests received
+by each origin should be approximately the same.
+
+Health Checking
+---------------
+
+The ``balancer`` plugin does not check the health of the origin
+servers, however the plugin is fully reloadable so health checking
+is usualy simple to implement. Most production environments already
+have mechanisms to check service health. It is recommended that you
+write a simple script to monitor this information and rewrite
+:file:`remap.config` when appropriate. Running :option:`traffic_line -x`
+will reload the ``balancer`` plugin with the new set of origin servers.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/Makefile.am b/plugins/experimental/Makefile.am
index 7b4da79..fae383d 100644
--- a/plugins/experimental/Makefile.am
+++ b/plugins/experimental/Makefile.am
@@ -18,6 +18,7 @@ if BUILD_EXPERIMENTAL_PLUGINS
 
 SUBDIRS = \
  authproxy \
+ balancer \
  buffer_upload \
  channel_stats \
  custom_redirect \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/Makefile.am b/plugins/experimental/balancer/Makefile.am
new file mode 100644
index 0000000..02df2b9
--- /dev/null
+++ b/plugins/experimental/balancer/Makefile.am
@@ -0,0 +1,22 @@
+#  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
+#
+#      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.
+
+include $(top_srcdir)/build/plugins.mk
+
+pkglib_LTLIBRARIES = balancer.la
+balancer_la_SOURCES = balancer.cc roundrobin.cc hash.cc balancer.h
+balancer_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
+

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/README
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/README b/plugins/experimental/balancer/README
deleted file mode 100644
index 4aaaaa1..0000000
--- a/plugins/experimental/balancer/README
+++ /dev/null
@@ -1,93 +0,0 @@
-This is a plugin for Traffic Server, that allows you to
-configure mapping rules. 
-
-To use this plugin, configure a remap.config rule like
-
-   map http://foo.com http://bar.com @plugin=balancer.so @pparam=rotation:news
-
-
-The "To-Url" in the remap.config rule is generally not used, unless the
-lookup completely fails (i.e. this is a backup URL for extreme error
-cases).
-
-
-This is a list of all available options (set via @pparam):
-
-
-    rotation  	  The name of the rotation (e.g. news) [to-host in remap]
-    hash	  What to hash on, url, path, cookie, ip, header (primary)
-    hash2	  Optional, secondary hash, to hash within a multi-host bucket
-    bucketw	  Width of each hash bucket [1]
-
-
-The rotation parameter specifies which rotation to do the lookup
-on. If not specified, we will default to the same name as used in the To
-URL in the remap rule.
-
-The bucket width specifies how many hosts a particular hash bucket
-should contain, for example:
-
-    @pparam=bucketw:2
-
-The hash parameter can be used zero or more times, without it, no hashing
-is done at all. If you have more than one hash keys, they are concatenated
-in the order specified. For example:
-
-    @pparam=hash:ip @pparam=hash:cookie/B
-
-The "header" hash key takes a required extra value, for example:
-
-    @pparam=hash:header/Host
-
-
-For "cookie" hash keys, you can optionally specify an identifier for which
-cookie to use (without it, the entire cookie header is used). For example:
-
-    @pparam=hash:cookie/B
-
-
-The secondary hash ("hash2") is used to provide "stickiness" within a
-bucket that's larger than one host (i.e. bucketw > 1). This allows you to
-(for example) have a primary hash on the URL, where each URL is served by
-some number of servers. A secondary hash on B-cookie would then provide
-user stickiness, so that for a particular URL, a particular user will
-always hit the same server.
-
-If the hashes you've requested (either "hash" or "hash2") can not be
-generated, we default to using the URL instead for the primary hash. For
-the secondary hash, if set, we'll defaul to the src-IP. If these defaults
-are not desirable, make sure that you have at least one hash key that is
-guaranteed to exist (e.g. @pparam=hash:ip).
-
-If no "hash" parameters are specified, no hashing is done. This is the
-default behavior, obviously. In this cash, the "hash2" directive has no
-effect as well.
-
-Finally, a couple of "flag" options (parameters) are available, to control
-some of the lookup mechanisms:
-
-   - @pparam=hostip  will use the IP returned by the lookup
-
-
-RELEASES
---------
-
-Version 1.3.0 (8/23/10)
-  - Fix off-by-one error when using IPs in the rewrite rules.
-  - More efficient (and correct) management of various request resources.
-
-Version 1.2.2 (6/15/09)
-  - Fixed the build system.
-  - Fixed the package info.
-
-Version 1.2 (5/31/09)
-  - Some code cleanup to make Coverity happy.
-  - Added the @pparam=hostip to use the IP returned from the lookup
-  instead of the host name.
-
-Version 1.1 (5/8/09)
-  - Changed all calls to use lookup() directly.
-  - Fixed a bug with wrong size to MD5 calculations.
-
-Version 1.0 (4/28/09)
-  - Initial version, moderately tested...

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/balancer.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/balancer.cc b/plugins/experimental/balancer/balancer.cc
index adc91ad..ea5150a 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -21,403 +21,112 @@
   limitations under the License.
  */
 
-//////////////////////////////////////////////////////////////////////////////////////////////
-// Plugin to do routing decisions
-// -----------
-//
-// To use this plugin, configure a remap.config rule like
-//
-//   map http://foo.com http://bar.com @plugin=balancer.so @pparam=rotation:news1
-//
-// For full description of all available options, please visit the Twiki or Dist docs.
-//
-//
-// Note that the path to the plugin itself must be absolute, and by default it is
-//
-//
-
-
-#include <netdb.h>
-
-#include <string>
-
+#include "balancer.h"
 #include <ts/remap.h>
-#include <ts/ts.h>
-
-#include "resources.h"
-#include "hashkey.h"
+#include <getopt.h>
+#include <string.h>
+#include <functional>
 
-
-static int MAX_HASH_KEY_VALUES = 16;
-static int MD5_DIGEST_LENGTH = 16;
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Class encapsulating one configuration / setup.
-//
-struct KeyData
+// The policy type is the first comma-separated token.
+static BalancerInstance *
+MakeBalancerInstance(const char * opt)
 {
-  const void* data;
-  int len;
-};
-
-class BalancerInstance
-{
-public:
-  BalancerInstance(HashKey* hash=NULL, HashKey* hash2=NULL) :
-    _first_hash(hash), _second_hash(hash2),  _bucket_hosts(0), _rotation(NULL),
-    _host_ip(false)
-  { };
-
-  ~BalancerInstance()
-  {
-    HashKey* tmp;
-
-    while (_first_hash) {
-      tmp = _first_hash->next;
-      delete _first_hash;
-      _first_hash = tmp;
-    }
-    if (_rotation)
-      TSfree(_rotation);
-  };
+  const char * end = strchr(opt, ',');
+  size_t len = end ? std::distance(opt, end) : strlen(opt);
 
-  // Some simple setters and getters
-  void set_host_ip() { _host_ip = true; };
-  bool host_ip() const { return _host_ip; };
-
-  char* rotation() const { return _rotation; };
-  void set_rotation(const std::string& rot) {
-    if (rot.size() > 255) {
-      TSError("Rotation name is too long");
-      return;
-    }
-    _rotation = TSstrdup(rot.c_str());
-  }
-
-  int bucket_hosts() const { return _bucket_hosts; };
-  void set_bucket_hosts(const std::string& width) {
-    _bucket_hosts = atoi(width.c_str());
-  }
-
-  bool has_primary_hash() const { return (_first_hash != NULL); }
-  bool has_secondary_hash() const { return (_second_hash != NULL); }
-  void append_hash(HashKey* hash, bool secondary = false) {
-    if (secondary) {
-      if (_second_hash) {
-        _second_hash->append(hash);
-      } else {
-        _second_hash = hash;
-      }
-    } else {
-      if (_first_hash) {
-        _first_hash->append(hash);
-      } else {
-        _first_hash = hash;
-      }
-    }
-  };
-
-  void make_hash_key(char* id, bool secondary, Resources& resr) {
-    HashKey* hk = secondary ? _second_hash : _first_hash;
-
-    if (hk) {
-      KeyData keys[MAX_HASH_KEY_VALUES];
-      int ix = 0;
-      int key_len = 0;
-
-      do {
-        keys[ix].len = hk->key(&(keys[ix].data), resr);
-        if (keys[ix].len > 0)
-          key_len += keys[ix].len;
-        ++ix;
-      } while ((hk = hk->next));
-
-      // Now create the buffer and copy over all the hash values.
-      if (key_len > 0) {
-        char buf[key_len + 1];
-        char* p = buf;
-
-        hk = secondary ? _second_hash : _first_hash;
-        for (int i = 0; i < ix; ++i) {
-          if ((keys[i].len > 0) && keys[i].data) {
-            memcpy(p, keys[i].data, keys[i].len);
-            p += keys[i].len;
-          }
-          hk->free_key(keys[i].data, keys[i].len, resr); // Cleanup some private data (possibly)
-          hk = hk->next;
-        }
-        *p = '\0';
-        if (TSIsDebugTagSet("balancer")) {
-          TSDebug("balancer", "Making %s hash ID's using %s", secondary ? "secondary" : "primary", buf);
-        }
-        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
-
-          TSDebug("balancer", "Making secondary hash ID's using IP (default) = %s", buf);
-          ycrMD5_r(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];
-
-          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);
-          ycrMD5_r(buf, key_len, id);
-        }
-      }
-    } else {
-      *id = '\0';
-    }
+  if (len == lengthof("hash") && strncmp(opt, "hash", len) == 0) {
+    return MakeHashBalancer(end ? end + 1 : NULL);
+  } else if (len == lengthof("roundrobin") && strncmp(opt, "roundrobin", len) == 0) {
+    return MakeRoundRobinBalancer(end ? end + 1 : NULL);
+  } else {
+    TSError("balancer: invalid balancing policy '%.*s'", (int)len, opt);
+    return NULL;
   }
 
+}
 
-private:
-  HashKey* _first_hash;
-  HashKey* _second_hash;
-  int _bucket_hosts;
-  char* _rotation;
-  bool _host_ip;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Initialize the plugin.
-//
-int
-tsremap_init(TSREMAP_INTERFACE *api_info, char *errbuf, int errbuf_size)
+TSReturnCode
+TSRemapInit(TSRemapInterface * /* api */, char * /* errbuf */, int /* bufsz */)
 {
-  if (!api_info) {
-    strncpy(errbuf, "[tsremap_init] - Invalid TSREMAP_INTERFACE argument", errbuf_size - 1);
-    return -1;
-  }
-
-  if (api_info->size < sizeof(TSREMAP_INTERFACE)) {
-    strncpy(errbuf, "[tsremap_init] - Incorrect size of TSREMAP_INTERFACE structure", errbuf_size - 1);
-    return -2;
-  }
-
-  if (api_info->tsremap_version < TSREMAP_VERSION) {
-    snprintf(errbuf, errbuf_size - 1, "[tsremap_init] - Incorrect API version %ld.%ld",
-             api_info->tsremap_version >> 16, (api_info->tsremap_version & 0xffff));
-    return -3;
-  }
-
-  TSDebug("balancer", "plugin is successfully initialized");
-  return 0;
+  return TS_SUCCESS;
 }
 
-
 ///////////////////////////////////////////////////////////////////////////////
 // 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 ** instance, char * errbuf, int errbuf_size)
 {
-  BalancerInstance* ri = new BalancerInstance;
+  static const struct option longopt[] = {
+    { const_cast<char *>("policy"), required_argument, 0, 'p' },
+    {0, 0, 0, 0 }
+  };
 
-  *ih = static_cast<ihandle>(ri);
+  BalancerInstance * balancer = NULL;
+
+  // The first two arguments are the "from" and "to" URL string. We need to
+  // skip them, but we also require that there be an option to masquerade as
+  // argv[0], so we increment the argument indexes by 1 rather than by 2.
+  argc--;
+  argv++;
+
+  optind = 0;
+  for (;;) {
+    int opt;
+
+    opt = getopt_long(argc, (char * const *)argv, "", longopt, NULL);
+    switch (opt) {
+    case 'p':
+      balancer = MakeBalancerInstance(optarg);
+      break;
+    case -1:
+      break;
+    default:
+      snprintf(errbuf, errbuf_size, "invalid balancer option '%d'", opt);
+      return TS_ERROR;
+    }
 
-  if (ri == NULL) {
-    TSError("Unable to create remap instance");
-    return -5;
+    if (opt == -1) {
+        break;
+    }
   }
 
-  for (int ix=2; ix < argc; ++ix) {
-    std::string arg = argv[ix];
-
-    // Check "flags" first, they take no additional arguments
-    if (arg.compare(0, 6, "hostip") ==  0) {
-      ri->set_host_ip();
-    } else {
-      std::string::size_type sep = arg.find_first_of(":");
-
-      if (sep == std::string::npos) {
-        TSError("Malformed options in balancer: %s", argv[ix]);
-      } else {
-        std::string arg_val = arg.substr(sep + 1, std::string::npos);
-
-        if (arg.compare(0, 8, "rotation") == 0) {
-          ri->set_rotation(arg_val);
-        } else if (arg.compare(0, 7, "bucketw") == 0) {
-          ri->set_bucket_hosts(arg_val);
-        } else if (arg.compare(0, 4, "hash") == 0) {
-          bool secondary = !arg.compare(0, 5, "hash2");
-
-          if (arg_val.compare(0, 3, "url") == 0) {
-            URLHashKey* hk = new URLHashKey();
-
-            if (NULL == hk) {
-              TSError("Couldn't create balancer URL hash key");
-            } else {
-              ri->append_hash(hk, secondary);
-            }
-          } else if (arg_val.compare(0, 4, "path") == 0) {
-            PathHashKey* hk = new PathHashKey();
-
-            if (NULL == hk) {
-              TSError("Couldn't create balancer path hash key");
-            } else {
-              ri->append_hash(hk, secondary);
-            }
-          } else if (arg_val.compare(0, 2, "ip") == 0) {
-            IPHashKey* hk = new IPHashKey();
-
-            if (NULL == hk) {
-              TSError("Couldn't create balancer IP hash key");
-            } else {
-              ri->append_hash(hk, secondary);
-            }
-          } else {
-            // The hash parameter can take a second argument
-            std::string::size_type sep2 = arg_val.find_first_of("/");
-
-            if (sep2 == std::string::npos) {
-              TSError("Malformed hash options in balancer: %s", argv[ix]);
-            } else {
-              std::string arg_val2 = arg_val.substr(sep2 + 1, std::string::npos);
-
-              if (arg_val.compare(0, 6, "cookie") == 0) {
-                CookieHashKey* hk = new CookieHashKey(arg_val2);
-
-                if (NULL == hk) {
-                  TSError("Couldn't create balancer cookie hash key");
-                } else {
-                  ri->append_hash(hk, secondary);
-                }
-              } else if (arg_val.compare(0, 6, "header") == 0) {
-                HeaderHashKey* hk = new HeaderHashKey(arg_val2);
+  if (!balancer) {
+    strncpy(errbuf, "missing balancer policy", errbuf_size);
+    return TS_ERROR;
+  }
 
-                if (NULL == hk) {
-                  TSError("Couldn't create balancer header hash key");
-                } else {
-                  ri->append_hash(hk, secondary);
-                }
-              } else {
-                TSError("Unknown balancer hash option: %s", argv[ix]);
-              }
-            }
-          }
-        } else {
-          TSError("Unknown balancer option: %s", argv[ix]);
-        }
-      }
-    }
+  // Pick up the remaining options as balance targets.
+  for (int i = optind; i < argc; ++i) {
+    balancer->push_target(argv[i]);
   }
 
-  return 0;
+  *instance = balancer;
+  return TS_SUCCESS;
 }
 
 void
-tsremap_delete_instance(ihandle ih)
+TSRemapDeleteInstance(void * instance)
 {
-  BalancerInstance* ri = static_cast<BalancerInstance*>(ih);
-
-  delete ri;
+  delete (BalancerInstance *)instance;
 }
 
-
-///////////////////////////////////////////////////////////////////////////////
-// 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 * instance, TSHttpTxn txn, TSRemapRequestInfo * rri)
 {
-  BalancerInstance* balancer;
-  int error = 0;
-  int port = 0;
-  char resbuf[256 + 256 * sizeof(in_addr_t)];
-  struct hostent* res = NULL;
-  char rotation[256];
-  char *rot;
-
-  if (NULL == ih) {
-    TSDebug("balancer", "Falling back to default URL on remap without rules");
-    return 0;
-  }
-  balancer = static_cast<BalancerInstance*>(ih);
-
-  // Get the rotation name to use.
-
-  if (balancer->rotation()) {
-    rot = balancer->rotation();
-  } else {
-    if (rri->remap_from_host_size > 255) {
-      memcpy(rotation, rri->remap_from_host, 255);
-      rotation[255] = '\0';
-    } else {
-      memcpy(rotation, rri->remap_from_host, rri->remap_from_host_size);
-      rotation[rri->remap_from_host_size] = '\0';
-    }
-    rot = rotation;
-  }
-
-  // Setup the basic info
-  memset(&balancer_info, 0, sizeof(balancer_info));
-  balancer_info.flags = BALANCER_LOOKUP_NOCHECK;   // Make sure we don't trigger a balancer health check
-  balancer_info.errp = &balancer_error;
-  balancer_info.port = &balancer_port;
-  balancer_info.resbuf = &balancer_resbuf;
-  balancer_info.resbuf_len = sizeof(balancer_resbuf);
-
-  if (balancer->has_primary_hash()) {
-    char id1[MD5_DIGEST_LENGTH+1];
-    Resources resr((TSHttpTxn)rh, rri);
-    
-    balancer_info.num_bucket_hosts = balancer->bucket_hosts();
+  BalancerInstance * balancer = (BalancerInstance *)instance;
+  const char * target;
 
-    balancer->make_hash_key(id1, false, resr);
-    balancer_info.primary_id = id1;
-    balancer_info.primary_id_len = MD5_DIGEST_LENGTH;
-
-    if (balancer->has_secondary_hash()) {
-      char id2[MD5_DIGEST_LENGTH+1];
-
-      balancer->make_hash_key(id2, true, resr);
-      balancer_info.secondary_id = id2;
-      balancer_info.secondary_id_len = MD5_DIGEST_LENGTH;
-
-      TSDebug("balancer", "Calling balancer_lookup(\"%s\") with primary and secondary hash", rot);
-      res = balancer_lookup(rot, &balancer_info);
-    } else {
-      TSDebug("balancer", "Calling balancer_lookup(\"%s\") with primary hash", rot);
-      res = balancer_lookup(rot, &balancer_info);
-    }
-  } else {
-    TSDebug("balancer", "Calling balancer_lookup(\"%s\") without hash", rot);
-    res = balancer_lookup(rot, &balancer_info);
-  }
-
-  // Check (and use) the balancer lookup results
-  if (!res) {
-    TSDebug("balancer", "BALANCER has no data for %s, using To-URL (error is %d)", rot, balancer_error);
-    return 0;
-  } else {
-    if ((balancer_port > 0) && (balancer_port != rri->remap_to_port)) {
-      rri->new_port = balancer_port;
-      TSDebug("balancer", "Changing request to port %d", balancer_port);
-    }
-    if (balancer->host_ip()) {
-      unsigned char *ip = (unsigned char*)res->h_addr;
-
-      rri->new_host_size = snprintf(rri->new_host, 16, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
-      TSDebug("balancer", "Setting real-host IP to %.*s (IP for %s)", rri->new_host_size, rri->new_host, res->h_name);
-    } else {
-      TSDebug("balancer", "Setting real-host to %s", res->h_name);
-      rri->new_host_size = strlen(res->h_name);
-      if (rri->new_host_size > TSREMAP_RRI_MAX_HOST_SIZE)
-        rri->new_host_size = TSREMAP_RRI_MAX_HOST_SIZE;
-      memcpy(rri->new_host, res->h_name, rri->new_host_size);
-    }
+  target = balancer->balance(txn, rri);
+  if (TSIsDebugTagSet("balancer")) {
+    char * url;
+    int len;
 
-    return 1;
+    url = TSHttpTxnEffectiveUrlStringGet(txn, &len);
+    TSDebug("balancer", "%s <- %.*s", target, len, url);
+    TSfree(url);
   }
 
-  // Shouldn't happen
-  return 0;
+  TSUrlHostSet(rri->requestBufp, rri->requestUrl, target, -1);
+  return TSREMAP_DID_REMAP;
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/balancer.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/balancer.h b/plugins/experimental/balancer/balancer.h
new file mode 100644
index 0000000..710e629
--- /dev/null
+++ b/plugins/experimental/balancer/balancer.h
@@ -0,0 +1,46 @@
+/** @file
+ *
+ *  A brief file description
+ *
+ *  @section license License
+ *
+ *  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
+ *
+ *      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.
+ */
+
+#ifndef BALANCER_H_29177589_32F1_4D93_AE4F_1E140EDCC273
+#define BALANCER_H_29177589_32F1_4D93_AE4F_1E140EDCC273
+
+#include <ts/ts.h>
+#include <ts/remap.h>
+
+// Return the length of a string literal.
+template <int N> unsigned
+lengthof(const char (&)[N]) {
+  return N - 1;
+}
+
+struct BalancerInstance
+{
+  virtual ~BalancerInstance() {}
+  virtual void push_target(const char *) = 0;
+  virtual const char * balance(TSHttpTxn, TSRemapRequestInfo *) = 0;
+};
+
+BalancerInstance * MakeHashBalancer(const char *);
+BalancerInstance * MakeRoundRobinBalancer(const char *);
+
+#endif /* BALANCER_H_29177589_32F1_4D93_AE4F_1E140EDCC273 */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/hash.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/hash.cc b/plugins/experimental/balancer/hash.cc
new file mode 100644
index 0000000..f6595a8
--- /dev/null
+++ b/plugins/experimental/balancer/hash.cc
@@ -0,0 +1,207 @@
+/** @file
+ *
+ *  A brief file description
+ *
+ *  @section license License
+ *
+ *  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
+ *
+ *      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.
+ */
+
+#include "balancer.h"
+#include <stdlib.h>
+#include <openssl/md5.h>
+#include <netinet/in.h>
+#include <string.h>
+#include <map>
+#include <string>
+#include <vector>
+
+namespace {
+
+size_t
+sockaddrlen(const struct sockaddr * sa)
+{
+  switch (sa->sa_family) {
+    case AF_INET: return sizeof(struct sockaddr_in);
+    case AF_INET6: return sizeof(struct sockaddr_in6);
+    default: TSReleaseAssert(0 && "unsupported socket type");
+  }
+}
+
+struct md5_key {
+
+  md5_key() {}
+
+  md5_key(const std::string& str, unsigned i) {
+    MD5_CTX ctx;
+
+    MD5_Init(&ctx);
+    MD5_Update(&ctx, str.data(), str.size());
+    MD5_Update(&ctx, &i, sizeof(i));
+    MD5_Final(this->key, &ctx);
+  }
+
+  bool operator < (const md5_key& rhs) const {
+    return memcmp(this->key, rhs.key, sizeof(this->key)) < 0;
+  }
+
+  unsigned char key[MD5_DIGEST_LENGTH];
+};
+
+typedef void (*HashComponent)(TSHttpTxn txn, TSRemapRequestInfo *, MD5_CTX *);
+
+// Hash on the source IP address;
+void
+HashTxnSrcaddr(TSHttpTxn txn, TSRemapRequestInfo *, MD5_CTX * ctx)
+{
+  struct sockaddr const * sa;
+
+  sa = TSHttpTxnIncomingAddrGet(txn);
+  if (txn) {
+    MD5_Update(ctx, sa, sockaddrlen(sa));
+    TSDebug("balancer", "%s(addr[%zu]]", __func__, sockaddrlen(sa));
+  }
+}
+
+// Hash on the request URL.
+void
+HashTxnUrl(TSHttpTxn txn, TSRemapRequestInfo *, MD5_CTX * ctx)
+{
+  char * url;
+  int len;
+
+  url = TSHttpTxnEffectiveUrlStringGet(txn, &len);
+  if (url && len) {
+    MD5_Update(ctx, url, len);
+    TSDebug("balancer", "%s(%.*s)", __func__, len, url);
+  }
+
+  TSfree(url);
+}
+
+// Hash on the cache key. This is not typically set at remap time, unless by another plugin.
+void
+HashTxnKey(TSHttpTxn txn, TSRemapRequestInfo * rri , MD5_CTX * ctx)
+{
+  TSMLoc  url = TS_NULL_MLOC;
+  char *  str = NULL;
+  int     len;
+
+  if (TSUrlCreate(rri->requestBufp, &url) != TS_SUCCESS) {
+    goto done;
+  }
+
+  if (TSHttpTxnCacheLookupUrlGet(txn, rri->requestBufp, url) != TS_SUCCESS) {
+    TSDebug("balancer", "no cache key");
+    goto done;
+  }
+
+  str = TSUrlStringGet(rri->requestBufp, url, &len);
+  if (str && len) {
+    TSDebug("balancer", "%s(%.*s)", __func__, len, str);
+    MD5_Update(ctx, str, len);
+  }
+
+done:
+  if (url != TS_NULL_MLOC) {
+    TSHandleMLocRelease(rri->requestBufp, TS_NULL_MLOC, url);
+  }
+
+  TSfree(str);
+}
+
+struct HashBalancer : public BalancerInstance
+{
+  typedef std::map<md5_key, std::string>  hash_ring_type;
+  typedef std::vector<HashComponent>      hash_part_type;
+
+  enum { iterations = 10 };
+
+  HashBalancer() {
+    this->hash_parts.push_back(HashTxnUrl);
+  }
+
+  void push_target(const char * target) {
+    for (unsigned i = 0; i < iterations; ++i) {
+      this->hash_ring.insert(std::make_pair(md5_key(target, i), target));
+    }
+  }
+
+  const char * balance(TSHttpTxn txn, TSRemapRequestInfo * rri) {
+    md5_key key;
+    MD5_CTX ctx;
+    hash_ring_type::const_iterator loc;
+
+    // We'd better have some hash functions set by now ...
+    TSReleaseAssert(!hash_parts.empty());
+
+    MD5_Init(&ctx);
+
+    for (hash_part_type::const_iterator i = this->hash_parts.cbegin(); i != this->hash_parts.cend(); ++i) {
+      (*i)(txn, rri, &ctx);
+    }
+
+    MD5_Final(key.key, &ctx);
+
+    // OK, now look up this hash in the hash ring. lower_bound() finds the first element that is not less than the
+    // target, so the element we find is the first key that is greater than our target. To visualize this in the
+    // hash ring, that means that each node owns the preceeding keyspace (ie. the node is at the end of each keyspace
+    // range). This means that when we wrap, the first node owns the wrapping portion of the keyspace.
+    loc = this->hash_ring.lower_bound(key);
+    if (loc == this->hash_ring.end()) {
+      loc = this->hash_ring.begin();
+    }
+
+    return loc->second.c_str();
+  }
+
+  hash_ring_type hash_ring;
+  hash_part_type hash_parts;
+};
+
+} // namespace
+
+BalancerInstance *
+MakeHashBalancer(const char * options)
+{
+  HashBalancer * hash = new HashBalancer();
+  char * opt;
+  char * tmp;
+
+  TSDebug("balancer", "making hash balancer with options '%s'", options);
+
+  if (options) {
+    hash->hash_parts.clear(); // clear the default hash type if we have options
+    options = tmp = strdup(options);
+    while ((opt = strsep(&tmp, ",")) != NULL) {
+      if (strcmp(opt, "key") == 0) {
+        hash->hash_parts.push_back(HashTxnKey);
+      } else if (strcmp(opt, "url") == 0) {
+        hash->hash_parts.push_back(HashTxnUrl);
+      } else if (strcmp(opt, "srcaddr") == 0) {
+        hash->hash_parts.push_back(HashTxnSrcaddr);
+      } else {
+        TSError("balancer: ignoring invalid hash field '%s'", opt);
+      }
+    }
+
+    free((void *)options);
+  }
+
+  return hash;
+}
+

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/hashkey.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/hashkey.h b/plugins/experimental/balancer/hashkey.h
deleted file mode 100644
index f4b516a..0000000
--- a/plugins/experimental/balancer/hashkey.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  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
-
-      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.
- */
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-// 
-// Implement the classes for the various types of hash keys we support.
-//
-#ifndef __HASHKEY_H__
-#define __HASHKEY_H__ 1
-
-
-#include <string>
-
-#include <ts/remap.h>
-#include <ts/ts.h>
-
-#include "resources.h"
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Base class for all HashKeys
-//
-class HashKey
-{
-public:
-  HashKey() :
-    next(NULL)
-  { }
-
-  virtual ~HashKey()
-  { }
-
-
-  // Return the number of bytes of data to use from the data pointer. If we
-  // return (-1), no data is available for this particular request.
-  virtual int key(const void** data, Resources& resr) const = 0;
-
-  virtual void free_key(const void* data, int len, Resources& resr) const {
-    // No-op by default
-  }
-
-  void append(HashKey* hash) {
-    TSReleaseAssert(hash->next == NULL);
-
-    if (NULL == next) {
-      next = hash;
-    } else {
-      HashKey* tmp = next;
-
-      while (tmp->next)
-        tmp = next->next;
-
-      tmp->next = hash;
-    }
-  }
-
-  HashKey* next;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Class for a URL based Hash Key. Set the data pointer to the full URL.
-//
-class URLHashKey : public HashKey
-{
- public:
-  int
-  key(const void** data, Resources& resr) const {
-    *data = resr.getRRI()->orig_url;
-    return resr.getRRI()->orig_url_size;
-  }
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Class for a Path based Hash Key. Set the data pointer to the path only.
-//
-class PathHashKey : public HashKey
-{
- public:
-  int
-  key(const void** data, Resources& resr) const {
-    *data = resr.getRRI()->request_path;
-    return resr.getRRI()->request_path_size;
-  }
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Class for a Cookie based Hash Key. Set the data pointer to the Cookie
-// selected, or NULL if not available.
-//
-class CookieHashKey : public HashKey
-{
- public:
-  CookieHashKey(const std::string cookie) {
-    std::string::size_type dot = cookie.find_first_of(".");
-
-    if (dot != std::string::npos) {
-      std::string tmp;
-
-      tmp = cookie.substr(0, dot);
-      _main = TSstrdup(tmp.c_str());
-      _main_len = dot;
-      tmp = cookie.substr(dot + 1);
-      if (tmp.size() > 0) {
-        _sub = TSstrdup(tmp.c_str());
-        _sub_len = cookie.size() - dot - 1;
-      } else {
-        _sub = NULL;
-        _sub_len = 1;
-      }
-    } else {
-      _main = TSstrdup(cookie.c_str());
-      _main_len = cookie.size();
-      _sub = NULL;
-      _sub_len = 0;
-    }
-  }
-
-  ~CookieHashKey() {
-    if (_main)
-      TSfree(const_cast<char*>(_main));
-    if (_sub)
-      TSfree(const_cast<char*>(_sub));
-  }
-
-  int
-  key(const void** data, Resources& resr) const {
-    if (_main) {
-      if (resr.getJar()) {
-        const char* cookie;
-
-        if (_sub) {
-          cookie = // TODO - get sub cookie
-        } else {
-          cookie = // TODO - get full cookie
-        }
-        if (cookie) {
-          *data = cookie;
-          return strlen(cookie);
-        }
-      }
-    } else {
-      if (resr.getRRI()->request_cookie_size > 0) {
-        *data = resr.getRRI()->request_cookie;
-        return resr.getRRI()->request_cookie_size;
-      }
-    }
-
-    // Nothing found
-    *data = NULL;
-    return -1;
-  }
-
- private:
-  const char* _main;
-  const char* _sub;
-  int _main_len, _sub_len;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Class for a IP based Hash Key. Set the data pointer to the IP (in network
-// byte order).
-//
-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
-  }
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Class for a Header based Hash Key. Set the data pointer to the Header, or
-// NULL if not available.
-//
-class HeaderHashKey : public HashKey
-{
- public:
-  HeaderHashKey(const std::string header) {
-    _header = TSstrdup(header.c_str());
-    _header_len = header.size();
-  }
-
-  ~HeaderHashKey() {
-    if (_header)
-      TSfree(const_cast<char*>(_header));
-  }
-
-  int
-  key(const void** data, Resources& resr) const {
-    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, -1, &val, &len)) {
-        *data = val;
-      } else {
-        *data = NULL;
-      }
-      TSHandleMLocRelease(bufp, hdrLoc, fieldLoc);
-    } else {
-      *data = NULL;
-    }
-
-    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;
-};
-
-
-#endif // __HASHKEY_H
-

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/resources.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/resources.h b/plugins/experimental/balancer/resources.h
deleted file mode 100644
index 6188951..0000000
--- a/plugins/experimental/balancer/resources.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  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
-
-      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.
- */
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-// 
-// Implement the resource class (per request), for optimal processing speed.
-//
-#ifndef __RESOURCES_H__
-#define __RESOURCES_H__ 1
-
-
-#include <ts/remap.h>
-#include <ts/ts.h>
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Class declaration
-//
-class Resources
-{
-public:
-  Resources(TSHttpTxn txnp, TSRemapRequestInfo *rri) :
-    _txnp(txnp), _rri(rri), _jar(NULL), _bufp(NULL), _hdrLoc(NULL)
-  { }
-
-  ~Resources() {
-    if (_hdrLoc) {
-      TSDebug("balancer", "Releasing the client request headers");
-      TSHandleMLocRelease(_bufp, TS_NULL_MLOC, _hdrLoc);
-    }
-
-    if (_jar) {
-      TSDebug("balancer", "Destroying the cookie jar");
-      // TODO - destroy cookies
-    }
-  }
-
-  const TSHttpTxn getTxnp() const { return _txnp; }
-    
-  const TSRemapRequestInfo* getRRI() const { return _rri; }
-
-  const cookiejar_t
-  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];
-
-      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");
-    }
-
-    return _jar;
-  }
-
-  const TSMBuffer
-  getBufp() {
-    if (_bufp) {
-      return _bufp;
-    } else {
-      if (!_txnp || !TSHttpTxnClientReqGet(_txnp, &_bufp, &_hdrLoc)) {
-        _bufp = NULL;
-        _hdrLoc = NULL;
-      }
-      return _bufp;
-    }
-  }
-
-  const TSMLoc
-  getHdrLoc() {
-    if (!_bufp || !_hdrLoc)
-      (void)getBufp();
-
-    return _hdrLoc;
-  }
-
-private:
-  TSHttpTxn _txnp;
-  TSRemapRequestInfo* _rri;
-  cookiejar_t _jar;
-  TSMBuffer _bufp;
-  TSMLoc _hdrLoc;
-};
-
-
-#endif // __HASHKEY_H

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0a6ae3b8/plugins/experimental/balancer/roundrobin.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/roundrobin.cc b/plugins/experimental/balancer/roundrobin.cc
new file mode 100644
index 0000000..fa8900f
--- /dev/null
+++ b/plugins/experimental/balancer/roundrobin.cc
@@ -0,0 +1,72 @@
+/** @file
+ *
+ *  A brief file description
+ *
+ *  @section license License
+ *
+ *  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
+ *
+ *      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.
+ */
+
+#include "balancer.h"
+#include <stdlib.h>
+#include <string.h>
+#include <map>
+#include <string>
+#include <vector>
+
+namespace {
+
+struct RoundRobinBalancer : public BalancerInstance
+{
+  RoundRobinBalancer() : targets(), next(0) {
+  }
+
+  void push_target(const char * target) {
+    this->targets.push_back(target);
+  }
+
+  const char * balance(TSHttpTxn, TSRemapRequestInfo *) {
+    return this->targets[++next % this->targets.size()].c_str();
+  }
+
+  std::vector<std::string> targets;
+  unsigned next;
+};
+
+} // namespace
+
+BalancerInstance *
+MakeRoundRobinBalancer(const char * options)
+{
+  RoundRobinBalancer * hash = new RoundRobinBalancer();
+  char * opt;
+  char * tmp;
+
+  TSDebug("balancer", "making round robin balancer with options '%s'", options);
+
+  if (options) {
+    options = tmp = strdup(options);
+    while ((opt = strsep(&tmp, ",")) != NULL) {
+      TSError("balancer: ignoring invalid round robin field '%s'", opt);
+    }
+
+    free((void *)options);
+  }
+
+  return hash;
+}
+


[24/50] git commit: Fix description.

Posted by zw...@apache.org.
Fix description.


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

Branch: refs/heads/5.0.x
Commit: c04946933dd5525c992915ac2b73cfdac0e0380f
Parents: 510c46a
Author: Leif Hedstrom <le...@ogre.com>
Authored: Sat Dec 28 14:44:59 2013 -0700
Committer: Leif Hedstrom <le...@ogre.com>
Committed: Sat Dec 28 14:45:31 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c0494693/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 46c6802..69131c6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
-  *) [TS-2248] Segmentation fault HttpTunnel and throttling.
+  *) [TS-2248] Segmentation fault in HttpTunnel with flow control.
    Author: bettydramit <b1...@gmail.com>.
 
   *) [TS-2454] Fix undefined reference to `__sync_fetch_and_sub_8' on ARM


[43/50] git commit: TS-1365 Update documentation

Posted by zw...@apache.org.
TS-1365 Update documentation


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

Branch: refs/heads/5.0.x
Commit: a74ef5a049347a864a0597364d3575ec297eeeb5
Parents: eccb33c
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 2 15:18:52 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 2 15:30:53 2014 -0700

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a74ef5a0/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 c92f351..08aaf1a 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2225,6 +2225,26 @@ Sockets
 
    Same as the command line option ``--accept_mss`` that sets the MSS for all incoming requests.
 
+.. ts:cv:: CONFIG proxy.config.net.poll_timeout INT 0
+
+   Same as the command line option ``--poll_timeout``, or ``-t``, which
+   specifies the timeout used for the polling mechanism used. This timeout is
+   always in milliseconds (ms). On Linux, this is the timeout to
+   ``epoll_wait()``. The default value is ``10`` on all platforms except
+   Solaris, where it is ``30``.
+
+   Changing this configuration can reduce CPU usage on an idle system, since
+   periodic tasks gets processed at these intervals. On busy servers, this
+   overhead is diminished, since polled events triggers more
+   frequently. However, increasing the setting can also introduce additional
+   latency for certain operations, and timed events. It's recommended not to
+   touch this setting unless your CPU usage is unacceptable at idle
+   workload. Some alternatives to this could be::
+
+        Reduce the number of worker threads (net-threads)
+        Reduce the number of disk (AIO) threads
+
+
 Undocumented
 ============
 


[04/50] git commit: proxy.config.remap.use_remap_processor is dead

Posted by zw...@apache.org.
proxy.config.remap.use_remap_processor is dead


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

Branch: refs/heads/5.0.x
Commit: 2772ae65a5a3fb48fa241c6db3495d9a8bdf165f
Parents: 2548cbc
Author: James Peach <jp...@apache.org>
Authored: Tue Dec 17 14:51:45 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Fri Dec 20 15:16:18 2013 -0800

----------------------------------------------------------------------
 .../configuration/records.config.en.rst         | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2772ae65/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 6170b46..c92f351 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2152,17 +2152,6 @@ Scheduled Update Configuration
    time. This option prevents the scheduled update process from
    overburdening the host.
 
-Remap Plugin Processor
-======================
-
-.. ts:cv:: CONFIG proxy.config.remap.use_remap_processor INT 0
-
-   Enables (``1``) or disables (``0``) the ability to run separate threads for remap plugin processing.
-
-.. ts:cv:: CONFIG proxy.config.remap.num_remap_threads INT 1
-
-   Specifies the number of threads that will be used for remap plugin rocessing.
-
 Plug-in Configuration
 =====================
 
@@ -2170,6 +2159,15 @@ Plug-in Configuration
 
    Specifies the location of Traffic Server plugins.
 
+.. ts:cv:: CONFIG proxy.config.remap.num_remap_threads INT 0
+
+   When this variable is set to ``0``, plugin remap callbacks are
+   executed in line on network threads. If remap processing takes
+   significant time, this can be cause additional request latency.
+   Setting this variable to causes remap processing to take place
+   on a dedicated thread pool, freeing the network threads to service
+   additional requests.
+
 Sockets
 =======
 


[29/50] git commit: Fix some typo about reclaimable freelist

Posted by zw...@apache.org.
Fix some typo about reclaimable freelist

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/10189576
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/10189576
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/10189576

Branch: refs/heads/5.0.x
Commit: 101895767fd35fef048f7ce3f3bd5db5c4e8f9cb
Parents: c905388
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Tue Dec 31 00:46:13 2013 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Tue Dec 31 00:49:39 2013 +0800

----------------------------------------------------------------------
 configure.ac            | 2 +-
 lib/ts/ink_queue_ext.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/10189576/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5d50b12..296246d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -401,7 +401,7 @@ if test "x${enable_freelist}" = "xyes"; then
 		[AS_HELP_STRING([--enable-reclaimable-freelist],
 				[enable reclaimable freelist support (effective only when freelist is enabled)])],
 		[],
-		[enable_recalimable_freelist="yes"])
+		[enable_reclaimable_freelist="no"])
   AC_MSG_RESULT([$enable_reclaimable_freelist])
 else
   enable_reclaimable_freelist="no"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/10189576/lib/ts/ink_queue_ext.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_queue_ext.cc b/lib/ts/ink_queue_ext.cc
index b34ecc8..4352487 100644
--- a/lib/ts/ink_queue_ext.cc
+++ b/lib/ts/ink_queue_ext.cc
@@ -354,7 +354,7 @@ ink_chunk_delete(InkFreeList *f, InkThreadCache *pCache, InkChunkInfo *pChunk)
   /*
    * TODO: I had used ink_atomic_increment() here, but it would
    * lead to incorrect value in linux OS, I don't know why:
-   *  ink_atomic_decrement((int64_t *)&total_mem_in_byte, -f->chunk_byte_size);
+   *  ink_atomic_increment((int64_t *)&total_mem_in_byte, -f->chunk_byte_size);
    *
    * So I create a new wrap, ink_atomic_decrement(), in ink_atomic.h,
    * it works well. But we should create the same wrap for other OS.


[49/50] git commit: TS-1365 Added a little more help on how to avoid wasting CPU

Posted by zw...@apache.org.
TS-1365 Added a little more help on how to avoid wasting CPU


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

Branch: refs/heads/5.0.x
Commit: 17f0102cb9c6547f6e1eb40d23963225a8a80ba2
Parents: 8901e65
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 2 19:40:12 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 2 19:40:15 2014 -0700

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/17f0102c/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 79e4975..4c46d04 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2243,6 +2243,7 @@ Sockets
 
         Reduce the number of worker threads (net-threads)
         Reduce the number of disk (AIO) threads
+	Make sure accept threads are enabled
 
 
 Undocumented


[22/50] git commit: Fix indentation and punctuations.

Posted by zw...@apache.org.
Fix indentation and punctuations.


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

Branch: refs/heads/5.0.x
Commit: 6a88b7dd5edbf59b794f329c722d1d531e36db30
Parents: 40a49e3
Author: Leif Hedstrom <le...@ogre.com>
Authored: Sat Dec 28 14:03:59 2013 -0700
Committer: Leif Hedstrom <le...@ogre.com>
Committed: Sat Dec 28 14:03:59 2013 -0700

----------------------------------------------------------------------
 CHANGES | 102 ++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 56 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6a88b7dd/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 29079c0..ca28d6c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,19 +1,21 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
-  *) TS-2454: Fix undefined reference to `__sync_fetch_and_sub_8' on ARM 32bit system.
+  *) [TS-2454] Fix undefined reference to `__sync_fetch_and_sub_8' on ARM
+   32bit system.
 
   *) [TS-2450] Fix assertion failure for T61String type.
 
-  *) [TS-2117] make hipes plugin build
+  *) [TS-2117] make hipes plugin build.
 
   *) [TS-2452] Can't access a deleted object.
 
   *) [TS-2363] Fix assertion of "Unknown file format type!".
 
-  *) [TS-2448] Fix traffic_cop and traffic_manager to obey the proxy.config.local_state_dir setting.
+  *) [TS-2448] Fix traffic_cop and traffic_manager to obey the
+   proxy.config.local_state_dir setting.
 
-  *) [TS-2445] Fix problem with 204 responses closing POST requests
+  *) [TS-2445] Fix problem with 204 responses closing POST requests.
 
   *) [TS-2434] Use the FATAL error level to handle plugin errors.
 
@@ -21,7 +23,7 @@ Changes with Apache Traffic Server 4.2.0
 
   *) [TS-2436] Add a simple integration test harness.
 
-  *) [TS-2355] ATS 4.0.x crashes when using OpenSSL 1.0.1e
+  *) [TS-2355] ATS 4.0.x crashes when using OpenSSL 1.0.1e.
 
   *) [TS-2432] Fix a race in aio_err_callblk.
 
@@ -29,42 +31,46 @@ Changes with Apache Traffic Server 4.2.0
 
   *) [TS-2190] Remove cache.log from the cachurl plugin.
 
-  *) [TS-2426] Add a new plugin, xdebug, for cache debugging using HTTP headers.
+  *) [TS-2426] Add a new plugin, xdebug, for cache debugging using HTTP
+   headers.
 
   *) [TS-2077] Remove pipeline configurations, they were no-op's anyways. We
    still support pipelining (we always do), it's just not treated specially
    (or optimized).
 
-  *) [TS-2386] clean up unused files and codes -- round 4.2
+  *) [TS-2386] clean up unused files and codes -- round 4.2.
 
   *) [TS-548] remove Initialize.cc Initialize.h
 
-  *) [TS-2082] remove STANDALONE_IOCORE FIXME_NONMODULAR and NON_MODULAR defines
+  *) [TS-2082] remove STANDALONE_IOCORE FIXME_NONMODULAR and NON_MODULAR
+   defines.
 
-  *) [TS-312] Add option to always share keep-alive connections to the origin server
+  *) [TS-312] Add option to always share keep-alive connections to the origin
+   server.
 
-  *) [TS-2419] Don't close client connection when responding with a 204 and there is no body
+  *) [TS-2419] Don't close client connection when responding with a 204 and
+   there is no body.
 
   *) [TS-1146] Add RFC 5077 TLS session ticket support.
    Author: Wei Sun <su...@yahoo-inc.com>
 
   *) [TS-2401] Use Layout instead of global install path directories.
 
-  *) [TS-2420] Remove STAT_SYNC, CONF_SYNC, and REM_SYNC threads and schedule those
-   continuations in ET_TASK
+  *) [TS-2420] Remove STAT_SYNC, CONF_SYNC, and REM_SYNC threads and schedule
+   those continuations in ET_TASK.
 
   *) [TS-2372] Enable TLS perfect forward security with ECDHE.
 
   *) [TS-2416] Make TLS the session timeout threshold configurable.
    Author: Wei Sun <su...@yahoo-inc.com>
 
-  *) [TS-2335] adding ts_lua plugin to experimental directory
+  *) [TS-2335] adding ts_lua plugin to experimental directory.
 
   *) [TS-2347] buffer_upload uses unsafe function tempnam(). Replace it
-   with mkstemp()
+   with mkstemp().
 
   *) [TS-1815] Add thread number and port to accept thread name and
-   add the file descriptor number to the ET_AIO thread names
+   add the file descriptor number to the ET_AIO thread names.
 
   *) [TS-2415] Use standard continuations to release UrlRewrite objects.
 
@@ -92,11 +98,12 @@ Changes with Apache Traffic Server 4.2.0
 
   *) [TS-2374] Abort the producer if the none of it`s consumers is alive.
 
-  *) [TS-2330] Update proxy.config.body_factory.enable_customizations comments in records.config
+  *) [TS-2330] Update proxy.config.body_factory.enable_customizations comments
+   in records.config.
 
-  *) [TS-2327] TSRedirectUrlSet does not perform DNS lookup of redirected OS
+  *) [TS-2327] TSRedirectUrlSet does not perform DNS lookup of redirected OS.
 
-  *) [TS-1468] Check vary and accept headers on non-200 responses in cache
+  *) [TS-1468] Check vary and accept headers on non-200 responses in cache.
 
   *) [TS-2352] refine THREAD_ALLOC feature.
 
@@ -104,15 +111,16 @@ Changes with Apache Traffic Server 4.2.0
 
   *) [TS-2360] Fix usage of TSMimeHdrFieldValueStringGet() IDX in some plugins.
 
-  *) [TS-2361] Load regex_remap configuration relative to the configuration directory.
+  *) [TS-2361] Load regex_remap configuration relative to the configuration
+   directory.
 
   *) [TS-2359] Make install over existing installation can fail.
 
-  *) [TS-2350] Enhancements to traffic_top
+  *) [TS-2350] Enhancements to traffic_top.
 
   *) [TS-2348] Rename tstop to traffic_top.
 
-  *) [TS-2384] Fix regression in key-lookup code between 4.0.x and 4.1.x
+  *) [TS-2384] Fix regression in key-lookup code between 4.0.x and 4.1.x.
 
   *) [TS-2340] Fix TextLogObject log rolling.
    Author: bettydramit <b1...@gmail.com>
@@ -131,7 +139,7 @@ Changes with Apache Traffic Server 4.2.0
 
   *) [TS-2339] Cleanup Makefile.am, fixing missing / wrong _SOURCES entries.
 
-  *) [TS-2341] Cast TSHttpStatus to int to suppress compiler warning in clang
+  *) [TS-2341] Cast TSHttpStatus to int to suppress compiler warning in clang.
 
   *) [TS-2303] Incorrect docs for negative_caching_enabled.
     Author: Thomas Jackson <ja...@gmail.com>
@@ -147,10 +155,11 @@ Changes with Apache Traffic Server 4.1.0
 
   *) [TS-2108] Fix TSConfig to build with bison 3.0
 
-  *) [TS-2311] ESI: Support responses that are of other text content type as well as non-200 status response.
-   Author: Kit Chan
+  *) [TS-2311] ESI: Support responses that are of other text content type as
+   well as non-200 status response. Author: Kit Chan
 
-  *) [TS-2321] C++ API: Clean up header code to not use STL containers and use structures directly
+  *) [TS-2321] C++ API: Clean up header code to not use STL containers and use
+   structures directly.
 
   *) [TS-2323] Implement a .include directive for remap.config.
 
@@ -170,10 +179,10 @@ Changes with Apache Traffic Server 4.1.0
    Author: portl4t.cn@gmail.com
 
   *) [TS-2315] ESI Plugin: fetcher does not handle error gracefully.
-   Author: Kit Chan.
+   Author: Kit Chan
 
   *) [TS-2115] buffer_upload hard-codes "nobody" user/group.
-   Author: Kit Chan.
+   Author: Kit Chan
 
   *) [TS-2008] Cache control with multiple suffixes.
     Author: bettydramit <b1...@gmail.com>
@@ -229,7 +238,7 @@ Changes with Apache Traffic Server 4.1.0
    string length.
 
   *) [TS-2275] fix interim cache lossing data if the server process crash.
-   Author: Gang Li.
+   Author: Gang Li
 
   *) [TS-2291] Add remap_stats plugin to experimental.
 
@@ -246,13 +255,13 @@ Changes with Apache Traffic Server 4.1.0
   *) [TS-2197] Use HttpSM::main_handler to handle the client request stuff.
 
   *) [TS-2254] On ARM arch, ink_atomic_increment returns wrong value.
-   Author: Yu Qing.
+   Author: Yu Qing
 
   *) [TS-2269] regex_remap plugin does not deal with empty path's properly.
-   Author: Kit Chan.
+   Author: Kit Chan
 
   *) [TS-2270] ESI Plugin can have infinite loop while doing gunzip on
-   responses. Author: Kit Chan.
+   responses. Author: Kit Chan
 
   *) [TS-2268] Add support for opening protocol traffic sockets through the 
    traffic_manager. Added TSPluginDescriptorAccept into expiremental API.
@@ -294,8 +303,7 @@ Changes with Apache Traffic Server 4.1.0
 
   *) [TS-2209] add support for lowercasing all substitutions in regex_remap.
 
-  *) [TS-2187] failed assert `nr == sizeof(uint64_t)` in
-   EventNotify::signal().
+  *) [TS-2187] failed assert `nr == sizeof(uint64_t)` in EventNotify::signal().
 
   *) [TS-2206] The trafficserver RC script does not use absolute path to
    traffic_line binary.
@@ -317,7 +325,7 @@ Changes with Apache Traffic Server 4.1.0
    separate bug.
 
   *) [TS-2188] Fixes to make healthcheck plugin not segfault, and parse the
-   log files properly. Author: Scott Harris <sc...@harrisnet.id.au>.
+   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.
@@ -349,7 +357,7 @@ Changes with Apache Traffic Server 4.1.0
 
   *) [TS-2148] handle_cache_operation_on_forward_server_response ignores value
     of api_server_response_no_store.
-    Author: Corey Cossentino <co...@cossentino.com> 
+    Author: Corey Cossentino <co...@cossentino.com>
 
   *) [TS-2147] Set server_share_sessions to 1 for 'internal' transactions in
    rfc5861 plugin.
@@ -367,7 +375,7 @@ Changes with Apache Traffic Server 4.1.0
   *) [TS-2137] Use eventfd instread of pthread signal/wait in ATS.
 
   *) [TS-287] Fix transaction_active_timeout_in does not trigger on the first
-   request of a Keep-Alive connection. Author: Li Gang <qu...@taobao.com>.
+   request of a Keep-Alive connection. Author: Li Gang <qu...@taobao.com>
 
   *) [TS-2136] Fix the first proxy.config.http.accept_no_activity_timeout is
    invalid.
@@ -391,15 +399,15 @@ Changes with Apache Traffic Server 4.0.1
   *) [TS-2161] TSHttpTxnHookAdd memory Leak.
     Author: bettydramit <b1...@gmail.com>
 
-  *) [TS-2154] Lua plugin asserts traffic_server on startup
+  *) [TS-2154] Lua plugin asserts traffic_server on startup.
 
   *) [TS-2127] Move hostdb.config to var/trafficserver, together with with the
    host.db itself.
 
-  *) [TS-1823] remap.config line continuation support
+  *) [TS-1823] remap.config line continuation support.
     Author: Jim Riggs <ji...@riggs.me>
 
-  *) [TS-1597] Document remap.config filters
+  *) [TS-1597] Document remap.config filters.
     Author: Jim Riggs <ji...@riggs.me>
 
   *) [TS-2132, TS-2131] ${libexecdir} and $(localstatedir} chowned
@@ -410,7 +418,7 @@ Changes with Apache Traffic Server 4.0.1
 
   *) [TS-2129] Check for existence of ExtUtils::MakeMaker.
 
-  *) [TS-2128] Don't link libGeoIP.so.1 into binaries
+  *) [TS-2128] Don't link libGeoIP.so.1 into binaries.
 
   *) [TS-2112] Make libloader compile by default.
 
@@ -432,7 +440,7 @@ Changes with Apache Traffic Server 3.3.5
 
   *) [TS-2100] Initialize the SSL/NPN registration mutex.
 
-  * [TS-1987, TS-2097]: Remove duplicate and unused string functions
+  * [TS-1987, TS-2097]: Remove duplicate and unused string functions.
 
   *) [TS-2091] Return an error from RecGetRecordOrderAndId if the stat isn't
    registered.
@@ -443,7 +451,7 @@ Changes with Apache Traffic Server 3.3.5
 
   *) [TS-2092] Use of uninitialized member in HdrHeap.
 
-  *) [TS-2052] ET_SSL thread spinning
+  *) [TS-2052] ET_SSL thread spinning.
    Author: Can Selcik <cselcik at linkedin.com>
 
   *) [TS-2090 Make proxy.config.allocator.enable_reclaim default based on
@@ -458,7 +466,7 @@ Changes with Apache Traffic Server 3.3.5
    also modified the regression tests to be less easy to fool.
 
   *) [TS-1976] Prevent an invalid httpport argument being passed from
-   traffic_manager to traffic_server
+   traffic_manager to traffic_server.
    Author: Thach Tran <tr...@gmail.com>
 
   *) [TS-2076] Removed proxy.config.http.accept_encoding_filter_enabled, which
@@ -482,14 +490,15 @@ Changes with Apache Traffic Server 3.3.5
 
   *) [TS-2059] Remove dead code in EnvBlock.cc and processSpawn().
 
-  *) [TS-2057] Removed deprecated proxy port configuration values from records.config.
+  *) [TS-2057] Removed deprecated proxy port configuration values from
+   records.config.
 
   *) [TS-1280] Add url match token about cache control rule.
 
   *) [TS-2064] Fix the authproxy plugin to send an error body.
 
   *) [TS-2061] Avoid writing outside buffer boundaries in LogFile overfill
-   buffers (for ASCII logging). Author: quehan.
+   buffers (for ASCII logging). Author: quehan
 
   *) [TS-2041] Allow environment values to override records.config settings.
 
@@ -625,7 +634,8 @@ Changes with Apache Traffic Server 3.3.3 (never released)
 
   *) [TS-1937] Prevent assert on SSL forward proxy connect.
 
-  *) [TS-1907] Using the "ipv6" option for port configuration cancels the "ssl" option.
+  *) [TS-1907] Using the "ipv6" option for port configuration cancels the
+   "ssl" option.
 
   *) [TS-1927] Make ats_base64_decode able to handle the URL variant
 


[38/50] git commit: TS-2271: Let TSHttpTxnReenable work gracefully when it's called from an unexpected thread (this_ethread() returns NULL).

Posted by zw...@apache.org.
TS-2271: Let TSHttpTxnReenable work gracefully when it's called from an unexpected thread (this_ethread() returns NULL).


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

Branch: refs/heads/5.0.x
Commit: d706b7d6478ff8b5a37b1422b3ad45739c10a5e9
Parents: 698db8b
Author: Heikki Hannikainen <he...@hes.iki.fi>
Authored: Mon Dec 30 17:42:23 2013 +0200
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 2 08:39:01 2014 -0800

----------------------------------------------------------------------
 proxy/InkAPI.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d706b7d6/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 1e8ecdf..cb31e6d 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -5516,10 +5516,14 @@ TSHttpTxnReenable(TSHttpTxn txnp, TSEvent event)
   HttpSM *sm = (HttpSM *) txnp;
   EThread *eth = this_ethread();
 
+  // TS-2271: If this function is being executed on a thread which was not
+  // created using the ATS EThread API, eth will be NULL, and the
+  // continuation needs to be called back on a REGULAR thread.
+  //
   // If this function is being executed on a thread created by the API
   // which is DEDICATED, the continuation needs to be called back on a
   // REGULAR thread.
-  if (eth->tt != REGULAR) {
+  if (eth == NULL || eth->tt != REGULAR) {
     eventProcessor.schedule_imm(NEW(new TSHttpSMCallback(sm, event)), ET_NET);
   } else {
     MUTEX_TRY_LOCK(trylock, sm->mutex, eth);


[14/50] git commit: TS-2117 editing hipes plugin documentation

Posted by zw...@apache.org.
TS-2117 editing hipes plugin documentation


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

Branch: refs/heads/5.0.x
Commit: a701121fcc0fa44611a5413239a17de1f98be28d
Parents: 65630cd
Author: Kit Chan <ki...@apache.org>
Authored: Thu Dec 26 09:24:58 2013 -0800
Committer: Kit Chan <ki...@apache.org>
Committed: Thu Dec 26 09:24:58 2013 -0800

----------------------------------------------------------------------
 doc/reference/plugins/hipes.en.rst | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a701121f/doc/reference/plugins/hipes.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/hipes.en.rst b/doc/reference/plugins/hipes.en.rst
index 2d6daa5..e74a58a 100644
--- a/doc/reference/plugins/hipes.en.rst
+++ b/doc/reference/plugins/hipes.en.rst
@@ -66,7 +66,7 @@ HTTP Pipes (aka HIPES and pronounced "Hippies") allows data services to be pipel
 
 Example
 =======
-1. ATS is run on port 80 and apache HTTP web server is run on port 8080
+1. ATS is run on port 80 and apache HTTP web server is run on port 8080 on localhost (127.0.0.1)
 
 2. The HIPES plugin is used in ``remap.config`` ::
 
@@ -74,23 +74,23 @@ Example
     map http://127.0.0.1/svc_reverse http://nosuchhost @plugin=hipes.so @pparam=service:127.0.0.1:8080 @pparam=path:svc_reverse.php @pparam=server:127.0.0.1 
     map http://127.0.0.1/test.txt http://127.0.0.1:8080/test.txt
 
-3. The plugin remaps the incoming URL such as 
+3. The plugin remaps the incoming URL such as :: 
    
-    ``http://127.0.0.1/svc_reverse/svc_case;case=u/test.txt``  
+    http://127.0.0.1/svc_reverse/svc_case;case=u/test.txt  
 
-to the following
+to the following ::
  
-    ``http://127.0.0.1:8080/svc_reverse?url=http%3A%2F%2F127.0.0.1%2Fsvc_case%3Bcase%3Du%2Ftest.txt``
+    http://127.0.0.1:8080/svc_reverse?url=http%3A%2F%2F127.0.0.1%2Fsvc_case%3Bcase%3Du%2Ftest.txt
 
-3. The service ``svc_reverse.php`` fetches the ``url`` from the ATS again and the plugin remaps the URL
+4. The service ``svc_reverse.php`` fetches the ``url`` from the ATS again and the plugin remaps the URL ::
 
-    ``http://127.0.0.1/svc_case;case=u/test.txt``
+    http://127.0.0.1/svc_case;case=u/test.txt
 
-to this URL 
+to this URL :: 
 
-    ``http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt``
+    http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt
 
-4. In this example, the service ``svc_case.php`` fetches and transforms the response of ``http://127.0.0.1/test.txt`` (which ATS proxies the request to a local file) to upper case. And subsequently the service ``svc_reverse.php`` receives the response and reverse the order before the response is sent back to the client by ATS.
+5. In this example, the service ``svc_case.php`` fetches and transforms the response of ``http://127.0.0.1/test.txt`` (which ATS proxies the request to a local file) to upper case. And subsequently the service ``svc_reverse.php`` receives the response and reverse the order before the response is sent back to the client by ATS.
 
 Notes on reducing traffic 
 =========================
@@ -102,13 +102,13 @@ Modification to above example to reduce traffic using redirect
 
 1. The service ``svc_reverse.php`` is modified to add a header of ``X-HIPES-Redirect: 2`` to the request made against ``url``.
 
-2. HIPES plugin will instruct ATS to return a redirect response to this url 
+2. HIPES plugin will instruct ATS to return a redirect response to this url ::
 
-    ``http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt``
+    http://127.0.0.1:8080/svc_case.php?case=u&url=http%3A%2F%2F127.0.0.1%2Ftest.txt
 
 for the following request
 
-    ``http://127.0.0.1/svc_case;case=u/test.txt``
+    http://127.0.0.1/svc_case;case=u/test.txt
 
-3.  The service ``svc_reverse.php`` is also modified to follow the redirect. Thus the response of the service of ``svc_case`` will not pass through ATS and will pass to ``svc_reverse`` service instead. 
+3.  The service ``svc_reverse.php`` is also modified to follow the redirect. Thus the response of the service of ``svc_case.php`` will not pass through ATS and will pass to ``svc_reverse.php`` service instead. 
 


[15/50] git commit: Remove unrepeated entries in plugin index document

Posted by zw...@apache.org.
Remove unrepeated entries in plugin index document


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

Branch: refs/heads/5.0.x
Commit: cc46db7f991beb0d995657afae53781db1522369
Parents: a701121
Author: Kit Chan <ki...@apache.org>
Authored: Thu Dec 26 11:29:32 2013 -0800
Committer: Kit Chan <ki...@apache.org>
Committed: Thu Dec 26 11:29:32 2013 -0800

----------------------------------------------------------------------
 doc/reference/plugins/index.en.rst | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cc46db7f/doc/reference/plugins/index.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/index.en.rst b/doc/reference/plugins/index.en.rst
index 4b9307b..a435abb 100644
--- a/doc/reference/plugins/index.en.rst
+++ b/doc/reference/plugins/index.en.rst
@@ -64,7 +64,6 @@ directory of the Apache Traffic Server source tree. Exmperimental plugins can be
 
   balancer.en
   buffer_upload.en
-  cacheurl.en
   combo_handler.en
   esi.en
   geoip_acl.en


[06/50] git commit: TS-2448: Fix traffic_manager to work correctly if proxy.config.local_state_dir is set

Posted by zw...@apache.org.
TS-2448: Fix traffic_manager to work correctly if proxy.config.local_state_dir is set


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

Branch: refs/heads/5.0.x
Commit: aae02ee4fd133ec604b3e7bd7d090cd05f29750e
Parents: b78aa56
Author: James Peach <jp...@apache.org>
Authored: Mon Dec 16 15:53:43 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Fri Dec 20 15:23:14 2013 -0800

----------------------------------------------------------------------
 lib/records/RecCore.cc    | 3 ++-
 lib/records/RecMessage.cc | 3 ++-
 mgmt/LocalManager.cc      | 3 ++-
 mgmt/Main.cc              | 5 +++--
 mgmt/api/CoreAPIRemote.cc | 2 ++
 5 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae02ee4/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 759dcef..b81b3d1 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -177,7 +177,8 @@ RecCoreInit(RecModeT mode_type, Diags *_diags)
   }
   // read stats
   if ((mode_type == RECM_SERVER) || (mode_type == RECM_STAND_ALONE)) {
-    g_stats_snap_fpath = Layout::relative_to(Layout::get()->runtimedir, REC_RAW_STATS_FILE);
+    xptr<char> rundir(RecConfigReadRuntimeDir());
+    g_stats_snap_fpath = Layout::relative_to(rundir, REC_RAW_STATS_FILE);
     RecReadStatsFile();
   }
   // read configs

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae02ee4/lib/records/RecMessage.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecMessage.cc b/lib/records/RecMessage.cc
index 8c84c8b..bec22be 100644
--- a/lib/records/RecMessage.cc
+++ b/lib/records/RecMessage.cc
@@ -99,8 +99,9 @@ recv_thr(void *data)
 static void *
 accept_thr(void *data)
 {
+  xptr<char> rundir(RecConfigReadRuntimeDir());
   RecHandle h_pipe;
-  h_pipe = RecPipeCreate(Layout::get()->runtimedir, REC_PIPE_NAME);
+  h_pipe = RecPipeCreate(rundir, REC_PIPE_NAME);
   ink_thread_create(send_thr, (void *) h_pipe);
   ink_thread_create(recv_thr, (void *) h_pipe);
   return NULL;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae02ee4/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index 21d05e6..dc30dcd 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -146,7 +146,8 @@ LocalManager::clearStats(const char *name)
   //   that operation works even when the proxy is off
   //
   if (this->proxy_running == 0) {
-    statsPath = Layout::relative_to(Layout::get()->runtimedir, REC_RAW_STATS_FILE);
+    xptr<char> rundir(RecConfigReadRuntimeDir());
+    statsPath = Layout::relative_to(rundir, REC_RAW_STATS_FILE);
     if (unlink(statsPath) < 0) {
       if (errno != ENOENT) {
         mgmt_log(stderr, "[LocalManager::clearStats] Unlink of %s failed : %s\n", REC_RAW_STATS_FILE, strerror(errno));

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae02ee4/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index 2452f16..ac23d21 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -104,6 +104,7 @@ static void SigChldHandler(int sig);
 static void
 check_lockfile()
 {
+  xptr<char> rundir(RecConfigReadRuntimeDir());
   char lockfile[PATH_NAME_MAX];
   int err;
   pid_t holding_pid;
@@ -111,7 +112,7 @@ check_lockfile()
   //////////////////////////////////////
   // test for presence of server lock //
   //////////////////////////////////////
-  Layout::relative_to(lockfile, PATH_NAME_MAX, Layout::get()->runtimedir, SERVER_LOCK);
+  Layout::relative_to(lockfile, sizeof(lockfile), rundir, SERVER_LOCK);
   Lockfile server_lockfile(lockfile);
   err = server_lockfile.Open(&holding_pid);
   if (err == 1) {
@@ -137,7 +138,7 @@ check_lockfile()
   ///////////////////////////////////////////
   // try to get the exclusive manager lock //
   ///////////////////////////////////////////
-  Layout::relative_to(lockfile, PATH_NAME_MAX, Layout::get()->runtimedir, MANAGER_LOCK);
+  Layout::relative_to(lockfile, sizeof(lockfile), rundir, MANAGER_LOCK);
   Lockfile manager_lockfile(lockfile);
   err = manager_lockfile.Get(&holding_pid);
   if (err != 1) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae02ee4/mgmt/api/CoreAPIRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPIRemote.cc b/mgmt/api/CoreAPIRemote.cc
index cb2ae5c..6c0ecc3 100644
--- a/mgmt/api/CoreAPIRemote.cc
+++ b/mgmt/api/CoreAPIRemote.cc
@@ -237,6 +237,8 @@ Init(const char *socket_path, TSInitOptionT options)
 
   ts_init_options = options;
 
+  // XXX This should use RecConfigReadRuntimeDir(), but that's not linked into the management
+  // libraries. The caller has to pass down the right socket path :(
   if (!socket_path) {
     Layout::create();
     socket_path = Layout::get()->runtimedir;


[28/50] git commit: Add TS-32.

Posted by zw...@apache.org.
Add TS-32.


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

Branch: refs/heads/5.0.x
Commit: c905388f273efff34d4ccf79b0e41be3ef459ada
Parents: 1d01716
Author: Zhao Yongming <mi...@gmail.com>
Authored: Sun Dec 29 18:50:00 2013 +0800
Committer: Zhao Yongming <mi...@gmail.com>
Committed: Sun Dec 29 18:50:00 2013 +0800

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c905388f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 69131c6..168a087 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-32] Fix ICP.
+   Author: Gota Adachi <ad...@iij.ad.jp>
+
   *) [TS-2248] Segmentation fault in HttpTunnel with flow control.
    Author: bettydramit <b1...@gmail.com>.
 


[07/50] git commit: TS-2248: update CHANGES

Posted by zw...@apache.org.
TS-2248: update CHANGES


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

Branch: refs/heads/5.0.x
Commit: 3421c6e42e04cffdfd9bea5a23f73ec9a8743c7c
Parents: aae02ee
Author: James Peach <jp...@apache.org>
Authored: Fri Dec 20 15:24:08 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Fri Dec 20 15:24:08 2013 -0800

----------------------------------------------------------------------
 CHANGES | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3421c6e4/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index bf132c8..d5d4fc7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2448] Fix traffic_cop and traffic_manager to obey the proxy.config.local_state_dir setting.
+
   *) [TS-2445] Fix problem with 204 responses closing POST requests
 
   *) [TS-2434] Use the FATAL error level to handle plugin errors.