diff --git a/changelog.md b/changelog.md index 344d9f138b..d11a81847b 100644 --- a/changelog.md +++ b/changelog.md @@ -13,7 +13,7 @@ HEAD the main thread. - Feature: Adds the ability to specify whether or not to use the `SO_REUSEADDR` TCP socket option. The default for this value has been changed from `true` to `false`. -- Feature: Adds the ability to specify a maximum message size. +- Feature: Adds the ability to specify a maximum message size. - Improvement: Open, close, and pong timeouts can be disabled entirely by setting their duration to 0. - Improvement: Numerous performance improvements. Including: tuned default @@ -29,12 +29,14 @@ HEAD - Bug: Fixes incorrect whitespace handling in header parsing. #301 Thank you Wolfram Schroers for reporting - Bug: Fix a crash when parsing empty HTTP headers. Thank you Thingol for reporting. -- Bug: Fix a crash following use of the `stop_listening` function. Thank you Thingol for +- Bug: Fix a crash following use of the `stop_listening` function. Thank you Thingol for reporting. - Bug: Fix use of variable names that shadow function parameters. The library should compile cleanly with -Wshadow now. Thank you giszo for reporting. #318 - Bug: Fix an issue where `set_open_handshake_timeout` was ignored by server code. Thank you Robin Rowe for reporting. +- Bug: Fix an issue where custom timeout values weren't being propagated from + endpoints to new connections. - Compatibility: Fix compile time conflict with Visual Studio's MIN/MAX macros. Thank you Robin Rowe for reporting. diff --git a/websocketpp/impl/endpoint_impl.hpp b/websocketpp/impl/endpoint_impl.hpp index 356858dde3..2cd4ff2b29 100644 --- a/websocketpp/impl/endpoint_impl.hpp +++ b/websocketpp/impl/endpoint_impl.hpp @@ -64,14 +64,14 @@ endpoint::create_connection() { con->set_http_handler(m_http_handler); con->set_validate_handler(m_validate_handler); con->set_message_handler(m_message_handler); - - if (m_open_handshake_timeout_dur == config::timeout_open_handshake) { + + if (m_open_handshake_timeout_dur != config::timeout_open_handshake) { con->set_open_handshake_timeout(m_open_handshake_timeout_dur); } - if (m_close_handshake_timeout_dur == config::timeout_close_handshake) { + if (m_close_handshake_timeout_dur != config::timeout_close_handshake) { con->set_close_handshake_timeout(m_close_handshake_timeout_dur); } - if (m_pong_timeout_dur == config::timeout_pong) { + if (m_pong_timeout_dur != config::timeout_pong) { con->set_pong_timeout(m_pong_timeout_dur); } if (m_max_message_size != config::max_message_size) { @@ -142,7 +142,7 @@ void endpoint::resume_reading(connection_hdl hdl) { template -void endpoint::send(connection_hdl hdl, std::string const & payload, +void endpoint::send(connection_hdl hdl, std::string const & payload, frame::opcode::value op, lib::error_code & ec) { connection_ptr con = get_con_from_hdl(hdl,ec); @@ -152,7 +152,7 @@ void endpoint::send(connection_hdl hdl, std::string const & p } template -void endpoint::send(connection_hdl hdl, std::string const & payload, +void endpoint::send(connection_hdl hdl, std::string const & payload, frame::opcode::value op) { lib::error_code ec; @@ -231,7 +231,7 @@ void endpoint::ping(connection_hdl hdl, std::string const & p } template -void endpoint::pong(connection_hdl hdl, std::string const & payload, +void endpoint::pong(connection_hdl hdl, std::string const & payload, lib::error_code & ec) { connection_ptr con = get_con_from_hdl(hdl,ec);