You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2019/01/27 19:22:30 UTC

[trafficserver] branch master updated: Cleanup: Remove "hooks_on" and associated machinery. This is initialized to 'true' and can never change.

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

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new e259008  Cleanup: Remove "hooks_on" and associated machinery. This is initialized to 'true' and can never change.
e259008 is described below

commit e25900853d00ba6d79875eb4733beb2a989cea6f
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Fri Jan 25 21:05:48 2019 -0600

    Cleanup: Remove "hooks_on" and associated machinery.
    This is initialized to 'true' and can never change.
---
 proxy/ProxyClientSession.cc    | 2 +-
 proxy/ProxyClientSession.h     | 7 -------
 proxy/ProxyClientTransaction.h | 5 -----
 proxy/http/HttpSM.cc           | 6 ------
 proxy/http/HttpTransact.h      | 1 -
 proxy/http/HttpUpdateSM.cc     | 1 -
 6 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/proxy/ProxyClientSession.cc b/proxy/ProxyClientSession.cc
index 2307779..6e4857b 100644
--- a/proxy/ProxyClientSession.cc
+++ b/proxy/ProxyClientSession.cc
@@ -170,7 +170,7 @@ ProxyClientSession::do_api_callout(TSHttpHookID id)
   this->api_scope   = API_HOOK_SCOPE_GLOBAL;
   this->api_current = nullptr;
 
-  if (this->hooks_on && this->has_hooks()) {
+  if (this->has_hooks()) {
     SET_HANDLER(&ProxyClientSession::state_api_callout);
     this->state_api_callout(EVENT_NONE, nullptr);
   } else {
diff --git a/proxy/ProxyClientSession.h b/proxy/ProxyClientSession.h
index 33b9148..241da9b 100644
--- a/proxy/ProxyClientSession.h
+++ b/proxy/ProxyClientSession.h
@@ -135,12 +135,6 @@ public:
   }
 
   bool
-  hooks_enabled() const
-  {
-    return this->hooks_on;
-  }
-
-  bool
   has_hooks() const
   {
     return this->api_hooks.has_hooks() || http_global_hooks->has_hooks();
@@ -311,7 +305,6 @@ protected:
 
   // Session specific debug flag.
   bool debug_on   = false;
-  bool hooks_on   = true;
   bool in_destroy = false;
 
   int64_t con_id        = 0;
diff --git a/proxy/ProxyClientTransaction.h b/proxy/ProxyClientTransaction.h
index 4dc46aa..14de555 100644
--- a/proxy/ProxyClientTransaction.h
+++ b/proxy/ProxyClientTransaction.h
@@ -98,11 +98,6 @@ public:
   {
     return parent ? parent->debug() : false;
   }
-  bool
-  hooks_enabled() const
-  {
-    return parent ? parent->hooks_enabled() : false;
-  }
 
   APIHook *
   ssn_hook_get(TSHttpHookID id) const
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 8cdb225..cf94a9f 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -503,7 +503,6 @@ HttpSM::attach_client_session(ProxyClientTransaction *client_vc, IOBufferReader
   ats_ip_copy(&t_state.client_info.dst_addr, netvc->get_local_addr());
   t_state.client_info.dst_addr.port() = netvc->get_local_port();
   t_state.client_info.is_transparent  = netvc->get_is_transparent();
-  t_state.backdoor_request            = !client_vc->hooks_enabled();
   t_state.client_info.port_attribute  = static_cast<HttpProxyPort::TransportType>(netvc->attributes);
 
   // Record api hook set state
@@ -5106,11 +5105,6 @@ HttpSM::do_http_server_open(bool raw)
 void
 HttpSM::do_api_callout_internal()
 {
-  if (t_state.backdoor_request) {
-    handle_api_return();
-    return;
-  }
-
   switch (t_state.api_next_action) {
   case HttpTransact::SM_ACTION_API_SM_START:
     cur_hook_id = TS_HTTP_TXN_START_HOOK;
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 082e9cd..8183ddd 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -714,7 +714,6 @@ public:
     bool cdn_remap_complete                           = false;
     bool first_dns_lookup                             = true;
 
-    bool backdoor_request = false; // internal
     HttpRequestData request_data;
     ParentConfigParams *parent_params = nullptr;
     ParentResult parent_result;
diff --git a/proxy/http/HttpUpdateSM.cc b/proxy/http/HttpUpdateSM.cc
index a6ae057..efe7acb 100644
--- a/proxy/http/HttpUpdateSM.cc
+++ b/proxy/http/HttpUpdateSM.cc
@@ -72,7 +72,6 @@ HttpUpdateSM::start_scheduled_update(Continuation *cont, HTTPHdr *request)
   // Fix ME: What should these be set to since there is not a
   //   real client
   ats_ip4_set(&t_state.client_info.src_addr, htonl(INADDR_LOOPBACK), 0);
-  t_state.backdoor_request           = false;
   t_state.client_info.port_attribute = HttpProxyPort::TRANSPORT_DEFAULT;
 
   t_state.req_flavor = HttpTransact::REQ_FLAVOR_SCHEDULED_UPDATE;