nghttpx: Refactor the code for the anti-replay

This commit is contained in:
Tatsuhiro Tsujikawa 2017-05-14 17:45:16 +09:00
parent e6ffdb23a4
commit 14edd12304
1 changed files with 9 additions and 7 deletions

View File

@ -219,17 +219,19 @@ int ConnectionHandler::create_single_worker() {
auto config = get_config(); auto config = get_config();
auto &tlsconf = config->tls; auto &tlsconf = config->tls;
auto &memcachedconf = config->tls.session_cache.memcached;
SSL_CTX *session_cache_ssl_ctx = nullptr; SSL_CTX *session_cache_ssl_ctx = nullptr;
if (memcachedconf.tls) { {
session_cache_ssl_ctx = tls::create_ssl_client_context( auto &memcachedconf = config->tls.session_cache.memcached;
if (memcachedconf.tls) {
session_cache_ssl_ctx = tls::create_ssl_client_context(
#ifdef HAVE_NEVERBLEED #ifdef HAVE_NEVERBLEED
nb_.get(), nb_.get(),
#endif // HAVE_NEVERBLEED #endif // HAVE_NEVERBLEED
tlsconf.cacert, memcachedconf.cert_file, memcachedconf.private_key_file, tlsconf.cacert, memcachedconf.cert_file,
nullptr); memcachedconf.private_key_file, nullptr);
all_ssl_ctx_.push_back(session_cache_ssl_ctx); all_ssl_ctx_.push_back(session_cache_ssl_ctx);
}
} }
single_worker_ = make_unique<Worker>( single_worker_ = make_unique<Worker>(