Skip to content

Commit

Permalink
Initialize use_tls_ variable in the constructor for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Mar 18, 2021
1 parent 5005edd commit b2cf60b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/network_asio.cpp
Expand Up @@ -65,6 +65,7 @@ connection::connection(const std::string& host, const std::string& service)
, host_(host)
, service_(service)
, resolver_(io_context_)
, use_tls_(true)
, socket_(raw_socket(new raw_socket::element_type{io_context_}))
, done_(false)
, write_buf_()
Expand Down
2 changes: 1 addition & 1 deletion src/network_asio.hpp
Expand Up @@ -134,7 +134,7 @@ class connection
typedef std::unique_ptr<boost::asio::ip::tcp::socket> raw_socket;
typedef std::unique_ptr<boost::asio::ssl::stream<raw_socket::element_type>> tls_socket;
typedef utils::variant<raw_socket, tls_socket> any_socket;
bool use_tls_ = true;
bool use_tls_;
any_socket socket_;

bool done_;
Expand Down
1 change: 1 addition & 0 deletions src/wesnothd_connection.cpp
Expand Up @@ -63,6 +63,7 @@ wesnothd_connection::wesnothd_connection(const std::string& host, const std::str
, tls_context_(boost::asio::ssl::context::sslv23)
, host_(host)
, service_(service)
, use_tls_(true)
, socket_(raw_socket{ new raw_socket::element_type{io_context_} })
, last_error_()
, last_error_mutex_()
Expand Down
2 changes: 1 addition & 1 deletion src/wesnothd_connection.hpp
Expand Up @@ -147,7 +147,7 @@ class wesnothd_connection
typedef std::unique_ptr<boost::asio::ip::tcp::socket> raw_socket;
typedef std::unique_ptr<boost::asio::ssl::stream<raw_socket::element_type>> tls_socket;
typedef utils::variant<raw_socket, tls_socket> any_socket;
bool use_tls_ = true;
bool use_tls_;
any_socket socket_;

boost::system::error_code last_error_;
Expand Down

0 comments on commit b2cf60b

Please sign in to comment.