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/04/22 18:55:20 UTC

[01/12] trafficserver git commit: TS-3519: HTTP/2 seeing a lot of GOAWAY frames being sent

Repository: trafficserver
Updated Branches:
  refs/heads/5.3.x fa978afd7 -> 05aa7a3b3


TS-3519: HTTP/2 seeing a lot of GOAWAY frames being sent

(cherry picked from commit 7b5730b11e8ef9993137df08c7e8411877d74cfa)


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

Branch: refs/heads/5.3.x
Commit: c2d162c4c7436db7cbb03873d1a42c9a6e2f1051
Parents: fa978afd7
Author: Bryan Call <bc...@apache.org>
Authored: Thu Apr 16 16:53:15 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Fri Apr 17 07:38:40 2015 -0600

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c2d162c4/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 1e50b57..2af2d6a 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -284,7 +284,7 @@ rcv_rst_stream_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, const
   DebugSsn(&cs, "http2_cs", "[%" PRId64 "] Received RST_STREAM frame.", cs.connection_id());
 
   Http2Stream *stream = cstate.find_stream(frame.header().streamid);
-  if (stream == NULL) {
+  if (frame.header().streamid == 0) {
     return HTTP2_ERROR_PROTOCOL_ERROR;
   }
 
@@ -292,7 +292,7 @@ rcv_rst_stream_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, const
     return HTTP2_ERROR_FRAME_SIZE_ERROR;
   }
 
-  if (!stream->change_state(frame.header().type, frame.header().flags)) {
+  if (stream != NULL && !stream->change_state(frame.header().type, frame.header().flags)) {
     // If a RST_STREAM frame identifying an idle stream is received, the
     // recipient MUST treat this as a connection error of type PROTOCOL_ERROR.
     return HTTP2_ERROR_PROTOCOL_ERROR;
@@ -306,7 +306,9 @@ rcv_rst_stream_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, const
 
   DebugSsn(&cs, "http2_cs", "[%" PRId64 "] RST_STREAM: Stream ID: %u, Error Code: %u)", cs.connection_id(), stream->get_id(),
            rst_stream.error_code);
-  cstate.delete_stream(stream);
+  if (stream != NULL) {
+    cstate.delete_stream(stream);
+  }
 
   return HTTP2_ERROR_NO_ERROR;
 }


[06/12] trafficserver git commit: TS-3522: Segfault due to inactivity_cop.

Posted by so...@apache.org.
TS-3522: Segfault due to inactivity_cop.

(cherry picked from commit 787eb418e021d00584e297c4a895d87547a351ea)


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

Branch: refs/heads/5.3.x
Commit: 61c6599327d35c6e9151055fda23bf143636b848
Parents: 81cbc8a
Author: shinrich <sh...@yahoo-inc.com>
Authored: Mon Apr 20 15:40:46 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Tue Apr 21 14:50:06 2015 -0600

----------------------------------------------------------------------
 CHANGES                          | 2 ++
 iocore/net/UnixNetVConnection.cc | 5 +++--
 proxy/PluginVC.cc                | 2 +-
 proxy/http/HttpClientSession.cc  | 3 +++
 4 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61c65993/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 7bf631b..280d95f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3522] Segfault due to inactivity_cop.
+
   *) [TS-3530] HTTP/2 memory leak with headers and more...
 
   *) [TS-3519] HTTP/2 seeing a lot of GOAWAY frames being sent

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61c65993/iocore/net/UnixNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index c8156e1..ae4d028 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -166,7 +166,8 @@ static inline int
 write_signal_and_update(int event, UnixNetVConnection *vc)
 {
   vc->recursion++;
-  vc->write.vio._cont->handleEvent(event, &vc->write.vio);
+  if (NULL != vc->write.vio._cont)
+    vc->write.vio._cont->handleEvent(event, &vc->write.vio);
   if (!--vc->recursion && vc->closed) {
     /* BZ  31932 */
     ink_assert(vc->thread == this_ethread());
@@ -592,7 +593,7 @@ UnixNetVConnection::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader
 {
   ink_assert(!closed);
   write.vio.op = VIO::WRITE;
-  write.vio.mutex = c->mutex;
+  write.vio.mutex = c ? c->mutex : this->mutex;
   write.vio._cont = c;
   write.vio.nbytes = nbytes;
   write.vio.ndone = 0;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61c65993/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 7651efb..a457a40 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -271,7 +271,7 @@ PluginVC::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffer,
 
   // Note: we set vio.op last because process_write_side looks at it to
   //  tell if the VConnection is active.
-  write_state.vio.mutex = c->mutex;
+  write_state.vio.mutex = c != NULL ? c->mutex : this->mutex;
   write_state.vio._cont = c;
   write_state.vio.nbytes = nbytes;
   write_state.vio.ndone = 0;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61c65993/proxy/http/HttpClientSession.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index a07fcc0..742a883 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -493,6 +493,9 @@ HttpClientSession::release(IOBufferReader *r)
 
   HTTP_DECREMENT_DYN_STAT(http_current_client_transactions_stat);
 
+  // Clean up the write VIO in case of inactivity timeout
+  this->do_io_write(NULL, 0, NULL);
+
   // Check to see there is remaining data in the
   //  buffer.  If there is, spin up a new state
   //  machine to process it.  Otherwise, issue an


[08/12] trafficserver git commit: TS-3529: Add a config to allow ATS to start up even if some certificates are bad.

Posted by so...@apache.org.
TS-3529:  Add a config to allow ATS to start up even if some certificates are bad.

(cherry picked from commit ef36a509c0a3cf0309ad563e980d7e002f9b2d9c)

Conflicts:
	CHANGES


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

Branch: refs/heads/5.3.x
Commit: bf4ba0cf2741d7d189deba608154b07aa61dce46
Parents: efd2db2
Author: shinrich <sh...@yahoo-inc.com>
Authored: Tue Apr 21 14:47:51 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Tue Apr 21 14:50:42 2015 -0600

----------------------------------------------------------------------
 CHANGES                  |  2 ++
 iocore/net/P_SSLConfig.h |  1 +
 iocore/net/SSLConfig.cc  | 14 +++++++++-----
 mgmt/RecordsConfig.cc    |  2 ++
 4 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bf4ba0cf/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 280d95f..0df57b1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3529] Add config option to allow ATS to start even if certificate files are bad.
+
   *) [TS-3522] Segfault due to inactivity_cop.
 
   *) [TS-3530] HTTP/2 memory leak with headers and more...

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bf4ba0cf/iocore/net/P_SSLConfig.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_SSLConfig.h b/iocore/net/P_SSLConfig.h
index 549aa28..68dd50f 100644
--- a/iocore/net/P_SSLConfig.h
+++ b/iocore/net/P_SSLConfig.h
@@ -66,6 +66,7 @@ struct SSLConfigParams : public ConfigInfo {
   char *dhparamsFile;
   char *cipherSuite;
   char *client_cipherSuite;
+  int configExitOnLoadError;
   int clientCertLevel;
   int verify_depth;
   int ssl_session_cache; // SSL_SESSION_CACHE_MODE

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bf4ba0cf/iocore/net/SSLConfig.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index acd8c19..669e1c1 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -231,6 +231,7 @@ SSLConfigParams::initialize()
   ats_free(serverCertRelativePath);
 
   configFilePath = RecConfigReadConfigPath("proxy.config.ssl.server.multicert.filename");
+  REC_ReadConfigInteger(configExitOnLoadError, "proxy.config.ssl.server.multicert.exit_on_load_fail");
 
   REC_ReadConfigStringAlloc(ssl_server_private_key_path, "proxy.config.ssl.server.private_key.path");
   set_paths_helper(ssl_server_private_key_path, NULL, &serverKeyPathOnly, NULL);
@@ -324,12 +325,17 @@ SSLCertificateConfig::startup()
 {
   sslCertUpdate = new ConfigUpdateHandler<SSLCertificateConfig>();
   sslCertUpdate->attach("proxy.config.ssl.server.multicert.filename");
+  sslCertUpdate->attach("proxy.config.ssl.server.multicert.exit_on_load_fail");
   sslCertUpdate->attach("proxy.config.ssl.server.ticket_key.filename");
   sslCertUpdate->attach("proxy.config.ssl.server.cert.path");
   sslCertUpdate->attach("proxy.config.ssl.server.private_key.path");
   sslCertUpdate->attach("proxy.config.ssl.server.cert_chain.filename");
 
-  if (!reconfigure()) {
+  // Exit if there are problems on the certificate loading and the
+  // proxy.config.ssl.server.multicert.exit_on_load_fail is true
+  SSLConfigParams *params = SSLConfig::acquire();
+  if (!reconfigure() && params->configExitOnLoadError) {
+    Error("Problems loading ssl certificate file, %s.  Exiting.", params->configFilePath);
     _exit(1);
   }
   return true;
@@ -351,11 +357,9 @@ SSLCertificateConfig::reconfigure()
   }
 
   SSLParseCertificateConfiguration(params, lookup);
-  if (lookup->is_valid) {
-    configid = configProcessor.set(configid, lookup);
-  } else {
+  configid = configProcessor.set(configid, lookup);
+  if (!lookup->is_valid) {
     retStatus = false;
-    delete lookup;
   }
 
   return retStatus;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bf4ba0cf/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 51eb607..d237508 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1282,6 +1282,8 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.ssl.server.multicert.filename", RECD_STRING, "ssl_multicert.config", RECU_RESTART_TS, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.ssl.server.multicert.exit_on_load_fail", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
+  ,
   {RECT_CONFIG, "proxy.config.ssl.server.ticket_key.filename", RECD_STRING, "ssl_ticket.key", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.ssl.server.private_key.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, NULL, RECA_NULL}


[03/12] trafficserver git commit: TS-3519: HTTP/2 seeing a lot of GOAWAY frames being sent Fixed where stream could be dereferenced as a NULL pointer

Posted by so...@apache.org.
TS-3519: HTTP/2 seeing a lot of GOAWAY frames being sent
Fixed where stream could be dereferenced as a NULL pointer

(cherry picked from commit 43a4086ca17bdd9aab6db8f914898aa726568f52)


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

Branch: refs/heads/5.3.x
Commit: 15879950dd375cf28359330e02f9114a1d211eb3
Parents: 71a89e4
Author: Bryan Call <bc...@apache.org>
Authored: Thu Apr 16 22:02:44 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Fri Apr 17 07:38:42 2015 -0600

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15879950/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 2af2d6a..3322d6d 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -304,9 +304,9 @@ rcv_rst_stream_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, const
     return HTTP2_ERROR_PROTOCOL_ERROR;
   }
 
-  DebugSsn(&cs, "http2_cs", "[%" PRId64 "] RST_STREAM: Stream ID: %u, Error Code: %u)", cs.connection_id(), stream->get_id(),
-           rst_stream.error_code);
   if (stream != NULL) {
+    DebugSsn(&cs, "http2_cs", "[%" PRId64 "] RST_STREAM: Stream ID: %u, Error Code: %u)", cs.connection_id(), stream->get_id(),
+             rst_stream.error_code);
     cstate.delete_stream(stream);
   }
 


[02/12] trafficserver git commit: TS-3519: Updated CHANGES

Posted by so...@apache.org.
TS-3519: Updated CHANGES

(cherry picked from commit 3afac5a26a5b4cbb140a8d49f37035693b28a202)


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

Branch: refs/heads/5.3.x
Commit: 71a89e41d7cf24649bee239da5f5ac1d89e622ab
Parents: c2d162c
Author: Bryan Call <bc...@apache.org>
Authored: Thu Apr 16 16:55:06 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Fri Apr 17 07:38:41 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/71a89e41/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 723f888..590779e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
-  *) [TS-3520]: Fix logging core dump due to invalid unmapped url length/buffer
+  *) [TS-3519] HTTP/2 seeing a lot of GOAWAY frames being sent
+
+  *) [TS-3520] Fix logging core dump due to invalid unmapped url length/buffer
 
   *) [TS-3516] Fix various compile warnings with latest versions of clang.
 


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

Branch: refs/heads/5.3.x
Commit: 05aa7a3b3b79ff56bda9965cec86e36ce95c1732
Parents: 33cc7b3
Author: Phil Sorber <so...@apache.org>
Authored: Wed Apr 22 10:50:13 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Wed Apr 22 10:50:13 2015 -0600

----------------------------------------------------------------------
 proxy/InkAPI.cc | 2 +-
 proxy/Plugin.cc | 9 +++++----
 proxy/Plugin.h  | 6 ++----
 3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05aa7a3b/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 666db4f..f46c279 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -1784,7 +1784,7 @@ TSPluginRegister(TSSDKVersion sdk_version, TSPluginRegistrationInfo *plugin_info
   if (!plugin_reg_current)
     return TS_ERROR;
 
-  sdk_assert(sdk_sanity_check_null_ptr((void*) plugin_info) == TS_SUCCESS);
+  sdk_assert(sdk_sanity_check_null_ptr((void *)plugin_info) == TS_SUCCESS);
 
   plugin_reg_current->plugin_registered = true;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05aa7a3b/proxy/Plugin.cc
----------------------------------------------------------------------
diff --git a/proxy/Plugin.cc b/proxy/Plugin.cc
index 6cfac73..4a167c1 100644
--- a/proxy/Plugin.cc
+++ b/proxy/Plugin.cc
@@ -51,9 +51,10 @@ DLL<PluginRegInfo> plugin_reg_list;
 PluginRegInfo *plugin_reg_current = NULL;
 
 PluginRegInfo::PluginRegInfo()
-  : plugin_registered(false), plugin_path(NULL), sdk_version(PLUGIN_SDK_VERSION_UNKNOWN),
-    plugin_name(NULL), vendor_name(NULL), support_email(NULL)
-{ }
+  : plugin_registered(false), plugin_path(NULL), sdk_version(PLUGIN_SDK_VERSION_UNKNOWN), plugin_name(NULL), vendor_name(NULL),
+    support_email(NULL)
+{
+}
 
 static bool
 plugin_load(int argc, char *argv[], bool validateOnly)
@@ -101,7 +102,7 @@ plugin_load(int argc, char *argv[], bool validateOnly)
     plugin_reg_current = new PluginRegInfo;
     plugin_reg_current->plugin_path = ats_strdup(path);
 
-    init = (init_func_t) dlsym(handle, "TSPluginInit");
+    init = (init_func_t)dlsym(handle, "TSPluginInit");
     if (!init) {
       if (validateOnly) {
         return false;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05aa7a3b/proxy/Plugin.h
----------------------------------------------------------------------
diff --git a/proxy/Plugin.h b/proxy/Plugin.h
index 9e5098b..eb2bca4 100644
--- a/proxy/Plugin.h
+++ b/proxy/Plugin.h
@@ -28,16 +28,14 @@
 
 // need to keep syncronized with TSSDKVersion
 //   in ts/ts.h.in
-typedef enum
-{
+typedef enum {
   PLUGIN_SDK_VERSION_UNKNOWN = -1,
   PLUGIN_SDK_VERSION_2_0,
   PLUGIN_SDK_VERSION_3_0,
   PLUGIN_SDK_VERSION_4_0
 } PluginSDKVersion;
 
-struct PluginRegInfo
-{
+struct PluginRegInfo {
   PluginRegInfo();
   ~PluginRegInfo();
 


[07/12] trafficserver git commit: Tidy up condition checks added for TS-3522.

Posted by so...@apache.org.
Tidy up condition checks added for TS-3522.

(cherry picked from commit d73914f75e4db88eba39e6c644692dedc1fe37dd)


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

Branch: refs/heads/5.3.x
Commit: efd2db288c7e031bd28af7736bf1673c102cb65d
Parents: 61c6599
Author: shinrich <sh...@yahoo-inc.com>
Authored: Mon Apr 20 15:48:03 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Tue Apr 21 14:50:11 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/efd2db28/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index a457a40..51641e5 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -271,7 +271,7 @@ PluginVC::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffer,
 
   // Note: we set vio.op last because process_write_side looks at it to
   //  tell if the VConnection is active.
-  write_state.vio.mutex = c != NULL ? c->mutex : this->mutex;
+  write_state.vio.mutex = c ? c->mutex : this->mutex;
   write_state.vio._cont = c;
   write_state.vio.nbytes = nbytes;
   write_state.vio.ndone = 0;


[04/12] trafficserver git commit: TS-3530: HTTP/2 memory leak with headers and more...

Posted by so...@apache.org.
TS-3530: HTTP/2 memory leak with headers and more...

(cherry picked from commit bc2ae5a8dbcfe75b60d419190d1ee7dadae26d68)


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

Branch: refs/heads/5.3.x
Commit: 05bb034cfcacc46ae086a87699e655cf1ae8e065
Parents: 1587995
Author: Bryan Call <bc...@apache.org>
Authored: Fri Apr 17 14:27:56 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Fri Apr 17 13:44:24 2015 -0600

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.cc | 2 +-
 proxy/http2/Http2ConnectionState.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05bb034c/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 3322d6d..a63f4fd 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -653,7 +653,7 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
 
     if (error != HTTP2_ERROR_NO_ERROR) {
       this->send_goaway_frame(last_streamid, error);
-
+      cleanup_streams();
       // XXX We need to think a bit harder about how to coordinate the client session and the
       // protocol connection. At this point, the protocol is shutting down, but there's no way
       // to tell that to the client session. Perhaps this could be solved by implementing the

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05bb034c/proxy/http2/Http2ConnectionState.h
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.h b/proxy/http2/Http2ConnectionState.h
index 8f33542..6a97690 100644
--- a/proxy/http2/Http2ConnectionState.h
+++ b/proxy/http2/Http2ConnectionState.h
@@ -105,7 +105,7 @@ public:
 
   ~Http2Stream()
   {
-    _req_header.clear();
+    _req_header.destroy();
 
     if (_fetch_sm) {
       _fetch_sm->ext_destroy();


[05/12] trafficserver git commit: TS-3530: Updated CHANGES

Posted by so...@apache.org.
TS-3530: Updated CHANGES

(cherry picked from commit cd9c8a3b517eb6c4039c19196f2ed48cca985f4f)


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

Branch: refs/heads/5.3.x
Commit: 81cbc8a2892e5c4d99703b8e3f8bf8b90c532c3b
Parents: 05bb034
Author: Bryan Call <bc...@apache.org>
Authored: Fri Apr 17 14:30:02 2015 -0500
Committer: Phil Sorber <so...@apache.org>
Committed: Fri Apr 17 13:44:25 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/81cbc8a2/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 590779e..7bf631b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3530] HTTP/2 memory leak with headers and more...
+
   *) [TS-3519] HTTP/2 seeing a lot of GOAWAY frames being sent
 
   *) [TS-3520] Fix logging core dump due to invalid unmapped url length/buffer


[10/12] trafficserver git commit: TS-3533: Revert "TS-3337: remove internal plugin SDK enumeration"

Posted by so...@apache.org.
TS-3533: Revert "TS-3337: remove internal plugin SDK enumeration"

This reverts commit 7f0f3a47b253d361a16c33413b4501a5ff5d69fe.

Conflicts:
	CHANGES
	proxy/InkAPI.cc
	proxy/Plugin.cc
	proxy/Plugin.h


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

Branch: refs/heads/5.3.x
Commit: a54e87617dce540e0499b2a9d9870dce7ce016ce
Parents: 37b2819
Author: Phil Sorber <so...@apache.org>
Authored: Wed Apr 22 10:47:35 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Wed Apr 22 10:47:35 2015 -0600

----------------------------------------------------------------------
 CHANGES         |  2 --
 proxy/InkAPI.cc | 20 ++++++++++----------
 proxy/Plugin.cc | 32 +++++++-------------------------
 proxy/Plugin.h  | 14 +++++++++++++-
 4 files changed, 30 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a54e8761/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 0df57b1..4409b70 100644
--- a/CHANGES
+++ b/CHANGES
@@ -211,8 +211,6 @@ Changes with Apache Traffic Server 5.3.0
 
   *) [TS-3338] Update the list of gauges in the epic plugin.
 
-  *) [TS-3337] Remove internal plugin SDK versioning.
-
   *) [TS-3336] Remove unimplemented HTTP metrics.
 
   *) [TS-3333] Enable TOS settings on IPv6 connections.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a54e8761/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 6c73d16..666db4f 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -1779,22 +1779,22 @@ TSPluginDirGet(void)
 TSReturnCode
 TSPluginRegister(TSSDKVersion sdk_version, TSPluginRegistrationInfo *plugin_info)
 {
-  sdk_assert(sdk_sanity_check_null_ptr((void *)plugin_info) == TS_SUCCESS);
+  PluginSDKVersion version = (PluginSDKVersion)sdk_version;
 
-  if (!plugin_reg_current) {
+  if (!plugin_reg_current)
     return TS_ERROR;
-  }
 
-  switch (sdk_version) {
-  case TS_SDK_VERSION_2_0:
-  case TS_SDK_VERSION_3_0:
-    break;
-  default:
-    return TS_ERROR;
-  }
+  sdk_assert(sdk_sanity_check_null_ptr((void*) plugin_info) == TS_SUCCESS);
 
   plugin_reg_current->plugin_registered = true;
 
+  // We're compatible only within the 3.x release
+  if (version >= PLUGIN_SDK_VERSION_3_0 && version < PLUGIN_SDK_VERSION_4_0) {
+    plugin_reg_current->sdk_version = version;
+  } else {
+    plugin_reg_current->sdk_version = PLUGIN_SDK_VERSION_UNKNOWN;
+  }
+
   if (plugin_info->plugin_name) {
     plugin_reg_current->plugin_name = ats_strdup(plugin_info->plugin_name);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a54e8761/proxy/Plugin.cc
----------------------------------------------------------------------
diff --git a/proxy/Plugin.cc b/proxy/Plugin.cc
index 130cae6..6cfac73 100644
--- a/proxy/Plugin.cc
+++ b/proxy/Plugin.cc
@@ -51,23 +51,9 @@ DLL<PluginRegInfo> plugin_reg_list;
 PluginRegInfo *plugin_reg_current = NULL;
 
 PluginRegInfo::PluginRegInfo()
-  : plugin_registered(false), plugin_path(NULL),
+  : plugin_registered(false), plugin_path(NULL), sdk_version(PLUGIN_SDK_VERSION_UNKNOWN),
     plugin_name(NULL), vendor_name(NULL), support_email(NULL)
-{
-}
-
-PluginRegInfo::~PluginRegInfo()
-{
-  // We don't support unloading plugins once they are successfully loaded, so assert
-  // that we don't accidentally attempt this.
-  ink_release_assert(this->plugin_registered == false);
-  ink_release_assert(this->link.prev == NULL);
-
-  ats_free(this->plugin_path);
-  ats_free(this->plugin_name);
-  ats_free(this->vendor_name);
-  ats_free(this->support_email);
-}
+{ }
 
 static bool
 plugin_load(int argc, char *argv[], bool validateOnly)
@@ -75,6 +61,7 @@ plugin_load(int argc, char *argv[], bool validateOnly)
   char path[PATH_NAME_MAX + 1];
   void *handle;
   init_func_t init;
+  PluginRegInfo *plugin_reg_temp;
 
   if (argc < 1) {
     return true;
@@ -83,14 +70,14 @@ plugin_load(int argc, char *argv[], bool validateOnly)
 
   Note("loading plugin '%s'", path);
 
-  for (PluginRegInfo *plugin_reg_temp = plugin_reg_list.head; plugin_reg_temp != NULL;
-       plugin_reg_temp = (plugin_reg_temp->link).next) {
+  plugin_reg_temp = plugin_reg_list.head;
+  while (plugin_reg_temp) {
     if (strcmp(plugin_reg_temp->plugin_path, path) == 0) {
       Warning("multiple loading of plugin %s", path);
       break;
     }
+    plugin_reg_temp = (plugin_reg_temp->link).next;
   }
-
   // elevate the access to read files as root if compiled with capabilities, if not
   // change the effective user to root
   {
@@ -126,12 +113,7 @@ plugin_load(int argc, char *argv[], bool validateOnly)
     init(argc, argv);
   } // done elevating access
 
-  if (plugin_reg_current->plugin_registered) {
-    plugin_reg_list.push(plugin_reg_current);
-  } else {
-    delete plugin_reg_current;
-  }
-
+  plugin_reg_list.push(plugin_reg_current);
   plugin_reg_current = NULL;
 
   return true;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a54e8761/proxy/Plugin.h
----------------------------------------------------------------------
diff --git a/proxy/Plugin.h b/proxy/Plugin.h
index 44f31f8..9e5098b 100644
--- a/proxy/Plugin.h
+++ b/proxy/Plugin.h
@@ -26,13 +26,25 @@
 
 #include "List.h"
 
-struct PluginRegInfo {
+// need to keep syncronized with TSSDKVersion
+//   in ts/ts.h.in
+typedef enum
+{
+  PLUGIN_SDK_VERSION_UNKNOWN = -1,
+  PLUGIN_SDK_VERSION_2_0,
+  PLUGIN_SDK_VERSION_3_0,
+  PLUGIN_SDK_VERSION_4_0
+} PluginSDKVersion;
+
+struct PluginRegInfo
+{
   PluginRegInfo();
   ~PluginRegInfo();
 
   bool plugin_registered;
   char *plugin_path;
 
+  PluginSDKVersion sdk_version;
   char *plugin_name;
   char *vendor_name;
   char *support_email;


[09/12] trafficserver git commit: TS-3533: Revert "[TS-3294]: Fix global plugin's dlhandle resource leak"

Posted by so...@apache.org.
TS-3533: Revert "[TS-3294]: Fix global plugin's dlhandle resource leak"

This reverts commit ad9958b9240f784ce5cf0045fd975d143df2ea0e.

Conflicts:
	proxy/Plugin.cc


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

Branch: refs/heads/5.3.x
Commit: 37b2819b746599e591ca15600488356fe546aea9
Parents: bf4ba0c
Author: Phil Sorber <so...@apache.org>
Authored: Wed Apr 22 10:45:03 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Wed Apr 22 10:45:03 2015 -0600

----------------------------------------------------------------------
 proxy/Plugin.cc | 14 ++++++--------
 proxy/Plugin.h  |  2 --
 2 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/37b2819b/proxy/Plugin.cc
----------------------------------------------------------------------
diff --git a/proxy/Plugin.cc b/proxy/Plugin.cc
index 85db1ea..130cae6 100644
--- a/proxy/Plugin.cc
+++ b/proxy/Plugin.cc
@@ -51,7 +51,8 @@ DLL<PluginRegInfo> plugin_reg_list;
 PluginRegInfo *plugin_reg_current = NULL;
 
 PluginRegInfo::PluginRegInfo()
-  : plugin_registered(false), plugin_path(NULL), plugin_name(NULL), vendor_name(NULL), support_email(NULL), dlh(NULL)
+  : plugin_registered(false), plugin_path(NULL),
+    plugin_name(NULL), vendor_name(NULL), support_email(NULL)
 {
 }
 
@@ -66,14 +67,13 @@ PluginRegInfo::~PluginRegInfo()
   ats_free(this->plugin_name);
   ats_free(this->vendor_name);
   ats_free(this->support_email);
-  if (dlh)
-    dlclose(dlh);
 }
 
 static bool
 plugin_load(int argc, char *argv[], bool validateOnly)
 {
-  char path[PATH_NAME_MAX];
+  char path[PATH_NAME_MAX + 1];
+  void *handle;
   init_func_t init;
 
   if (argc < 1) {
@@ -100,7 +100,7 @@ plugin_load(int argc, char *argv[], bool validateOnly)
     ElevateAccess access(elevate_access != 0);
 #endif /* TS_USE_POSIX_CAP */
 
-    void *handle = dlopen(path, RTLD_NOW);
+    handle = dlopen(path, RTLD_NOW);
     if (!handle) {
       if (validateOnly) {
         return false;
@@ -113,11 +113,9 @@ plugin_load(int argc, char *argv[], bool validateOnly)
     ink_assert(plugin_reg_current == NULL);
     plugin_reg_current = new PluginRegInfo;
     plugin_reg_current->plugin_path = ats_strdup(path);
-    plugin_reg_current->dlh = handle;
 
-    init = (init_func_t)dlsym(plugin_reg_current->dlh, "TSPluginInit");
+    init = (init_func_t) dlsym(handle, "TSPluginInit");
     if (!init) {
-      delete plugin_reg_current;
       if (validateOnly) {
         return false;
       }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/37b2819b/proxy/Plugin.h
----------------------------------------------------------------------
diff --git a/proxy/Plugin.h b/proxy/Plugin.h
index 9364e61..44f31f8 100644
--- a/proxy/Plugin.h
+++ b/proxy/Plugin.h
@@ -37,8 +37,6 @@ struct PluginRegInfo {
   char *vendor_name;
   char *support_email;
 
-  void *dlh;
-
   LINK(PluginRegInfo, link);
 };
 


[11/12] trafficserver git commit: TS-3533: Update CHANGES

Posted by so...@apache.org.
TS-3533: Update CHANGES


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

Branch: refs/heads/5.3.x
Commit: 33cc7b32e23f72db56ff2fa10a8d5c1ee54fe2cf
Parents: a54e876
Author: Phil Sorber <so...@apache.org>
Authored: Wed Apr 22 10:49:23 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Wed Apr 22 10:49:23 2015 -0600

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


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