Merge pull request #29 from pkwong4321/master

Skip LOG in ping, fix heap error, fix #30
This commit is contained in:
melode11 2015-06-25 23:13:52 +08:00
commit ccdd0c5bcc
2 changed files with 7 additions and 4 deletions

View File

@ -273,7 +273,8 @@ namespace sio
{
if(ec || m_con.expired())
{
LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);
if (ec != boost::asio::error::operation_aborted)
LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);
return;
}
packet p(packet::frame_ping);

View File

@ -316,6 +316,9 @@ namespace sio
void socket::impl::on_close()
{
NULL_GUARD(m_client);
sio::client_impl *client = m_client;
m_client = NULL;
if(m_connection_timer)
{
m_connection_timer->cancel();
@ -325,9 +328,8 @@ namespace sio
while (!m_packet_queue.empty()) {
m_packet_queue.pop();
}
m_client->on_socket_closed(m_nsp);
m_client->remove_socket(m_nsp);
m_client = NULL;
client->on_socket_closed(m_nsp);
client->remove_socket(m_nsp);
}
void socket::impl::on_open()