You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/08/15 06:45:03 UTC
[trafficserver] 02/02: Build QUIC modules only if TLS 1.3 is
available
This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 49e6fc74cfe533e33ac39b4f7af44f30907cf464
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Aug 15 15:43:57 2017 +0900
Build QUIC modules only if TLS 1.3 is available
---
configure.ac | 9 +++++++++
iocore/net/Makefile.am | 18 ++++++++++++------
lib/ts/ink_config.h.in | 1 +
proxy/Main.cc | 8 ++++++--
proxy/Makefile.am | 14 +++++++++++---
proxy/http/HttpProxyServerMain.cc | 14 ++++++++++----
6 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index a0e80d6..02a5de5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1143,6 +1143,15 @@ TS_CHECK_CRYPTO_DH_GET_2048_256
# Check for TLS 1.3 support
TS_CHECK_CRYPTO_TLS13
+# Check for QUIC support
+enable_quic=no
+AS_IF([test "x$enable_tls13" = "xyes"], [
+ enable_quic=yes
+])
+TS_ARG_ENABLE_VAR([use], [quic])
+AC_SUBST(use_quic)
+AM_CONDITIONAL([ENABLE_QUIC], [test "x$enable_quic" = "xyes"])
+
saved_LIBS="$LIBS"
TS_ADDTO([LIBS], ["$OPENSSL_LIBS"])
diff --git a/iocore/net/Makefile.am b/iocore/net/Makefile.am
index 252a4c3..10ce90d 100644
--- a/iocore/net/Makefile.am
+++ b/iocore/net/Makefile.am
@@ -16,7 +16,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+if ENABLE_QUIC
SUBDIRS = quic
+endif
AM_CPPFLAGS += \
$(iocore_include_dirs) \
@@ -114,9 +116,6 @@ libinknet_a_SOURCES = \
P_UDPIOEvent.h \
P_UDPNet.h \
P_UDPPacket.h \
- P_QUICPacketHandler.h \
- P_QUICNetProcessor.h \
- P_QUICNetVConnection.h \
P_UnixCompletionUtil.h \
P_UnixNet.h \
P_UnixNetProcessor.h \
@@ -139,9 +138,6 @@ libinknet_a_SOURCES = \
OCSPStapling.cc \
Socks.cc \
UDPIOEvent.cc \
- QUICPacketHandler.cc \
- QUICNetProcessor.cc \
- QUICNetVConnection.cc \
UnixConnection.cc \
UnixNet.cc \
UnixNetAccept.cc \
@@ -152,6 +148,16 @@ libinknet_a_SOURCES = \
UnixUDPNet.cc \
SSLDynlock.cc
+if ENABLE_QUIC
+libinknet_a_SOURCES += \
+ P_QUICPacketHandler.h \
+ P_QUICNetProcessor.h \
+ P_QUICNetVConnection.h \
+ QUICPacketHandler.cc \
+ QUICNetProcessor.cc \
+ QUICNetVConnection.cc
+endif
+
#test_UNUSED_SOURCES = \
# NetTest-http-server.c \
# test_I_Net.cc \
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index 1bb3875..71506cc 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -76,6 +76,7 @@
#define TS_USE_GET_DH_2048_256 @use_dh_get_2048_256@
#define TS_USE_TLS_ECKEY @use_tls_eckey@
#define TS_USE_TLS13 @use_tls13@
+#define TS_USE_QUIC @use_quic@
#define TS_USE_LINUX_NATIVE_AIO @use_linux_native_aio@
#define TS_USE_REMOTE_UNWINDING @use_remote_unwinding@
#define TS_USE_SSLV3_CLIENT @use_sslv3_client@
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 2bf8796..3557805 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -91,7 +91,9 @@ extern "C" int plock(int);
#include "I_Tasks.h"
#include "InkAPIInternal.h"
#include "HTTP2.h"
+#if TS_USE_QUIC == 1
#include "HQ.h"
+#endif
#include <ts/ink_cap.h>
@@ -1810,8 +1812,10 @@ main(int /* argc ATS_UNUSED */, const char **argv)
// Initialize HTTP/2
Http2::init();
+#if TS_USE_QUIC == 1
// Initialize HTTP/QUIC
HQ::init();
+#endif
if (!HttpProxyPort::loadValue(http_accept_port_descriptor)) {
HttpProxyPort::loadConfig();
@@ -1831,9 +1835,9 @@ main(int /* argc ATS_UNUSED */, const char **argv)
SSLConfigParams::init_ssl_ctx_cb = init_ssl_ctx_callback;
SSLConfigParams::load_ssl_file_cb = load_ssl_file_callback;
sslNetProcessor.start(-1, stacksize);
-
+#if TS_USE_QUIC == 1
quic_NetProcessor.start(-1, stacksize);
-
+#endif
pmgmt->registerPluginCallbacks(global_config_cbs);
cacheProcessor.afterInitCallbackSet(&CB_After_Cache_Init);
diff --git a/proxy/Makefile.am b/proxy/Makefile.am
index 220f8d8..7505dc0 100644
--- a/proxy/Makefile.am
+++ b/proxy/Makefile.am
@@ -19,7 +19,11 @@
include $(top_srcdir)/build/tidy.mk
# Note that hdrs is targeted from ../Makefile.am
-SUBDIRS = congest http http2 hq logging config
+SUBDIRS = congest http http2 logging config
+if ENABLE_QUIC
+SUBDIRS += hq
+endif
+
noinst_LIBRARIES =
bin_PROGRAMS = \
traffic_server \
@@ -180,7 +184,6 @@ endif
traffic_server_LDADD = \
http/libhttp.a \
http2/libhttp2.a \
- hq/libhq.a \
http/remap/libhttp_remap.a \
congest/libCongestionControl.a \
logging/liblogging.a \
@@ -197,6 +200,12 @@ traffic_server_LDADD = \
$(top_builddir)/lib/ts/libtsutil.la \
$(top_builddir)/lib/bindings/libbindings.la
+if ENABLE_QUIC
+traffic_server_LDADD += \
+ hq/libhq.a \
+ $(top_builddir)/iocore/net/quic/libquic.a
+endif
+
if BUILD_LUAJIT
traffic_server_LDADD += \
$(top_builddir)/lib/luajit/src/libluajit.a
@@ -204,7 +213,6 @@ endif
traffic_server_LDADD += \
$(top_builddir)/iocore/net/libinknet.a \
- $(top_builddir)/iocore/net/quic/libquic.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/lib/records/librecords_p.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
diff --git a/proxy/http/HttpProxyServerMain.cc b/proxy/http/HttpProxyServerMain.cc
index 9beb3ac..6e27716 100644
--- a/proxy/http/HttpProxyServerMain.cc
+++ b/proxy/http/HttpProxyServerMain.cc
@@ -39,7 +39,9 @@
#include "ProtocolProbeSessionAccept.h"
#include "http2/Http2SessionAccept.h"
#include "HttpConnectionCount.h"
+#if TS_USE_QUIC == 1
#include "hq/HQSessionAccept.h"
+#endif
HttpSessionAccept *plugin_http_accept = nullptr;
HttpSessionAccept *plugin_http_transparent_accept = nullptr;
@@ -219,10 +221,12 @@ MakeHttpProxyAcceptor(HttpProxyAcceptor &acceptor, HttpProxyPort &port, unsigned
ssl_plugin_acceptors.push(ssl);
ssl->proxyPort = &port;
acceptor._accept = ssl;
+#if TS_USE_QUIC == 1
} else if (port.isQUIC()) {
// HTTP/QUIC
HQSessionAccept *hq = new HQSessionAccept(accept_opt);
acceptor._accept = hq;
+#endif
} else {
acceptor._accept = probe;
}
@@ -291,14 +295,16 @@ start_HttpProxyServer()
for (int i = 0, n = proxy_ports.length(); i < n; ++i) {
HttpProxyAcceptor &acceptor = HttpProxyAcceptors[i];
HttpProxyPort &port = proxy_ports[i];
- if (port.isQUIC()) {
- if (nullptr == quic_NetProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
+ if (port.isSSL()) {
+ if (nullptr == sslNetProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
return;
}
- } else if (port.isSSL()) {
- if (nullptr == sslNetProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
+#if TS_USE_QUIC == 1
+ } else if (port.isQUIC()) {
+ if (nullptr == quic_NetProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
return;
}
+#endif
} else if (!port.isPlugin()) {
if (nullptr == netProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
return;
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.