Ignore setSSLLockTypes() calls after SSLContext is initialized.
[folly.git] / folly / io / async / SSLContext.cpp
index 5550cdbb96ffa3200f81dbdd40ea2a0dd1189be3..3abb5d0b8a307439a2ec09d3a7c19ac32f014c06 100644 (file)
@@ -794,6 +794,13 @@ static void dyn_destroy(struct CRYPTO_dynlock_value* lock, const char*, int) {
 }
 
 void SSLContext::setSSLLockTypes(std::map<int, SSLLockType> inLockTypes) {
+  if (initialized_) {
+    // We set the locks on initialization, so if we are already initialized
+    // this would have no affect.
+    LOG(INFO) << "Ignoring setSSLLockTypes after initialization";
+    return;
+  }
+
   lockTypes() = inLockTypes;
 }