diff --git a/examples/client.c b/examples/client.c index 3ddeafe4..5d210a28 100644 --- a/examples/client.c +++ b/examples/client.c @@ -379,7 +379,7 @@ static void init_ssl_ctx(SSL_CTX *ssl_ctx) { /* Set NPN callback */ #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_proto_select_cb(ssl_ctx, select_next_proto_cb, NULL); -#endif +#endif /* !OPENSSL_NO_NEXTPROTONEG */ } static void ssl_handshake(SSL *ssl, int fd) { diff --git a/examples/libevent-client.c b/examples/libevent-client.c index f297df4f..f998fba3 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -339,7 +339,7 @@ static SSL_CTX *create_ssl_ctx(void) { SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION); #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_proto_select_cb(ssl_ctx, select_next_proto_cb, NULL); -#endif +#endif /* !OPENSSL_NO_NEXTPROTONEG */ #if OPENSSL_VERSION_NUMBER >= 0x10002000L SSL_CTX_set_alpn_protos(ssl_ctx, (const unsigned char *)"\x02h2", 3); @@ -510,7 +510,7 @@ static void eventcb(struct bufferevent *bev, short events, void *ptr) { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(ssl, &alpn, &alpnlen); -#endif +#endif /* !OPENSSL_NO_NEXTPROTONEG */ #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (alpn == NULL) { SSL_get0_alpn_selected(ssl, &alpn, &alpnlen); diff --git a/examples/libevent-server.c b/examples/libevent-server.c index 59091c54..06b36b9a 100644 --- a/examples/libevent-server.c +++ b/examples/libevent-server.c @@ -176,7 +176,7 @@ static SSL_CTX *create_ssl_ctx(const char *key_file, const char *cert_file) { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_protos_advertised_cb(ssl_ctx, next_proto_cb, NULL); -#endif +#endif /* !OPENSSL_NO_NEXTPROTONEG */ #if OPENSSL_VERSION_NUMBER >= 0x10002000L SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, NULL); @@ -696,7 +696,7 @@ static void eventcb(struct bufferevent *bev, short events, void *ptr) { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(ssl, &alpn, &alpnlen); -#endif +#endif /* !OPENSSL_NO_NEXTPROTONEG */ #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (alpn == NULL) { SSL_get0_alpn_selected(ssl, &alpn, &alpnlen); diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 72d61b19..a6afa0c4 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -890,7 +890,7 @@ int Http2Handler::verify_npn_result() { // Check the negotiated protocol in NPN or ALPN #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(ssl_, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG for (int i = 0; i < 2; ++i) { if (next_proto) { auto proto = StringRef{next_proto, next_proto_len}; @@ -2211,7 +2211,7 @@ int HttpServer::run() { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_protos_advertised_cb(ssl_ctx, next_proto_cb, &next_proto); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L // ALPN selection callback SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, this); diff --git a/src/asio_common.cc b/src/asio_common.cc index 6aa46abc..90762d3d 100644 --- a/src/asio_common.cc +++ b/src/asio_common.cc @@ -179,7 +179,7 @@ bool tls_h2_negotiated(ssl_socket &socket) { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(ssl, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (next_proto == nullptr) { SSL_get0_alpn_selected(ssl, &next_proto, &next_proto_len); diff --git a/src/h2load.cc b/src/h2load.cc index 253a07c8..8dee4ffb 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -859,7 +859,7 @@ int Client::connection_made() { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(ssl, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (next_proto == nullptr) { SSL_get0_alpn_selected(ssl, &next_proto, &next_proto_len); @@ -2406,7 +2406,7 @@ int main(int argc, char **argv) { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_proto_select_cb(ssl_ctx, client_select_next_proto_cb, nullptr); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L std::vector proto_list; diff --git a/src/nghttp.cc b/src/nghttp.cc index bddccec3..ca4a02a4 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -1097,7 +1097,7 @@ int HttpClient::connection_made() { unsigned int next_proto_len; #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(ssl, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG for (int i = 0; i < 2; ++i) { if (next_proto) { auto proto = StringRef{next_proto, next_proto_len}; @@ -2315,7 +2315,7 @@ int communicate( #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_proto_select_cb(ssl_ctx, client_select_next_proto_cb, nullptr); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L auto proto_list = util::get_default_alpn(); diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 491b2e35..941e0e12 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -551,7 +551,7 @@ int ClientHandler::validate_next_proto() { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(conn_.tls.ssl, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (next_proto == nullptr) { SSL_get0_alpn_selected(conn_.tls.ssl, &next_proto, &next_proto_len); diff --git a/src/shrpx_connection.cc b/src/shrpx_connection.cc index 3ea37b5a..31dac3c6 100644 --- a/src/shrpx_connection.cc +++ b/src/shrpx_connection.cc @@ -525,7 +525,7 @@ int Connection::check_http2_requirement() { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(tls.ssl, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (next_proto == nullptr) { SSL_get0_alpn_selected(tls.ssl, &next_proto, &next_proto_len); diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index c2deae04..67039867 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -1651,7 +1651,7 @@ int Http2Session::connection_made() { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(conn_.tls.ssl, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (!next_proto) { SSL_get0_alpn_selected(conn_.tls.ssl, &next_proto, &next_proto_len); diff --git a/src/shrpx_live_check.cc b/src/shrpx_live_check.cc index 07ad811e..9d30ca78 100644 --- a/src/shrpx_live_check.cc +++ b/src/shrpx_live_check.cc @@ -408,7 +408,7 @@ int LiveCheck::tls_handshake() { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(conn_.tls.ssl, &next_proto, &next_proto_len); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (next_proto == nullptr) { SSL_get0_alpn_selected(conn_.tls.ssl, &next_proto, &next_proto_len); diff --git a/src/shrpx_tls.cc b/src/shrpx_tls.cc index 6dbd456c..784de58d 100644 --- a/src/shrpx_tls.cc +++ b/src/shrpx_tls.cc @@ -927,7 +927,7 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file, // NPN advertisement #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_protos_advertised_cb(ssl_ctx, next_proto_cb, nullptr); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG #if OPENSSL_VERSION_NUMBER >= 0x10002000L // ALPN selection callback SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, nullptr); @@ -1124,7 +1124,7 @@ SSL_CTX *create_ssl_client_context( // OpenSSL does not offer SSL_set_next_proto_select_cb. #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_proto_select_cb(ssl_ctx, next_proto_select_cb, nullptr); -#endif +#endif // !OPENSSL_NO_NEXTPROTONEG return ssl_ctx; }