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
Hi I find a problem about pong_timeout_handler.
In file connection_impl.hpp,I see if endpoint send a ping to remote,a m_ping_timer will be create,and it will save the share_ptr of the connect.If the remote doesn't response the pong,the m_pong_timeout_handler will be called. Some case will lead to core.
Step1. create a object named WClient ,the websocketpp ppclient is a member of WClient.
Step2.set the member function(handle_pong_timeout) of WClient to ppclient as the pong_timeout_handler。
step3. create connect to a remote server,send a ping to server after connect created.
step4.the server doesn't response pong.And close the the connect
step5.the WClient receive close message,and free the WClient object.So the pong_timeout_handler is invalid.
step6. but the ppclient is not freed because it will save the share_ptr of itself when create the ping timer.
step7.the ping timer will be called because the client doesn't receive a pong from remote.
step8.so the WClient will call handle_pong_timeout,then call m_pong_timeout_handler.
but m_pong_timeout_handler is invalid, so it will generate a core file.
The text was updated successfully, but these errors were encountered:
I think it is better to check the staus if is open when call m_pong_timeout_handler.if not,may be the handler is invaild .
in file connection_impl.hpp
template
void connection::handle_pong_timeout(std::string payload,
lib::error_code const & ec)
{
if (ec) {
if (ec == transport::error::operation_aborted) {
// ignore, this is expected
return;
}
Hi I find a problem about pong_timeout_handler.
In file connection_impl.hpp,I see if endpoint send a ping to remote,a m_ping_timer will be create,and it will save the share_ptr of the connect.If the remote doesn't response the pong,the m_pong_timeout_handler will be called. Some case will lead to core.
Step1. create a object named WClient ,the websocketpp ppclient is a member of WClient.
Step2.set the member function(handle_pong_timeout) of WClient to ppclient as the pong_timeout_handler。
step3. create connect to a remote server,send a ping to server after connect created.
step4.the server doesn't response pong.And close the the connect
step5.the WClient receive close message,and free the WClient object.So the pong_timeout_handler is invalid.
step6. but the ppclient is not freed because it will save the share_ptr of itself when create the ping timer.
step7.the ping timer will be called because the client doesn't receive a pong from remote.
step8.so the WClient will call handle_pong_timeout,then call m_pong_timeout_handler.
but m_pong_timeout_handler is invalid, so it will generate a core file.
The text was updated successfully, but these errors were encountered: