fixed race condition

This commit is contained in:
orignal 2015-04-05 13:56:41 -04:00
parent 10577cd1e5
commit 250af7f247
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ namespace data
void Reseed ();
// for web interface and stats
// for web interface
int GetNumRouters () const { return m_RouterInfos.size (); };
int GetNumFloodfills () const { return m_Floodfills.size (); };
int GetNumLeaseSets () const { return m_LeaseSets.size (); };

View File

@ -235,8 +235,8 @@ namespace stream
s->HandleReceiveTimer (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), buffer, handler);
else
{
m_ReceiveTimer.expires_from_now (boost::posix_time::seconds(timeout));
m_ReceiveTimer.async_wait ([=](const boost::system::error_code& ecode)
s->m_ReceiveTimer.expires_from_now (boost::posix_time::seconds(timeout));
s->m_ReceiveTimer.async_wait ([=](const boost::system::error_code& ecode)
{ s->HandleReceiveTimer (ecode, buffer, handler); });
}
});