Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change variable name to reflect instance of boost::asio::io_context class #82

Merged
merged 1 commit into from
May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions libamqpprox/amqpprox_maybesecuresocketadaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MaybeSecureSocketAdaptor {
using endpoint = boost::asio::ip::tcp::endpoint;
using handshake_type = boost::asio::ssl::stream_base::handshake_type;

boost::asio::io_context &d_ioService;
boost::asio::io_context &d_ioContext;
std::optional<std::reference_wrapper<SocketIntercept>> d_intercept;
std::unique_ptr<stream_type> d_socket;
bool d_secured;
Expand All @@ -53,10 +53,10 @@ class MaybeSecureSocketAdaptor {
typedef typename stream_type::executor_type executor_type;

#ifdef SOCKET_TESTING
MaybeSecureSocketAdaptor(boost::asio::io_context &ioService,
MaybeSecureSocketAdaptor(boost::asio::io_context &ioContext,
SocketIntercept &intercept,
bool secured)
: d_ioService(ioService)
: d_ioContext(ioContext)
, d_intercept(intercept)
, d_socket()
, d_secured(secured)
Expand All @@ -67,12 +67,12 @@ class MaybeSecureSocketAdaptor {
}
#endif

MaybeSecureSocketAdaptor(boost::asio::io_context &ioService,
MaybeSecureSocketAdaptor(boost::asio::io_context &ioContext,
boost::asio::ssl::context &context,
bool secured)
: d_ioService(ioService)
: d_ioContext(ioContext)
, d_intercept()
, d_socket(std::make_unique<stream_type>(ioService, context))
, d_socket(std::make_unique<stream_type>(ioContext, context))
, d_secured(secured)
, d_handshook(false)
, d_smallBuffer(0)
Expand All @@ -81,7 +81,7 @@ class MaybeSecureSocketAdaptor {
}

MaybeSecureSocketAdaptor(MaybeSecureSocketAdaptor &&src)
: d_ioService(src.d_ioService)
: d_ioContext(src.d_ioContext)
, d_intercept(src.d_intercept)
, d_socket(std::move(src.d_socket))
, d_secured(src.d_secured)
Expand All @@ -96,7 +96,10 @@ class MaybeSecureSocketAdaptor {
src.d_smallBufferSet = false;
}

boost::asio::ip::tcp::socket &socket() { return d_socket->next_layer(); }
boost::asio::ip::tcp::socket &socket()
{
return d_socket->next_layer();
}

void setSecure(bool secure)
{
Expand Down