mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix PeerImp concurrent access of socket:
The PeerImp::run launch function is now dispatched on the strand to prevent undefined behavior resulting from concurrent access to the ssl::stream object.
This commit is contained in:
@@ -92,6 +92,9 @@ PeerImp::~PeerImp ()
|
||||
void
|
||||
PeerImp::run()
|
||||
{
|
||||
if(! strand_.running_in_this_thread())
|
||||
return strand_.post(std::bind (
|
||||
&PeerImp::run, shared_from_this()));
|
||||
if (m_inbound)
|
||||
{
|
||||
if (read_buffer_.size() > 0)
|
||||
|
||||
Reference in New Issue
Block a user