From 48908fb0bba69404dfd86d1af3b9ace1e0d598c9 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 15 May 2020 18:59:19 +0200 Subject: Speedup GetPath() --- https.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'https.cpp') diff --git a/https.cpp b/https.cpp index 508ece9..a5aa118 100644 --- a/https.cpp +++ b/https.cpp @@ -660,15 +660,15 @@ void Server::load_certificates() // import the real certificates for (const auto& serve_site: m_socket.serve_sites) { for (const auto& site: m_config.Sites()) { - if (site.name == serve_site) { + if (site.first == serve_site) { std::shared_ptr ctx {std::make_shared(tls_method)}; std::cout << "Creating SSL context/cert for site " << serve_site << " on port " << m_socket.port << std::endl; - load_server_certificate(*ctx, site.cert_path, site.key_path); + load_server_certificate(*ctx, site.second.cert_path, site.second.key_path); SSL_CTX_set_client_hello_cb(ctx->native_handle(), servername_callback, &m_ctx); - for (const auto& host: site.hosts) { + for (const auto& host: site.second.hosts) { std::cout << " Adding Host " << host << std::endl; m_ctx.emplace(host, ctx); } @@ -681,19 +681,19 @@ void Server::reload_certificates() { for (const auto& serve_site: m_socket.serve_sites) { for (const auto& site: m_config.Sites()) { - if (site.name == serve_site) { + if (site.first == serve_site) { std::cout << "Updating SSL context/cert for site " << serve_site << " on port " << m_socket.port << std::endl; - auto it_host {site.hosts.begin()}; - if (it_host == site.hosts.end()) { + auto it_host {site.second.hosts.begin()}; + if (it_host == site.second.hosts.end()) { std::cout << " Warning: No configured host found." << std::endl; } else { auto it_ctx {m_ctx.find(*it_host)}; if (it_ctx == m_ctx.end()) { std::cout << " Warning: No context found for configured host." << std::endl; } else { - load_server_certificate(*it_ctx->second, site.cert_path, site.key_path); + load_server_certificate(*it_ctx->second, site.second.cert_path, site.second.key_path); } } } -- cgit v1.2.3