mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix a deadlock.
This commit is contained in:
@@ -363,28 +363,28 @@ void Peer::handleReadHeader(const boost::system::error_code& error)
|
|||||||
|
|
||||||
void Peer::handleReadBody(const boost::system::error_code& error)
|
void Peer::handleReadBody(const boost::system::error_code& error)
|
||||||
{
|
{
|
||||||
|
{
|
||||||
boost::recursive_mutex::scoped_lock sl(ioMutex);
|
boost::recursive_mutex::scoped_lock sl(ioMutex);
|
||||||
|
|
||||||
if (mDetaching)
|
if (mDetaching)
|
||||||
{
|
{
|
||||||
// Drop data or error if detaching.
|
return;
|
||||||
nothing();
|
|
||||||
}
|
}
|
||||||
else if (!error)
|
else if (error)
|
||||||
{
|
|
||||||
processReadBuffer();
|
|
||||||
startReadHeader();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
cLog(lsINFO) << "Peer: Body: Error: " << ADDRESS(this) << ": " << error.category().name() << ": " << error.message() << ": " << error;
|
cLog(lsINFO) << "Peer: Body: Error: " << ADDRESS(this) << ": " << error.category().name() << ": " << error.message() << ": " << error;
|
||||||
boost::recursive_mutex::scoped_lock sl(theApp->getMasterLock());
|
boost::recursive_mutex::scoped_lock sl(theApp->getMasterLock());
|
||||||
detach("hrb");
|
detach("hrb");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
processReadBuffer();
|
||||||
|
startReadHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Peer::processReadBuffer()
|
void Peer::processReadBuffer()
|
||||||
{
|
{ // must not hold peer lock
|
||||||
int type = PackedMessage::getType(mReadbuf);
|
int type = PackedMessage::getType(mReadbuf);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// std::cerr << "PRB(" << type << "), len=" << (mReadbuf.size()-HEADER_SIZE) << std::endl;
|
// std::cerr << "PRB(" << type << "), len=" << (mReadbuf.size()-HEADER_SIZE) << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user