Commit 1f1d9662 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

NetworkSocket support for AsyncSSLSocket

Summary: More things.

Reviewed By: yfeldblum

Differential Revision: D12818556

fbshipit-source-id: 8e839489eb92a3ec3f0ac391c157ad3de42d596b
parent e47087b7
......@@ -239,7 +239,7 @@ AsyncSSLSocket::AsyncSSLSocket(
AsyncSSLSocket::AsyncSSLSocket(
const shared_ptr<SSLContext>& ctx,
EventBase* evb,
int fd,
NetworkSocket fd,
bool server,
bool deferSecurityNegotiation)
: AsyncSocket(evb, fd),
......@@ -300,7 +300,7 @@ AsyncSSLSocket::AsyncSSLSocket(
AsyncSSLSocket::AsyncSSLSocket(
const shared_ptr<SSLContext>& ctx,
EventBase* evb,
int fd,
NetworkSocket fd,
const std::string& serverName,
bool deferSecurityNegotiation)
: AsyncSSLSocket(ctx, evb, fd, false, deferSecurityNegotiation) {
......
......@@ -221,6 +221,18 @@ class AsyncSSLSocket : public virtual AsyncSocket {
EventBase* evb,
int fd,
bool server = true,
bool deferSecurityNegotiation = false)
: AsyncSSLSocket(
ctx,
evb,
NetworkSocket::fromFd(fd),
server,
deferSecurityNegotiation) {}
AsyncSSLSocket(
const std::shared_ptr<folly::SSLContext>& ctx,
EventBase* evb,
NetworkSocket fd,
bool server = true,
bool deferSecurityNegotiation = false);
/**
......@@ -239,7 +251,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
static std::shared_ptr<AsyncSSLSocket> newSocket(
const std::shared_ptr<folly::SSLContext>& ctx,
EventBase* evb,
int fd,
NetworkSocket fd,
bool server = true,
bool deferSecurityNegotiation = false) {
return std::shared_ptr<AsyncSSLSocket>(
......@@ -247,6 +259,16 @@ class AsyncSSLSocket : public virtual AsyncSocket {
Destructor());
}
static std::shared_ptr<AsyncSSLSocket> newSocket(
const std::shared_ptr<folly::SSLContext>& ctx,
EventBase* evb,
int fd,
bool server = true,
bool deferSecurityNegotiation = false) {
return newSocket(
ctx, evb, NetworkSocket::fromFd(fd), server, deferSecurityNegotiation);
}
/**
* Helper function to create a client shared_ptr<AsyncSSLSocket>.
*/
......@@ -287,9 +309,21 @@ class AsyncSSLSocket : public virtual AsyncSocket {
AsyncSSLSocket(
const std::shared_ptr<folly::SSLContext>& ctx,
EventBase* evb,
int fd,
NetworkSocket fd,
const std::string& serverName,
bool deferSecurityNegotiation = false);
AsyncSSLSocket(
const std::shared_ptr<folly::SSLContext>& ctx,
EventBase* evb,
int fd,
const std::string& serverName,
bool deferSecurityNegotiation = false)
: AsyncSSLSocket(
ctx,
evb,
NetworkSocket::fromFd(fd),
serverName,
deferSecurityNegotiation) {}
static std::shared_ptr<AsyncSSLSocket> newSocket(
const std::shared_ptr<folly::SSLContext>& ctx,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment