Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/iocore/net/P_SSLCertLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#include "iocore/eventsystem/ConfigProcessor.h"
#include "iocore/net/SSLTypes.h"
#include "records/RecCore.h"
#include "tsutil/Bravo.h"

#include <set>
#include <openssl/ssl.h>
#include <mutex>
#include <unordered_map>
#include <utility>

Expand Down Expand Up @@ -94,8 +94,8 @@ using shared_ssl_ticket_key_block = std::shared_ptr<ssl_ticket_key_block>;
*/
struct SSLCertContext {
private:
mutable std::mutex ctx_mutex;
shared_SSL_CTX ctx;
mutable ts::bravo::shared_mutex ctx_mutex;
shared_SSL_CTX ctx;

public:
SSLCertContext() : ctx_mutex(), ctx(nullptr), opt(SSLCertContextOption::OPT_NONE), userconfig(nullptr), keyblock(nullptr) {}
Expand Down
8 changes: 4 additions & 4 deletions src/iocore/net/SSLCertLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ SSLCertContext::SSLCertContext(SSLCertContext const &other)
userconfig = other.userconfig;
keyblock = other.keyblock;
ctx_type = other.ctx_type;
std::lock_guard<std::mutex> lock(other.ctx_mutex);
ts::bravo::shared_lock lock(other.ctx_mutex);
ctx = other.ctx;
}

Expand All @@ -249,7 +249,7 @@ SSLCertContext::operator=(SSLCertContext const &other)
this->userconfig = other.userconfig;
this->keyblock = other.keyblock;
this->ctx_type = other.ctx_type;
std::lock_guard<std::mutex> lock(other.ctx_mutex);
ts::bravo::shared_lock lock(other.ctx_mutex);
this->ctx = other.ctx;
}
return *this;
Expand All @@ -258,14 +258,14 @@ SSLCertContext::operator=(SSLCertContext const &other)
shared_SSL_CTX
SSLCertContext::getCtx()
{
std::lock_guard<std::mutex> lock(ctx_mutex);
ts::bravo::shared_lock lock(ctx_mutex);
return ctx;
}

void
SSLCertContext::setCtx(shared_SSL_CTX sc)
{
std::lock_guard<std::mutex> lock(ctx_mutex);
std::lock_guard lock(ctx_mutex);
ctx = std::move(sc);
}

Expand Down