You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2015/05/05 06:21:13 UTC

[01/11] trafficserver git commit: TS-3548: fix psiginfo usage on Illumos

Repository: trafficserver
Updated Branches:
  refs/heads/5.3.x 05aa7a3b3 -> cf9d19054
Updated Tags:  refs/tags/5.3.0-rc3 [created] 81fd394fb


TS-3548: fix psiginfo usage on Illumos

(cherry picked from commit cb2ad69c0a3c3d9d5d9cb2a93f7210a3dda396de)

Conflicts:
	CHANGES


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

Branch: refs/heads/5.3.x
Commit: 9fc53c2c772227ea7af5e772cf8ec2375bfe71be
Parents: 05aa7a3
Author: James Peach <jp...@apache.org>
Authored: Wed Apr 22 14:43:58 2015 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Apr 23 10:24:04 2015 -0600

----------------------------------------------------------------------
 CHANGES           | 2 ++
 lib/ts/signals.cc | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9fc53c2c/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 3bf50b6..ab0e075 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,8 @@ Changes with Apache Traffic Server 5.3.0
 
   *) [TS-3533] Revert commits that break unregistered plugin loading.
 
+  *) [TS-3548] Fix psiginfo usage on Illumos.
+
   *) [TS-3529] Add config option to allow ATS to start even if certificate files are bad.
 
   *) [TS-3522] Segfault due to inactivity_cop.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9fc53c2c/lib/ts/signals.cc
----------------------------------------------------------------------
diff --git a/lib/ts/signals.cc b/lib/ts/signals.cc
index ec11af3..0c415fd 100644
--- a/lib/ts/signals.cc
+++ b/lib/ts/signals.cc
@@ -159,7 +159,7 @@ signal_format_siginfo(int signo, siginfo_t *info, const char *msg)
   (void)signo;
 
 #if HAVE_PSIGINFO
-  psiginfo(info, msg);
+  psiginfo(info, const_cast<char *>(msg));
 #elif HAVE_PSIGNAL
   psignal(signo, msg);
 #else


[03/11] trafficserver git commit: TS-3551: Fix LogUtils.cc compile on Illumos

Posted by so...@apache.org.
TS-3551: Fix LogUtils.cc compile on Illumos

(cherry picked from commit 6f4bea0b7e736454cb8697f29ba2b398ab8a0f77)


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

Branch: refs/heads/5.3.x
Commit: ebc83f783096e3413c4e267927ccf02c162348f7
Parents: ca0b0ef
Author: Phil Sorber <so...@apache.org>
Authored: Thu Apr 23 09:51:28 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Apr 23 10:24:12 2015 -0600

----------------------------------------------------------------------
 CHANGES                   | 2 ++
 proxy/logging/LogUtils.cc | 4 ++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ebc83f78/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index ab0e075..be56126 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,8 @@ Changes with Apache Traffic Server 5.3.0
 
   *) [TS-3533] Revert commits that break unregistered plugin loading.
 
+  *) [TS-3551] Fix LogUtils.cc compile on Illumos.
+
   *) [TS-3548] Fix psiginfo usage on Illumos.
 
   *) [TS-3529] Add config option to allow ATS to start even if certificate files are bad.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ebc83f78/proxy/logging/LogUtils.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogUtils.cc b/proxy/logging/LogUtils.cc
index 2a5cd2f..4099f54 100644
--- a/proxy/logging/LogUtils.cc
+++ b/proxy/logging/LogUtils.cc
@@ -103,7 +103,11 @@ LogUtils::timestamp_to_netscape_str(long timestamp)
     //
     struct tm res;
     struct tm *tms = ink_localtime_r((const time_t *)&timestamp, &res);
+#if defined(solaris)
+    long zone = (tms->tm_isdst > 0) ? altzone : timezone;
+#else
     long zone = -tms->tm_gmtoff; // double negative!
+#endif
     int offset;
     char sign;
 


[06/11] trafficserver git commit: TS-3558: Fix proxy.config.http.auth_server_session_private

Posted by so...@apache.org.
TS-3558: Fix proxy.config.http.auth_server_session_private

(cherry picked from commit 300cdbae992eb21d5cca233e91467f7902b726d8)


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

Branch: refs/heads/5.3.x
Commit: 1b7ce62e225ea9a62b068306d08372ee050e8d28
Parents: ba8a4f6
Author: Brian Geffon <br...@apache.org>
Authored: Mon Apr 27 19:54:41 2015 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Mon May 4 21:31:05 2015 -0600

----------------------------------------------------------------------
 lib/ts/apidefs.h.in      |  1 +
 proxy/InkAPI.cc          |  7 +++++++
 proxy/InkAPITest.cc      |  1 +
 proxy/http/HttpConfig.cc |  4 ++++
 proxy/http/HttpSM.cc     | 46 ++++++++++++++++++++++++++++---------------
 proxy/http/HttpSM.h      |  7 +++++++
 6 files changed, 50 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b7ce62e/lib/ts/apidefs.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in
index 329adf2..a3e0d93 100644
--- a/lib/ts/apidefs.h.in
+++ b/lib/ts/apidefs.h.in
@@ -679,6 +679,7 @@ extern "C"
     TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN,
     TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT,
     TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT,
+    TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE,
     TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS, // DEPRECATED
     TS_CONFIG_HTTP_SERVER_SESSION_SHARING_POOL,
     TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b7ce62e/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index f46c279..e45cfb3 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -7607,6 +7607,9 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr
   case TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT:
     ret = &overridableHttpConfig->keep_alive_post_out;
     break;
+  case TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE:
+    ret = &overridableHttpConfig->auth_server_session_private;
+    break;
   case TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS:
     ink_assert("Deprecated config key value - TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS");
     //    ret = &overridableHttpConfig->share_server_sessions;
@@ -8385,6 +8388,10 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
       if (0 == strncmp(name, "proxy.config.http.server_session_sharing.pool", length))
         cnf = TS_CONFIG_HTTP_SERVER_SESSION_SHARING_POOL;
       break;
+    case 'e':
+      if (0 == strncmp(name, "proxy.config.http.auth_server_session_private", length))
+        cnf = TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE;
+      break;
     }
     break;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b7ce62e/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index de5e319..8a7ec68 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7170,6 +7170,7 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
   "proxy.config.url_remap.pristine_host_hdr", "proxy.config.http.chunking_enabled", "proxy.config.http.negative_caching_enabled",
   "proxy.config.http.negative_caching_lifetime", "proxy.config.http.cache.when_to_revalidate",
   "proxy.config.http.keep_alive_enabled_in", "proxy.config.http.keep_alive_enabled_out", "proxy.config.http.keep_alive_post_out",
+  "proxy.config.http.auth_server_session_private",
   "proxy.config.http.share_server_sessions", "proxy.config.http.server_session_sharing.pool",
   "proxy.config.http.server_session_sharing.match", "proxy.config.net.sock_recv_buffer_size_out",
   "proxy.config.net.sock_send_buffer_size_out", "proxy.config.net.sock_option_flag_out",

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b7ce62e/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index ef3089f..493369c 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -945,6 +945,8 @@ HttpConfig::startup()
   http_config_enum_read("proxy.config.http.server_session_sharing.match", SessionSharingMatchStrings,
                         c.oride.server_session_sharing_match);
 
+  HttpEstablishStaticConfigByte(c.oride.auth_server_session_private, "proxy.config.http.auth_server_session_private");
+
   HttpEstablishStaticConfigByte(c.oride.keep_alive_post_out, "proxy.config.http.keep_alive_post_out");
 
   HttpEstablishStaticConfigLongLong(c.oride.keep_alive_no_activity_timeout_in,
@@ -1190,6 +1192,8 @@ HttpConfig::reconfigure()
   params->oride.keep_alive_enabled_in = INT_TO_BOOL(m_master.oride.keep_alive_enabled_in);
   params->oride.keep_alive_enabled_out = INT_TO_BOOL(m_master.oride.keep_alive_enabled_out);
   params->oride.chunking_enabled = INT_TO_BOOL(m_master.oride.chunking_enabled);
+  params->oride.auth_server_session_private = INT_TO_BOOL(m_master.oride.auth_server_session_private);
+
   params->oride.http_chunking_size = m_master.oride.http_chunking_size;
 
   params->oride.post_check_content_length_enabled = INT_TO_BOOL(m_master.oride.post_check_content_length_enabled);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b7ce62e/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 57b4efa..b71db6a 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -316,7 +316,7 @@ HttpSM::HttpSM()
     enable_redirection(false), redirect_url(NULL), redirect_url_len(0), redirection_tries(0), transfered_bytes(0),
     post_failed(false), debug_on(false), plugin_tunnel_type(HTTP_NO_PLUGIN_TUNNEL), plugin_tunnel(NULL), reentrancy_count(0),
     history_pos(0), tunnel(), ua_entry(NULL), ua_session(NULL), background_fill(BACKGROUND_FILL_NONE), ua_raw_buffer_reader(NULL),
-    server_entry(NULL), server_session(NULL), shared_session_retries(0), server_buffer_reader(NULL), transform_info(),
+    server_entry(NULL), server_session(NULL), will_be_private_ss(false), shared_session_retries(0), server_buffer_reader(NULL), transform_info(),
     post_transform_info(), has_active_plugin_agents(false), second_cache_sm(NULL), default_handler(NULL), pending_action(NULL),
     historical_action(NULL), last_action(HttpTransact::SM_ACTION_UNDEFINED),
     // TODO:  Now that bodies can be empty, should the body counters be set to -1 ? TS-2213
@@ -4592,6 +4592,32 @@ HttpSM::do_http_server_open(bool raw)
   // to do this but as far I can tell the code that prevented keep-alive if
   // there is a request body has been removed.
 
+  // If we are sending authorizations headers, mark the connection private
+  //
+  // We do this here because it means that we will not waste a connection from the pool if we already
+  // know that the session will be private. This is overridable meaning that if a plugin later decides
+  // it shouldn't be private it can still be returned to a shared pool.
+  //
+  if (t_state.txn_conf->auth_server_session_private == 1 &&
+      t_state.hdr_info.server_request.presence(MIME_PRESENCE_AUTHORIZATION | MIME_PRESENCE_PROXY_AUTHORIZATION |
+                                               MIME_PRESENCE_WWW_AUTHENTICATE)) {
+    DebugSM("http_ss_auth", "Setting server session to private for authorization header");
+    will_be_private_ss = true;
+  }
+
+  if (t_state.method == HTTP_WKSIDX_POST || t_state.method == HTTP_WKSIDX_PUT) {
+     // don't share the session if keep-alive for post is not on
+     if (t_state.txn_conf->keep_alive_post_out == 0) {
+       DebugSM("http_ss", "Setting server session to private because of keep-alive post out");
+       will_be_private_ss = true;
+     }
+  }
+
+  // If there is already an attached server session mark it as private.
+  if (server_session != NULL && will_be_private_ss) {
+    set_server_session_private(true);
+  }
+
   if (raw == false && TS_SERVER_SESSION_SHARING_MATCH_NONE != t_state.txn_conf->server_session_sharing_match &&
       (t_state.txn_conf->keep_alive_post_out == 1 || t_state.hdr_info.request_content_length == 0) && !is_private() &&
       ua_session != NULL) {
@@ -5604,13 +5630,6 @@ HttpSM::attach_server_session(HttpServerSession *s)
 
   if (t_state.method == HTTP_WKSIDX_POST || t_state.method == HTTP_WKSIDX_PUT) {
     connect_timeout = t_state.txn_conf->post_connect_attempts_timeout;
-
-    // don't share the session if keep-alive for post is not on
-    if (t_state.txn_conf->keep_alive_post_out == 0) {
-      DebugSM("http_ss", "Setting server session to private because of keep-alive post out");
-      set_server_session_private(true);
-    }
-
   } else if (t_state.current.server == &t_state.parent_info) {
     connect_timeout = t_state.http_config_param->parent_connect_timeout;
   } else {
@@ -5631,7 +5650,7 @@ HttpSM::attach_server_session(HttpServerSession *s)
     server_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_active_timeout_out));
   }
 
-  if (plugin_tunnel_type != HTTP_NO_PLUGIN_TUNNEL) {
+  if (plugin_tunnel_type != HTTP_NO_PLUGIN_TUNNEL || will_be_private_ss) {
     DebugSM("http_ss", "Setting server session to private");
     set_server_session_private(true);
   }
@@ -5675,13 +5694,6 @@ HttpSM::setup_server_send_request()
     server_request_body_bytes = msg_len;
   }
 
-  // If we are sending authorizations headers, mark the connection private
-  if (t_state.txn_conf->auth_server_session_private == 1 &&
-      t_state.hdr_info.server_request.presence(MIME_PRESENCE_AUTHORIZATION | MIME_PRESENCE_PROXY_AUTHORIZATION |
-                                               MIME_PRESENCE_WWW_AUTHENTICATE)) {
-    DebugSM("http_ss", "Setting server session to private for authorization header");
-    set_server_session_private(true);
-  }
   milestones.server_begin_write = ink_get_hrtime();
   server_entry->write_vio = server_entry->vc->do_io_write(this, hdr_length, buf_start);
 }
@@ -7621,6 +7633,8 @@ HttpSM::is_private()
     HttpServerSession *ss = ua_session->get_server_session();
     if (ss) {
       res = ss->private_session;
+    } else if (will_be_private_ss) {
+      res = will_be_private_ss;
     }
   }
   return res;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b7ce62e/proxy/http/HttpSM.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 4edd7d5..16844ce 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -316,6 +316,13 @@ protected:
 
   HttpVCTableEntry *server_entry;
   HttpServerSession *server_session;
+
+  /* Because we don't want to take a session from a shared pool if we know that it will be private,
+   * but we cannot set it to private until we have an attached server session.
+   * So we use this variable to indicate that
+   * we should create a new connection and then once we attach the session we'll mark it as private.
+   */
+  bool will_be_private_ss;
   int shared_session_retries;
   IOBufferReader *server_buffer_reader;
   void remove_server_entry();


[09/11] trafficserver git commit: TS-3573: Fix connection leak

Posted by so...@apache.org.
TS-3573: Fix connection leak

(cherry picked from commit e895bcc6aa64e595c31f682a5acf8e6537235c89)

Conflicts:
	CHANGES


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

Branch: refs/heads/5.3.x
Commit: 1801eef05033b72a7fc01678c64b334fe8cb96ce
Parents: f2d2391
Author: shinrich <sh...@yahoo-inc.com>
Authored: Thu Apr 30 13:19:07 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Mon May 4 21:38:22 2015 -0600

----------------------------------------------------------------------
 CHANGES                          |  2 ++
 iocore/net/UnixNetVConnection.cc | 19 +++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1801eef0/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 292a711..d5d994b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3573] Fix connection leak.
+
   *) [TS-3558] Fix proxy.config.http.auth_server_session_private
 
   *) [TS-3533] Revert commits that break unregistered plugin loading.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1801eef0/iocore/net/UnixNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index ae4d028..2e44010 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -143,7 +143,7 @@ read_signal_and_update(int event, UnixNetVConnection *vc)
     case VC_EVENT_ERROR:
     case VC_EVENT_ACTIVE_TIMEOUT:
     case VC_EVENT_INACTIVITY_TIMEOUT:
-      Debug("inactivity_cop", "event %d: null cont, closing vc %p", event, vc);
+      Debug("inactivity_cop", "event %d: null read.vio cont, closing vc %p", event, vc);
       vc->closed = 1;
       break;
     default:
@@ -166,8 +166,23 @@ static inline int
 write_signal_and_update(int event, UnixNetVConnection *vc)
 {
   vc->recursion++;
-  if (NULL != vc->write.vio._cont)
+  if (vc->write.vio._cont) {
     vc->write.vio._cont->handleEvent(event, &vc->write.vio);
+  } else {
+    switch (event) {
+    case VC_EVENT_EOS:
+    case VC_EVENT_ERROR:
+    case VC_EVENT_ACTIVE_TIMEOUT:
+    case VC_EVENT_INACTIVITY_TIMEOUT:
+      Debug("inactivity_cop", "event %d: null write.vio cont, closing vc %p", event, vc);
+      vc->closed = 1;
+      break;
+    default:
+      Error("Unexpected event %d for vc %p", event, vc);
+      ink_release_assert(0);
+      break;
+    }
+  }
   if (!--vc->recursion && vc->closed) {
     /* BZ  31932 */
     ink_assert(vc->thread == this_ethread());


[02/11] trafficserver git commit: Illumos build fix

Posted by so...@apache.org.
Illumos build fix

(cherry picked from commit 172db8e1c376a3cb29811967e4090e83c343f53b)


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

Branch: refs/heads/5.3.x
Commit: ca0b0ef53b14bb0ee4d25cf522feb4eac65d972e
Parents: 9fc53c2
Author: James Peach <jp...@apache.org>
Authored: Wed Apr 22 15:01:27 2015 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Apr 23 10:24:11 2015 -0600

----------------------------------------------------------------------
 mgmt/utils/MgmtSocket.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ca0b0ef5/mgmt/utils/MgmtSocket.cc
----------------------------------------------------------------------
diff --git a/mgmt/utils/MgmtSocket.cc b/mgmt/utils/MgmtSocket.cc
index c602e95..37f158e 100644
--- a/mgmt/utils/MgmtSocket.cc
+++ b/mgmt/utils/MgmtSocket.cc
@@ -299,7 +299,7 @@ mgmt_get_peereid(int fd, uid_t *euid, gid_t *egid)
   }
 
   *euid = ucred_geteuid(ucred);
-  *guid = ucred_getegid(ucred);
+  *egid = ucred_getegid(ucred);
   ucred_free(ucred);
   return 0;
 #elif TS_HAS_SO_PEERCRED


[04/11] trafficserver git commit: Only use M_MMAP_MAX on systems that have a definition.

Posted by so...@apache.org.
Only use M_MMAP_MAX on systems that have a definition.

(cherry picked from commit a777a14a03d278623f31baa48ee5f8f03f5dec08)


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

Branch: refs/heads/5.3.x
Commit: 904c18a03a2bec74e51574946a259e1dc5814dde
Parents: ebc83f7
Author: James Peach <jp...@apache.org>
Authored: Thu Apr 23 08:56:47 2015 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Apr 23 10:24:13 2015 -0600

----------------------------------------------------------------------
 lib/ts/ink_memory.h | 3 ---
 proxy/Main.cc       | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/904c18a0/lib/ts/ink_memory.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_memory.h b/lib/ts/ink_memory.h
index 69285f0..469d0f1 100644
--- a/lib/ts/ink_memory.h
+++ b/lib/ts/ink_memory.h
@@ -47,12 +47,9 @@
 
 #if TS_HAS_JEMALLOC
 #include <jemalloc/jemalloc.h>
-/* TODO: Should this have a value ? */
-#define ATS_MMAP_MAX 0
 #else
 #if HAVE_MALLOC_H
 #include <malloc.h>
-#define ATS_MMAP_MAX M_MMAP_MAX
 #endif // ! HAVE_MALLOC_H
 #endif // ! TS_HAS_JEMALLOC
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/904c18a0/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 1e97448..393dc2d 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -978,12 +978,12 @@ adjust_sys_settings(void)
   rlim_t maxfiles;
 
 // TODO: I think we might be able to get rid of this?
-#if defined(ATS_MMAP_MAX)
+#if defined(M_MMAP_MAX)
   int mmap_max = -1;
 
   REC_ReadConfigInteger(mmap_max, "proxy.config.system.mmap_max");
   if (mmap_max >= 0)
-    ats_mallopt(ATS_MMAP_MAX, mmap_max);
+    ats_mallopt(M_MMAP_MAX, mmap_max);
 #endif
 
   maxfiles = ink_get_max_files();


[07/11] trafficserver git commit: TS-3558: Update Changes

Posted by so...@apache.org.
TS-3558: Update Changes

(cherry picked from commit 62d391db901a2eff87ea1a03bf966d19d4ac37be)

Conflicts:
	CHANGES


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

Branch: refs/heads/5.3.x
Commit: 59fbad271d7ecda6e08657f1395e0b9b4a5cb364
Parents: 1b7ce62
Author: Brian Geffon <br...@apache.org>
Authored: Mon Apr 27 19:55:05 2015 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Mon May 4 21:35:08 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/59fbad27/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index be56126..292a711 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3558] Fix proxy.config.http.auth_server_session_private
+
   *) [TS-3533] Revert commits that break unregistered plugin loading.
 
   *) [TS-3551] Fix LogUtils.cc compile on Illumos.


[11/11] trafficserver git commit: clang-format

Posted by so...@apache.org.
clang-format


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

Branch: refs/heads/5.3.x
Commit: cf9d1905409e0d7b9090f73b1c3fac1c86377cf8
Parents: 68913f7
Author: Phil Sorber <so...@apache.org>
Authored: Mon May 4 21:46:02 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Mon May 4 21:46:02 2015 -0600

----------------------------------------------------------------------
 proxy/InkAPITest.cc  |  3 +--
 proxy/http/HttpSM.cc | 16 ++++++++--------
 2 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf9d1905/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 6cac306..200759e 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7206,8 +7206,7 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
   "proxy.config.ssl.hsts_max_age", "proxy.config.ssl.hsts_include_subdomains", "proxy.config.http.cache.open_read_retry_time",
   "proxy.config.http.cache.max_open_read_retries", "proxy.config.http.cache.range.write",
   "proxy.config.http.post.check.content_length.enabled", "proxy.config.http.global_user_agent_header",
-  "proxy.config.http.auth_server_session_private"
-};
+  "proxy.config.http.auth_server_session_private"};
 
 REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS)(RegressionTest *test, int /* atype ATS_UNUSED */, int *pstatus)
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf9d1905/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index b71db6a..32a8a36 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -316,9 +316,9 @@ HttpSM::HttpSM()
     enable_redirection(false), redirect_url(NULL), redirect_url_len(0), redirection_tries(0), transfered_bytes(0),
     post_failed(false), debug_on(false), plugin_tunnel_type(HTTP_NO_PLUGIN_TUNNEL), plugin_tunnel(NULL), reentrancy_count(0),
     history_pos(0), tunnel(), ua_entry(NULL), ua_session(NULL), background_fill(BACKGROUND_FILL_NONE), ua_raw_buffer_reader(NULL),
-    server_entry(NULL), server_session(NULL), will_be_private_ss(false), shared_session_retries(0), server_buffer_reader(NULL), transform_info(),
-    post_transform_info(), has_active_plugin_agents(false), second_cache_sm(NULL), default_handler(NULL), pending_action(NULL),
-    historical_action(NULL), last_action(HttpTransact::SM_ACTION_UNDEFINED),
+    server_entry(NULL), server_session(NULL), will_be_private_ss(false), shared_session_retries(0), server_buffer_reader(NULL),
+    transform_info(), post_transform_info(), has_active_plugin_agents(false), second_cache_sm(NULL), default_handler(NULL),
+    pending_action(NULL), historical_action(NULL), last_action(HttpTransact::SM_ACTION_UNDEFINED),
     // TODO:  Now that bodies can be empty, should the body counters be set to -1 ? TS-2213
     client_request_hdr_bytes(0), client_request_body_bytes(0), server_request_hdr_bytes(0), server_request_body_bytes(0),
     server_response_hdr_bytes(0), server_response_body_bytes(0), client_response_hdr_bytes(0), client_response_body_bytes(0),
@@ -4606,11 +4606,11 @@ HttpSM::do_http_server_open(bool raw)
   }
 
   if (t_state.method == HTTP_WKSIDX_POST || t_state.method == HTTP_WKSIDX_PUT) {
-     // don't share the session if keep-alive for post is not on
-     if (t_state.txn_conf->keep_alive_post_out == 0) {
-       DebugSM("http_ss", "Setting server session to private because of keep-alive post out");
-       will_be_private_ss = true;
-     }
+    // don't share the session if keep-alive for post is not on
+    if (t_state.txn_conf->keep_alive_post_out == 0) {
+      DebugSM("http_ss", "Setting server session to private because of keep-alive post out");
+      will_be_private_ss = true;
+    }
   }
 
   // If there is already an attached server session mark it as private.


[10/11] trafficserver git commit: TS-3531: Ignore blank lines in the plugin config file

Posted by so...@apache.org.
TS-3531: Ignore blank lines in the plugin config file

(cherry picked from commit f39aaba197a4f4d6559a94aa5b8ffa5dcfc3c3b6)


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

Branch: refs/heads/5.3.x
Commit: 68913f77e4c8851cdfee3821b4d8278eba5705eb
Parents: 1801eef
Author: Sudheer Vinukonda <su...@yahoo-inc.com>
Authored: Fri May 1 21:40:27 2015 +0000
Committer: Phil Sorber <so...@apache.org>
Committed: Mon May 4 21:40:28 2015 -0600

----------------------------------------------------------------------
 CHANGES                      |  2 ++
 plugins/cacheurl/cacheurl.cc | 25 ++++++++++++++++++-------
 2 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/68913f77/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index d5d994b..4a8387b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3531] Ignore blank lines in the plugin config file.
+
   *) [TS-3573] Fix connection leak.
 
   *) [TS-3558] Fix proxy.config.http.auth_server_session_private

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/68913f77/plugins/cacheurl/cacheurl.cc
----------------------------------------------------------------------
diff --git a/plugins/cacheurl/cacheurl.cc b/plugins/cacheurl/cacheurl.cc
index e01407d..5f03598 100644
--- a/plugins/cacheurl/cacheurl.cc
+++ b/plugins/cacheurl/cacheurl.cc
@@ -236,17 +236,23 @@ load_config_file(const char *config_file)
 
   while (TSfgets(fh, buffer, sizeof(buffer) - 1)) {
     lineno++;
-    if (*buffer == '#') {
-      /* # Comments, only at line beginning */
+
+    // make sure line was not bigger than buffer
+    if ((eol = strchr(buffer, '\n')) == NULL && (eol = strstr(buffer, "\r\n")) == NULL) {
+      // Malformed line - skip
+      TSError("%s: config line too long, did not get a good line in cfg, skipping, line: %s", PLUGIN_NAME, buffer);
+      memset(buffer, 0, sizeof(buffer));
       continue;
-    }
-    eol = strstr(buffer, "\n");
-    if (eol) {
-      *eol = 0; /* Terminate string at newline */
     } else {
-      /* Malformed line - skip */
+      *eol = 0;
+    }
+    // make sure line has something useful on it
+    // or allow # Comments, only at line beginning
+    if (eol - buffer < 2 || buffer[0] == '#') {
+      memset(buffer, 0, sizeof(buffer));
       continue;
     }
+
     /* Split line into two parts based on whitespace */
     /* Find first whitespace */
     spstart = strstr(buffer, " ");
@@ -434,6 +440,7 @@ TSPluginInit(int argc, const char *argv[])
   info.support_email = (char *)"dev@trafficserver.apache.org";
 
   if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS) {
+    TSDebug(PLUGIN_NAME, "ERROR, Plugin registration failed");
     initialization_error("Plugin registration failed.");
     return;
   }
@@ -444,5 +451,9 @@ TSPluginInit(int argc, const char *argv[])
     /* Store the pattern replacement list in the continuation */
     TSContDataSet(contp, prl);
     TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, contp);
+  } else {
+    TSDebug(PLUGIN_NAME, "ERROR, Plugin config load failed.");
+    initialization_error("Plugin config load failed.");
+    return;
   }
 }


[05/11] trafficserver git commit: TS-3558: Update Docs

Posted by so...@apache.org.
TS-3558: Update Docs

(cherry picked from commit a1af594d99019df93a647d31b397dfc60bab7e05)


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

Branch: refs/heads/5.3.x
Commit: ba8a4f6f2f16bd2aa2db1240785f8676a1a2b36b
Parents: 904c18a
Author: Brian Geffon <br...@apache.org>
Authored: Mon Apr 27 19:53:40 2015 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Mon May 4 21:30:59 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ba8a4f6f/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 2cf5373..d23b864 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -728,6 +728,12 @@ Value Effect
    Note that setting this parameter to (``2``) will not work correctly unless
    the dedicated SSL threads are disabled (:ts:cv:`proxy.config.ssl.number.threads`
    is set to (``-1``)).
+   
+.. ts:cv:: CONFIG proxy.config.http.auth_server_session_private INT 1
+
+   If enabled (``1``) anytime a request contains a (``Authorization``), (``Proxy-Authorization``)
+   or (``Www-Authenticate``) header the connection will be closed and not reused. This marks
+   the connection as private. When disabled (``0``) the connection will be available for reuse.
 
 .. ts:cv:: CONFIG proxy.config.http.server_session_sharing.match STRING both
 


[08/11] trafficserver git commit: TS-3558: Auth Server Session Private: Fix enum order

Posted by so...@apache.org.
TS-3558: Auth Server Session Private: Fix enum order

(cherry picked from commit 7ea121ceb3ba7e50fb59929bf39fb7eaf69d13b4)


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

Branch: refs/heads/5.3.x
Commit: f2d2391ab204e13c3e2ae3cd532d4849b44499ff
Parents: 59fbad2
Author: Brian Geffon <br...@apache.org>
Authored: Mon Apr 27 19:59:12 2015 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Mon May 4 21:35:13 2015 -0600

----------------------------------------------------------------------
 lib/ts/apidefs.h.in | 2 +-
 proxy/InkAPITest.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f2d2391a/lib/ts/apidefs.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in
index a3e0d93..04f4dd9 100644
--- a/lib/ts/apidefs.h.in
+++ b/lib/ts/apidefs.h.in
@@ -679,7 +679,6 @@ extern "C"
     TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN,
     TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT,
     TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT,
-    TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE,
     TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS, // DEPRECATED
     TS_CONFIG_HTTP_SERVER_SESSION_SHARING_POOL,
     TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH,
@@ -758,6 +757,7 @@ extern "C"
     TS_CONFIG_HTTP_CACHE_RANGE_WRITE,
     TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED,
     TS_CONFIG_HTTP_GLOBAL_USER_AGENT_HEADER,
+    TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE,
     TS_CONFIG_LAST_ENTRY
   } TSOverridableConfigKey;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f2d2391a/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 8a7ec68..6cac306 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7170,7 +7170,6 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
   "proxy.config.url_remap.pristine_host_hdr", "proxy.config.http.chunking_enabled", "proxy.config.http.negative_caching_enabled",
   "proxy.config.http.negative_caching_lifetime", "proxy.config.http.cache.when_to_revalidate",
   "proxy.config.http.keep_alive_enabled_in", "proxy.config.http.keep_alive_enabled_out", "proxy.config.http.keep_alive_post_out",
-  "proxy.config.http.auth_server_session_private",
   "proxy.config.http.share_server_sessions", "proxy.config.http.server_session_sharing.pool",
   "proxy.config.http.server_session_sharing.match", "proxy.config.net.sock_recv_buffer_size_out",
   "proxy.config.net.sock_send_buffer_size_out", "proxy.config.net.sock_option_flag_out",
@@ -7207,6 +7206,7 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
   "proxy.config.ssl.hsts_max_age", "proxy.config.ssl.hsts_include_subdomains", "proxy.config.http.cache.open_read_retry_time",
   "proxy.config.http.cache.max_open_read_retries", "proxy.config.http.cache.range.write",
   "proxy.config.http.post.check.content_length.enabled", "proxy.config.http.global_user_agent_header",
+  "proxy.config.http.auth_server_session_private"
 };
 
 REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS)(RegressionTest *test, int /* atype ATS_UNUSED */, int *pstatus)