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 2017/01/19 21:13:33 UTC

[trafficserver] branch 7.1.x updated (f40cbb2 -> cc7fba7)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch 7.1.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

      from  f40cbb2   [TS-5024] Ran clang-format. Modify TSHttpTxnHookAdd to add hook only once.
       new  2007425   TS-5022: nullptr check
       new  cc7fba7   Do not reschedule the periodic inactive_event and cancel it after signal timeout event to SM

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 iocore/net/SSLConfig.cc |  8 +++++---
 proxy/PluginVC.cc       | 15 ++++++++++++---
 proxy/http/HttpSM.cc    | 18 +++++++++++-------
 3 files changed, 28 insertions(+), 13 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].

[trafficserver] 02/02: Do not reschedule the periodic inactive_event and cancel it after signal timeout event to SM

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit cc7fba77c5752d4ae8c0eae9bc98170694e37691
Author: Oknet Xu <xu...@skyguard.com.cn>
AuthorDate: Wed Jan 18 21:50:57 2017 +0800

    Do not reschedule the periodic inactive_event and cancel it after signal timeout event to SM
    
    (cherry picked from commit 977e27d51c068118a491bc6d8a36d1f24a8bdd66)
---
 proxy/PluginVC.cc | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 1ad01d9..df1e111 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -211,7 +211,9 @@ PluginVC::main_handler(int event, void *data)
   } else if (call_event == inactive_event) {
     if (inactive_timeout_at && inactive_timeout_at < Thread::get_hrtime()) {
       process_timeout(&inactive_event, VC_EVENT_INACTIVITY_TIMEOUT);
-      call_event->cancel();
+      if (nullptr == inactive_event) {
+        call_event->cancel();
+      }
     }
   } else {
     if (call_event == sm_lock_retry_event) {
@@ -749,13 +751,17 @@ PluginVC::process_timeout(Event **e, int event_to_send)
   if (closed) {
     // already closed, ignore the timeout event
     // to avoid handle_event asserting use-after-free
+    *e = nullptr;
     return;
   }
 
   if (read_state.vio.op == VIO::READ && !read_state.shutdown && read_state.vio.ntodo() > 0) {
     MUTEX_TRY_LOCK(lock, read_state.vio.mutex, (*e)->ethread);
     if (!lock.is_locked()) {
-      (*e)->schedule_in(PVC_LOCK_RETRY_TIME);
+      if (*e == active_event) {
+        // Only reschedule active_event due to inactive_event is perorid event.
+        (*e)->schedule_in(PVC_LOCK_RETRY_TIME);
+      }
       return;
     }
     *e = nullptr;
@@ -763,7 +769,10 @@ PluginVC::process_timeout(Event **e, int event_to_send)
   } else if (write_state.vio.op == VIO::WRITE && !write_state.shutdown && write_state.vio.ntodo() > 0) {
     MUTEX_TRY_LOCK(lock, write_state.vio.mutex, (*e)->ethread);
     if (!lock.is_locked()) {
-      (*e)->schedule_in(PVC_LOCK_RETRY_TIME);
+      if (*e == active_event) {
+        // Only reschedule active_event due to inactive_event is perorid event.
+        (*e)->schedule_in(PVC_LOCK_RETRY_TIME);
+      }
       return;
     }
     *e = nullptr;

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 01/02: TS-5022: nullptr check

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 200742563ba8328914e3d29e7df6fca41f60bc98
Author: Syeda Persia Aziz <pe...@yahoo.com>
AuthorDate: Wed Jan 18 23:36:35 2017 -0600

    TS-5022: nullptr check
    
    (cherry picked from commit 9b8b25c760067761307e9fdaf677c64900f5ab17)
---
 iocore/net/SSLConfig.cc |  8 +++++---
 proxy/http/HttpSM.cc    | 18 +++++++++++-------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 18b9a14..4cd5f76 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -307,7 +307,9 @@ SSLConfigParams::initialize()
   ssl_client_cert_path     = nullptr;
   REC_ReadConfigStringAlloc(ssl_client_cert_filename, "proxy.config.ssl.client.cert.filename");
   REC_ReadConfigStringAlloc(ssl_client_cert_path, "proxy.config.ssl.client.cert.path");
-  set_paths_helper(ssl_client_cert_path, ssl_client_cert_filename, nullptr, &clientCertPath);
+  if (ssl_client_cert_filename && ssl_client_cert_path) {
+    set_paths_helper(ssl_client_cert_path, ssl_client_cert_filename, nullptr, &clientCertPath);
+  }
   ats_free_null(ssl_client_cert_filename);
   ats_free_null(ssl_client_cert_path);
 
@@ -351,9 +353,9 @@ SSLConfigParams::initialize()
   client_ctx = SSLInitClientContext(this);
   if (!client_ctx) {
     SSLError("Can't initialize the SSL client, HTTPS in remap rules will not function");
+  } else {
+    InsertCTX(this->clientCertPath, this->client_ctx);
   }
-
-  InsertCTX(this->clientCertPath, this->client_ctx);
 }
 
 // getCTX: returns the context attached to the given certificate
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 7d0d067..0c211d5 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4062,13 +4062,17 @@ HttpSM::do_remap_request(bool run_inline)
   }
 
   // check if the overridden client cert filename is already attached to an existing ssl context
-  ats_scoped_str clientCert(Layout::relative_to(t_state.txn_conf->client_cert_filepath, t_state.txn_conf->client_cert_filename));
-  auto tCTX = params->getCTX(clientCert);
-
-  if (tCTX == nullptr) {
-    // make new client ctx and add it to the ctx list
-    auto tctx = params->getNewCTX(clientCert);
-    params->InsertCTX(clientCert, tctx);
+  if (t_state.txn_conf->client_cert_filepath && t_state.txn_conf->client_cert_filename) {
+    ats_scoped_str clientCert(Layout::relative_to(t_state.txn_conf->client_cert_filepath, t_state.txn_conf->client_cert_filename));
+    if (clientCert != nullptr) {
+      auto tCTX = params->getCTX(clientCert);
+
+      if (tCTX == nullptr) {
+        // make new client ctx and add it to the ctx list
+        auto tctx = params->getNewCTX(clientCert);
+        params->InsertCTX(clientCert, tctx);
+      }
+    }
   }
 
   return;

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.