Skip to content

Commit

Permalink
Fix an issue where custom timeout values weren't being propagated fro…
Browse files Browse the repository at this point in the history
…m endpoints to new connections
  • Loading branch information
Peter Thorson committed Feb 12, 2014
1 parent 724974c commit 883410b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
14 changes: 7 additions & 7 deletions websocketpp/impl/endpoint_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ endpoint<connection,config>::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) {
Expand Down Expand Up @@ -142,7 +142,7 @@ void endpoint<connection,config>::resume_reading(connection_hdl hdl) {


template <typename connection, typename config>
void endpoint<connection,config>::send(connection_hdl hdl, std::string const & payload,
void endpoint<connection,config>::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);
Expand All @@ -152,7 +152,7 @@ void endpoint<connection,config>::send(connection_hdl hdl, std::string const & p
}

template <typename connection, typename config>
void endpoint<connection,config>::send(connection_hdl hdl, std::string const & payload,
void endpoint<connection,config>::send(connection_hdl hdl, std::string const & payload,
frame::opcode::value op)
{
lib::error_code ec;
Expand Down Expand Up @@ -231,7 +231,7 @@ void endpoint<connection,config>::ping(connection_hdl hdl, std::string const & p
}

template <typename connection, typename config>
void endpoint<connection,config>::pong(connection_hdl hdl, std::string const & payload,
void endpoint<connection,config>::pong(connection_hdl hdl, std::string const & payload,
lib::error_code & ec)
{
connection_ptr con = get_con_from_hdl(hdl,ec);
Expand Down

0 comments on commit 883410b

Please sign in to comment.