You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In impl/connection_impl.hpp line 1974 there is ping timeout canceled after pong handler is called.
if (m_pong_handler) {
m_pong_handler(m_connection_hdl, msg->get_payload());
}
if (m_ping_timer) { // <------------------------------ HERE
m_ping_timer->cancel();
}
The order of these blocks is obviously wrong.
Since m_pong_handler() is an invocation of external code (with respect to current class) the class must not assume anything about the duration the handler may take. This way it is logical to first cancel the timeout timer (since the operation has succeeded already) and only then start calling an external handler of unknown duration.
The text was updated successfully, but these errors were encountered:
This makes sense. I think in practice serialization of handlers should mitigate most adverse effects, but reversing the order here makes more logical sense and should be more robust against exceptions and avoid doing any unnecessary work.
In impl/connection_impl.hpp line 1974 there is ping timeout canceled after pong handler is called.
The order of these blocks is obviously wrong.
Since m_pong_handler() is an invocation of external code (with respect to current class) the class must not assume anything about the duration the handler may take. This way it is logical to first cancel the timeout timer (since the operation has succeeded already) and only then start calling an external handler of unknown duration.
The text was updated successfully, but these errors were encountered: