Skip to content

Commit

Permalink
Remove ssl handshaker.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzimbres committed Nov 24, 2024
1 parent 74312db commit d5de174
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 126 deletions.
9 changes: 0 additions & 9 deletions include/boost/redis/detail/connection_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <boost/redis/config.hpp>
#include <boost/redis/detail/resolver.hpp>
#include <boost/redis/detail/connector.hpp>
#include <boost/redis/detail/handshaker.hpp>
#include <boost/redis/detail/health_checker.hpp>
#include <boost/redis/detail/runner.hpp>
#include <boost/redis/usage.hpp>
Expand Down Expand Up @@ -350,7 +349,6 @@ class connection_base {
, writer_timer_{ex}
, receive_channel_{ex, 256}
, resv_{ex}
, ssl_handshaker_{ex}
, health_checker_{ex}
, runner_{ex, {}}
, dbuf_{read_buffer_, max_read_size}
Expand Down Expand Up @@ -385,9 +383,6 @@ class connection_base {
case operation::resolve:
resv_.cancel();
break;
case operation::ssl_handshake:
ssl_handshaker_.cancel();
break;
case operation::exec:
cancel_unwritten_requests();
break;
Expand All @@ -405,7 +400,6 @@ class connection_base {
break;
case operation::all:
resv_.cancel();
ssl_handshaker_.cancel();
cfg_.reconnect_wait_interval = std::chrono::seconds::zero();
health_checker_.cancel();
cancel_run(); // run
Expand Down Expand Up @@ -469,7 +463,6 @@ class connection_base {
cfg_ = cfg;
resv_.set_config(cfg);
ctor_.set_config(cfg);
ssl_handshaker_.set_config(cfg);
health_checker_.set_config(cfg);
runner_.set_config(cfg);
l.set_prefix(cfg.log_prefix);
Expand All @@ -496,7 +489,6 @@ class connection_base {
private:
using receive_channel_type = asio::experimental::channel<executor_type, void(system::error_code, std::size_t)>;
using resolver_type = resolver<Executor>;
using handshaker_type = handshaker<Executor>;
using health_checker_type = health_checker<Executor>;
using runner_type = runner<executor_type>;
using adapter_type = std::function<void(std::size_t, resp3::basic_node<std::string_view> const&, system::error_code&)>;
Expand Down Expand Up @@ -906,7 +898,6 @@ class connection_base {
receive_channel_type receive_channel_;
resolver_type resv_;
connector ctor_;
handshaker_type ssl_handshaker_;
health_checker_type health_checker_;
runner_type runner_;
receiver_adapter_type receive_adapter_;
Expand Down
114 changes: 0 additions & 114 deletions include/boost/redis/detail/handshaker.hpp

This file was deleted.

15 changes: 12 additions & 3 deletions include/boost/redis/detail/runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/asio/prepend.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/asio/cancel_after.hpp>
#include <string>
#include <memory>
#include <chrono>
Expand Down Expand Up @@ -120,9 +122,16 @@ class runner_op {

if (conn_->use_ssl()) {
BOOST_ASIO_CORO_YIELD
conn_->ssl_handshaker_.async_handshake(
conn_->next_layer(),
asio::prepend(std::move(self), order_t {}));
conn_->next_layer().async_handshake(
asio::ssl::stream_base::client,
asio::prepend(
asio::cancel_after(
runner_->cfg_.ssl_handshake_timeout,
std::move(self)
),
order_t {}
)
);

logger_.on_ssl_handshake(ec0);

Expand Down

0 comments on commit d5de174

Please sign in to comment.