Skip to content

Commit

Permalink
Tentative to bring compatibility with Boost 1.66+.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-vincent committed Apr 15, 2018
1 parent d5b862e commit 573a2d3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
9 changes: 8 additions & 1 deletion libs/freelan/include/freelan/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,11 @@ namespace freelan

boost::asio::io_service& m_io_service;
freelan::configuration m_configuration;
#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_logger_strand;
#else
boost::asio::strand m_logger_strand;
#endif
fscp::logger m_logger;

private: /* Callbacks */
Expand Down Expand Up @@ -695,8 +699,11 @@ namespace freelan
void do_write_switch(const port_index_type&, boost::asio::const_buffer, switch_::multi_write_handler_type);
void do_write_router(const port_index_type&, boost::asio::const_buffer, router::port_type::write_handler_type);

#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_router_strand;
#else
boost::asio::strand m_router_strand;

#endif
switch_ m_switch;
router m_router;
asiotap::route_manager m_route_manager;
Expand Down
4 changes: 4 additions & 0 deletions libs/freelan/src/curl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,11 @@ namespace freelan
void check_info();

boost::asio::io_service& m_io_service;
#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_strand;
#else
boost::asio::strand m_strand;
#endif
boost::asio::deadline_timer m_timer;
std::map<boost::shared_ptr<curl>, connection_complete_callback> m_handler_map;
std::map<boost::shared_ptr<curl>, CURLcode> m_result_map;
Expand Down
23 changes: 22 additions & 1 deletion libs/fscp/include/fscp/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,9 +1294,14 @@ namespace fscp
void pop_write();

socket_type m_socket;
#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_socket_strand;
boost::asio::io_context::strand m_write_queue_strand;
#else
boost::asio::strand m_socket_strand;
std::queue<void_handler_type> m_write_queue;
boost::asio::strand m_write_queue_strand;
#endif
std::queue<void_handler_type> m_write_queue;
std::list<SharedBuffer> m_socket_buffers;

private: // HELLO messages
Expand Down Expand Up @@ -1400,7 +1405,11 @@ namespace fscp
void do_set_hello_message_received_callback(hello_message_received_handler_type, void_handler_type);

ep_hello_context_map m_ep_hello_contexts;
#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_greet_strand;
#else
boost::asio::strand m_greet_strand;
#endif
bool m_accept_hello_messages_default;
hello_message_received_handler_type m_hello_message_received_handler;

Expand All @@ -1420,7 +1429,11 @@ namespace fscp
void do_set_presentation_message_received_callback(presentation_message_received_handler_type, void_handler_type);

// This strand is also used by session requests and session messages during the cipherment/decipherment phase.
#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_presentation_strand;
#else
boost::asio::strand m_presentation_strand;
#endif
presentation_store_map m_presentation_store_map;
presentation_message_received_handler_type m_presentation_message_received_handler;

Expand All @@ -1446,7 +1459,11 @@ namespace fscp
void do_set_session_request_message_received_callback(session_request_received_handler_type, void_handler_type);

// This strand is common to session requests, session messages and data messages.
#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_session_strand;
#else
boost::asio::strand m_session_strand;
#endif

peer_session_map_type m_peer_sessions;
std::list<SharedBuffer> m_session_buffers;
Expand Down Expand Up @@ -1500,7 +1517,11 @@ namespace fscp
void do_set_contact_request_received_callback(contact_request_received_handler_type, void_handler_type);
void do_set_contact_received_callback(contact_received_handler_type, void_handler_type);

#if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+
boost::asio::io_context::strand m_contact_strand;
#else
boost::asio::strand m_contact_strand;
#endif

data_received_handler_type m_data_received_handler;
contact_request_received_handler_type m_contact_request_message_received_handler;
Expand Down

0 comments on commit 573a2d3

Please sign in to comment.