From 623dffe2c054d1639dbf9c8f21ddfb088c7950fb Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Sat, 11 Feb 2017 14:48:52 +0100 Subject: Working Ed25519 Implementation of libcmix. --- libcmix-network/accept.cpp | 6 +++--- libcmix-network/client.hpp | 4 ++-- libcmix-network/connect.cpp | 8 ++++---- libcmix-network/server.cpp | 3 +-- libcmix-network/server.hpp | 1 - 5 files changed, 10 insertions(+), 12 deletions(-) (limited to 'libcmix-network') diff --git a/libcmix-network/accept.cpp b/libcmix-network/accept.cpp index 1ec26fe..9806a67 100644 --- a/libcmix-network/accept.cpp +++ b/libcmix-network/accept.cpp @@ -36,12 +36,12 @@ void accept_connection(tcp::acceptor& acceptor, std::shared_ptr ct { if(!bool(ec)) { - socket->async_handshake(boost::asio::ssl::stream_base::server, [&acceptor, ctx, socket, f](boost::system::error_code const& ec) { - if(!bool(ec)) { + socket->async_handshake(boost::asio::ssl::stream_base::server, [&acceptor, ctx, socket, f](boost::system::error_code const& ec2) { + if(!bool(ec2)) { f(std::unique_ptr>(socket), ctx); } else { std::stringstream ss; - ss << ec.message(); + ss << ec2.message(); delete socket; throw std::runtime_error(ss.str()); } diff --git a/libcmix-network/client.hpp b/libcmix-network/client.hpp index 7b2b16f..ff32d2e 100644 --- a/libcmix-network/client.hpp +++ b/libcmix-network/client.hpp @@ -74,8 +74,8 @@ class BaseClient { boost::asio::async_read( *socket, receive_buffer->prepare(size), - [this, message_handler](boost::system::error_code const& ec, size_t read_bytes) { - handle_receive_message(message_handler, ec, read_bytes); + [this, message_handler](boost::system::error_code const& ec2, size_t read_bytes2) { + handle_receive_message(message_handler, ec2, read_bytes2); } ); } else { diff --git a/libcmix-network/connect.cpp b/libcmix-network/connect.cpp index e80a6d4..4bebf9d 100644 --- a/libcmix-network/connect.cpp +++ b/libcmix-network/connect.cpp @@ -70,11 +70,11 @@ void async_connect_iteration(basic_socket>& sock info->retry_timer.expires_from_now(boost::posix_time::seconds(seconds_to_wait)); - info->retry_timer.async_wait([&socket, info, on_connect](boost::system::error_code const& ec){ - if(ec == boost::system::errc::operation_canceled) { + info->retry_timer.async_wait([&socket, info, on_connect](boost::system::error_code const& ec2){ + if(ec2 == boost::system::errc::operation_canceled) { return; - } else if(ec) { - BOOST_LOG_TRIVIAL(error) << "Something went wrong with the retry timer: " << ec.message(); + } else if(ec2) { + BOOST_LOG_TRIVIAL(error) << "Something went wrong with the retry timer: " << ec2.message(); } else { async_connect_iteration(socket, info, on_connect); } diff --git a/libcmix-network/server.cpp b/libcmix-network/server.cpp index a931c1e..e254d5d 100644 --- a/libcmix-network/server.cpp +++ b/libcmix-network/server.cpp @@ -4,8 +4,7 @@ using namespace boost::asio::ip; using namespace boost::asio; Server::Server(io_service& io_service, const ListenSettings& listen_settings) -: listen_settings(listen_settings) -, v4_acceptor(io_service, address_v4::from_string(listen_settings.ipv4_inaddr), listen_settings.port) +: v4_acceptor(io_service, address_v4::from_string(listen_settings.ipv4_inaddr), listen_settings.port) , v6_acceptor(io_service, address_v6::from_string(listen_settings.ipv6_inaddr), listen_settings.port) { /* diff --git a/libcmix-network/server.hpp b/libcmix-network/server.hpp index 29559e7..878bb0b 100644 --- a/libcmix-network/server.hpp +++ b/libcmix-network/server.hpp @@ -31,7 +31,6 @@ class Server { Server(boost::asio::io_service& io_service, ListenSettings const& listen_settings); - ListenSettings const& listen_settings; Acceptor v4_acceptor; Acceptor v6_acceptor; -- cgit v1.2.3-70-g09d2