/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#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>
#include <folly/io/IOBuf.h>
+#include <folly/lang/Bits.h>
#include <folly/portability/OpenSSL.h>
using folly::SocketAddress;
return instance;
}
-void* initsslBioMethod(void) {
+void* initsslBioMethod() {
auto sslBioMethod = getSSLBioMethod();
// override the bwrite method for MSG_EOR support
OpenSSLUtils::setCustomBioWriteMethod(sslBioMethod, AsyncSSLSocket::bioWrite);
return nullptr;
}
-} // anonymous namespace
+} // namespace
namespace folly {
// The timeout (if set) keeps running here
return true;
#endif
- } else if ((0
+ } else if ((false
#ifdef SSL_ERROR_WANT_RSA_ASYNC_PENDING
- || error == SSL_ERROR_WANT_RSA_ASYNC_PENDING
+ || error == SSL_ERROR_WANT_RSA_ASYNC_PENDING
#endif
#ifdef SSL_ERROR_WANT_ECDSA_ASYNC_PENDING
- || error == SSL_ERROR_WANT_ECDSA_ASYNC_PENDING
+ || error == SSL_ERROR_WANT_ECDSA_ASYNC_PENDING
#endif
- )) {
+ )) {
// Our custom openssl function has kicked off an async request to do
// rsa/ecdsa private key operation. When that call returns, a callback will
// be invoked that will re-call handleAccept.
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,
void AsyncSSLSocket::enableClientHelloParsing() {
parseClientHello_ = true;
- clientHelloInfo_.reset(new ssl::ClientHelloInfo());
+ clientHelloInfo_ = std::make_unique<ssl::ClientHelloInfo>();
}
void AsyncSSLSocket::resetClientHelloParsing(SSL *ssl) {
}
}
-} // namespace
+} // namespace folly