Modernize use of std::make_unique
[folly.git] / folly / io / async / AsyncSSLSocket.cpp
index e6513f8259db83e1e18890554294e75e459c5d3b..4bb8a9b43525a37d0f80d95d20b4f357f365003b 100644 (file)
 #include <fcntl.h>
 #include <sys/types.h>
 #include <chrono>
+#include <memory>
 
 #include <folly/Bits.h>
+#include <folly/Format.h>
 #include <folly/SocketAddress.h>
 #include <folly/SpinLock.h>
 #include <folly/io/Cursor.h>
@@ -183,7 +185,7 @@ static BIO_METHOD* getSSLBioMethod() {
   return instance;
 }
 
-void* initsslBioMethod(void) {
+void* initsslBioMethod() {
   auto sslBioMethod = getSSLBioMethod();
   // override the bwrite method for MSG_EOR support
   OpenSSLUtils::setCustomBioWriteMethod(sslBioMethod, AsyncSSLSocket::bioWrite);
@@ -199,7 +201,7 @@ void* initsslBioMethod(void) {
   return nullptr;
 }
 
-} // anonymous namespace
+} // namespace
 
 namespace folly {
 
@@ -1646,7 +1648,8 @@ int AsyncSSLSocket::bioWrite(BIO* b, const char* in, int inl) {
     flags |= WriteFlags::CORK;
   }
 
-  int msg_flags = tsslSock->getSendMsgParamsCB()->getFlags(flags);
+  int msg_flags = tsslSock->getSendMsgParamsCB()->getFlags(
+      flags, false /*zeroCopyEnabled*/);
   msg.msg_controllen =
       tsslSock->getSendMsgParamsCB()->getAncillaryDataSize(flags);
   CHECK_GE(AsyncSocket::SendMsgParamsCallback::maxAncillaryDataSize,
@@ -1714,7 +1717,7 @@ int AsyncSSLSocket::sslVerifyCallback(
 
 void AsyncSSLSocket::enableClientHelloParsing()  {
     parseClientHello_ = true;
-    clientHelloInfo_.reset(new ssl::ClientHelloInfo());
+    clientHelloInfo_ = std::make_unique<ssl::ClientHelloInfo>();
 }
 
 void AsyncSSLSocket::resetClientHelloParsing(SSL *ssl)  {