MCPcopy Create free account
hub / github.com/apache/trafficserver / updateCTX

Method updateCTX

src/iocore/net/SSLConfig.cc:941–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

939}
940
941void
942SSLConfigParams::updateCTX(const std::string &cert_secret_name) const
943{
944 Dbg(dbg_ctl_ssl_config_updateCTX, "Update cert %s, %p", cert_secret_name.c_str(), this);
945
946 // Instances of SSLConfigParams should access by one thread at a time only. secret_for_updateCTX is accessed
947 // atomically as a fail-safe.
948 //
949 char const *expected = nullptr;
950 if (!secret_for_updateCTX.compare_exchange_strong(expected, cert_secret_name.c_str())) {
951 if (dbg_ctl_ssl_config_updateCTX.on()) {
952 // As a fail-safe, handle it if secret_for_updateCTX doesn't or no longer points to a null-terminated string.
953 //
954 char const *s{expected};
955 for (; *s && (static_cast<std::size_t>(s - expected) < cert_secret_name.size()); ++s) {}
956 DbgPrint(dbg_ctl_ssl_config_updateCTX, "Update cert, indirect recusive call caused by call for %.*s", int(s - expected),
957 expected);
958 }
959 return;
960 }
961
962 // Clear the corresponding client CTXs. They will be lazy loaded later
963 Dbg(dbg_ctl_ssl_load, "Update cert %s", cert_secret_name.c_str());
964 this->clearCTX(cert_secret_name);
965
966 // Update the server cert
967 SSLMultiCertConfigLoader loader(this);
968 loader.update_ssl_ctx(cert_secret_name);
969
970 secret_for_updateCTX = nullptr;
971}
972
973void
974SSLConfigParams::clearCTX(const std::string &client_cert) const

Callers 2

TSSslSecretSetFunction · 0.80
TSSslSecretUpdateFunction · 0.80

Calls 5

clearCTXMethod · 0.95
update_ssl_ctxMethod · 0.80
c_strMethod · 0.45
onMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected