trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [trafficserver] branch master updated: Load the Socks configuration after the host state persistence data is loaded.
Date Mon, 06 May 2019 07:35:59 GMT
This is an automated email from the ASF dual-hosted git repository.

oknet 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 96c0c71  Load the Socks configuration after the host state persistence data is loaded.
96c0c71 is described below

commit 96c0c71fde39c4c64b0c4dacbd44920093c6a3f2
Author: Oknet Xu <xuchao@skyguard.com.cn>
AuthorDate: Tue Apr 30 20:37:07 2019 +0800

    Load the Socks configuration after the host state persistence data is loaded.
---
 iocore/net/I_NetProcessor.h          |  2 ++
 iocore/net/P_UnixNetProcessor.h      |  1 +
 iocore/net/UnixNetProcessor.cc       | 21 ++++++++++++---------
 proxy/shared/UglyLogStubs.cc         |  6 ++++++
 src/traffic_server/traffic_server.cc |  1 +
 5 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/iocore/net/I_NetProcessor.h b/iocore/net/I_NetProcessor.h
index 04dedf3..6eb5a40 100644
--- a/iocore/net/I_NetProcessor.h
+++ b/iocore/net/I_NetProcessor.h
@@ -198,6 +198,8 @@ public:
   */
   virtual void init() = 0;
 
+  virtual void init_socks() = 0;
+
   inkcoreapi virtual NetVConnection *allocate_vc(EThread *) = 0;
 
   /** Private constructor. */
diff --git a/iocore/net/P_UnixNetProcessor.h b/iocore/net/P_UnixNetProcessor.h
index 7cd2208..87e16ba 100644
--- a/iocore/net/P_UnixNetProcessor.h
+++ b/iocore/net/P_UnixNetProcessor.h
@@ -43,6 +43,7 @@ public:
   NetVConnection *allocate_vc(EThread *t) override;
 
   void init() override;
+  void init_socks() override;
 
   Event *accept_thread_event;
 
diff --git a/iocore/net/UnixNetProcessor.cc b/iocore/net/UnixNetProcessor.cc
index c55b618..c18e6bd 100644
--- a/iocore/net/UnixNetProcessor.cc
+++ b/iocore/net/UnixNetProcessor.cc
@@ -296,7 +296,18 @@ UnixNetProcessor::init()
   d.rec_int = 0;
   change_net_connections_throttle(nullptr, RECD_INT, d, nullptr);
 
-  // Socks
+  /*
+   * Stat pages
+   */
+  extern Action *register_ShowNet(Continuation * c, HTTPHdr * h);
+  if (etype == ET_NET) {
+    statPagesManager.register_http("net", register_ShowNet);
+  }
+}
+
+void
+UnixNetProcessor::init_socks()
+{
   if (!netProcessor.socks_conf_stuff) {
     socks_conf_stuff = new socks_conf_struct;
     loadSocksConfiguration(socks_conf_stuff);
@@ -309,14 +320,6 @@ UnixNetProcessor::init()
       socks_conf_stuff = netProcessor.socks_conf_stuff;
     }
   }
-
-  /*
-   * Stat pages
-   */
-  extern Action *register_ShowNet(Continuation * c, HTTPHdr * h);
-  if (etype == ET_NET) {
-    statPagesManager.register_http("net", register_ShowNet);
-  }
 }
 
 // Virtual function allows creation of an
diff --git a/proxy/shared/UglyLogStubs.cc b/proxy/shared/UglyLogStubs.cc
index 15ec22e..6952389 100644
--- a/proxy/shared/UglyLogStubs.cc
+++ b/proxy/shared/UglyLogStubs.cc
@@ -88,6 +88,12 @@ UnixNetProcessor::init()
   ink_release_assert(false);
 }
 
+void
+UnixNetProcessor::init_socks()
+{
+  ink_release_assert(false);
+}
+
 // TODO: The following was necessary only for Solaris, should examine more.
 NetVCOptions const Connection::DEFAULT_OPTIONS;
 NetProcessor::AcceptOptions const NetProcessor::DEFAULT_ACCEPT_OPTIONS;
diff --git a/src/traffic_server/traffic_server.cc b/src/traffic_server/traffic_server.cc
index 40e2302..5674f70 100644
--- a/src/traffic_server/traffic_server.cc
+++ b/src/traffic_server/traffic_server.cc
@@ -1865,6 +1865,7 @@ main(int /* argc ATS_UNUSED */, const char **argv)
     initCacheControl();
     IpAllow::startup();
     HostStatus::instance().loadHostStatusFromStats();
+    netProcessor.init_socks();
     ParentConfig::startup();
 #ifdef SPLIT_DNS
     SplitDNSConfig::startup();


Mime
View raw message