summaryrefslogtreecommitdiff
path: root/src/mongo/util/net
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2020-05-10 06:48:54 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-17 15:16:51 +0000
commit7e2111ef33fc40959a254bd3109466176ae60718 (patch)
tree2a31ac8ddccccb24784b161839fa1ca92aeb10bf /src/mongo/util/net
parenta7f769dd597e33e988832c43c99912c1d3139c9b (diff)
downloadmongo-7e2111ef33fc40959a254bd3109466176ae60718.tar.gz
SERVER-46154 Pull the InProgressLookup outside of ReadThroughCache
The InProgressLookup tracking already has quite complicated logic, so it seems prudent to pull it into a separate class, outside of the ReadThroughCache so it can be tested independently.
Diffstat (limited to 'src/mongo/util/net')
-rw-r--r--src/mongo/util/net/ssl_manager_openssl.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/util/net/ssl_manager_openssl.cpp b/src/mongo/util/net/ssl_manager_openssl.cpp
index 3d4274bc6e3..ae9e68a1c23 100644
--- a/src/mongo/util/net/ssl_manager_openssl.cpp
+++ b/src/mongo/util/net/ssl_manager_openssl.cpp
@@ -950,18 +950,17 @@ public:
}
private:
- static boost::optional<OCSPFetchResponse> _lookup(OperationContext* opCtx,
- const OCSPCacheKey& key) {
+ static LookupResult _lookup(OperationContext* opCtx, const OCSPCacheKey& key) {
// If there is a CRL file, we expect the CRL file to cover the certificate status
// information, and therefore we don't need to make a roundtrip.
if (!getSSLGlobalParams().sslCRLFile.empty()) {
- return boost::none;
+ return LookupResult(boost::none);
}
auto swOCSPContext =
extractOcspUris(key.context, key.peerCert.get(), key.intermediateCerts.get());
if (!swOCSPContext.isOK()) {
- return boost::none;
+ return LookupResult(boost::none);
}
auto ocspContext = std::move(swOCSPContext.getValue());
@@ -971,10 +970,10 @@ private:
key.context, key.intermediateCerts, ocspContext, OCSPPurpose::kClientVerify)
.getNoThrow();
if (!swResponse.isOK()) {
- return boost::none;
+ return LookupResult(boost::none);
}
- return std::move(swResponse.getValue());
+ return LookupResult(std::move(swResponse.getValue()));
}
static const ServiceContext::Decoration<boost::optional<OCSPCache>> getOCSPCache;