Skip to content

Commit

Permalink
migrate from TAsyncSSLSocket
Browse files Browse the repository at this point in the history
Summary: `apache::thrift::async::TAsyncSSLSocket` is now just a derived-class wrapper around `folly::AsyncSSLSocket`.

Reviewed By: jmswen

Differential Revision: D60981967

fbshipit-source-id: 8de104555d4049c3b590f99871e857faf19407aa
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Aug 9, 2024
1 parent 39264f9 commit 980b7ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 7 additions & 9 deletions mcrouter/lib/network/AsyncTlsToPlaintextSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <folly/io/async/ssl/BasicTransportCertificate.h>
#include <folly/portability/OpenSSL.h>

#include <folly/io/async/AsyncSSLSocket.h>
#include <folly/io/async/AsyncSocket.h>
#include <thrift/lib/cpp/async/TAsyncSSLSocket.h>

namespace facebook {
namespace memcache {
Expand Down Expand Up @@ -50,8 +50,7 @@ class AsyncTlsToPlaintextSocket::ConnectCallback
me_.flushWrites();
};

auto* tlsSocket =
impl->getUnderlyingTransport<apache::thrift::async::TAsyncSSLSocket>();
auto* tlsSocket = impl->getUnderlyingTransport<folly::AsyncSSLSocket>();
CHECK(tlsSocket);

// Save state regarding session resumption
Expand Down Expand Up @@ -116,12 +115,11 @@ void AsyncTlsToPlaintextSocket::connect(
folly::SocketOptionMap socketOptions) {
auto* const wrappedConnectCallback =
new ConnectCallback(*this, connectCallback);
impl_->getUnderlyingTransport<apache::thrift::async::TAsyncSSLSocket>()
->connect(
wrappedConnectCallback,
address,
connectTimeout.count(),
std::move(socketOptions));
impl_->getUnderlyingTransport<folly::AsyncSSLSocket>()->connect(
wrappedConnectCallback,
address,
connectTimeout.count(),
std::move(socketOptions));
}

void AsyncTlsToPlaintextSocket::flushWrites() {
Expand Down
4 changes: 2 additions & 2 deletions mcrouter/lib/network/SocketUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <folly/io/async/AsyncTransport.h>
#include <folly/io/async/EventBase.h>

#include <folly/io/async/AsyncSSLSocket.h>
#include <folly/io/async/AsyncSocket.h>
#include <thrift/lib/cpp/async/TAsyncSSLSocket.h>

#include "mcrouter/lib/fbi/cpp/LogFailure.h"
#include "mcrouter/lib/network/AsyncTlsToPlaintextSocket.h"
Expand Down Expand Up @@ -123,7 +123,7 @@ createSocketCommon(
folly::AsyncSocket>;
using AsyncSSLSocketT = std::conditional_t<
CreateThriftFriendlySocket,
apache::thrift::async::TAsyncSSLSocket,
folly::AsyncSSLSocket,
folly::AsyncSSLSocket>;
using Ptr = folly::AsyncTransportWrapper::UniquePtr;

Expand Down

0 comments on commit 980b7ec

Please sign in to comment.