From 478fde5fef3bc183dfa50ac77a263633d10a4366 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 29 Feb 2016 01:16:45 +0900 Subject: [PATCH] nghttpx: Fix compile error --- src/shrpx_config.cc | 3 +++ src/shrpx_ssl.cc | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index 5f2e51cb..1046fdf0 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -2603,6 +2603,9 @@ StringRef strproto(shrpx_proto proto) { case PROTO_MEMCACHED: return StringRef::from_lit("memcached"); } + + // gcc needs this. + assert(0); } } // namespace shrpx diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index 208a7342..a36b20be 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -1325,17 +1325,17 @@ SSL_CTX *setup_downstream_client_ssl_context( } void setup_downstream_http2_alpn(SSL *ssl) { - auto alpn = util::get_default_alpn(); #if OPENSSL_VERSION_NUMBER >= 0x10002000L // ALPN advertisement + auto alpn = util::get_default_alpn(); SSL_set_alpn_protos(ssl, alpn.data(), alpn.size()); #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L } void setup_downstream_http1_alpn(SSL *ssl) { - auto alpn = StringRef::from_lit(NGHTTP2_H1_1_ALPN); #if OPENSSL_VERSION_NUMBER >= 0x10002000L // ALPN advertisement + auto alpn = StringRef::from_lit(NGHTTP2_H1_1_ALPN); SSL_set_alpn_protos(ssl, alpn.byte(), alpn.size()); #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L }