mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #6107
3d649d5
epee: close connection when the peer has done so (moneromooo-monero)
This commit is contained in:
commit
97bdaae7d3
1 changed files with 7 additions and 1 deletions
|
@ -410,7 +410,12 @@ PRAGMA_WARNING_DISABLE_VS(4355)
|
|||
else
|
||||
{
|
||||
_dbg3("[sock " << socket().native_handle() << "] peer closed connection");
|
||||
if (m_ready_to_close)
|
||||
bool do_shutdown = false;
|
||||
CRITICAL_REGION_BEGIN(m_send_que_lock);
|
||||
if(!m_send_que.size())
|
||||
do_shutdown = true;
|
||||
CRITICAL_REGION_END();
|
||||
if (m_ready_to_close || do_shutdown)
|
||||
shutdown();
|
||||
}
|
||||
m_ready_to_close = true;
|
||||
|
@ -470,6 +475,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
|
|||
{
|
||||
MERROR("SSL handshake failed");
|
||||
boost::interprocess::ipcdetail::atomic_write32(&m_want_close_connection, 1);
|
||||
m_ready_to_close = true;
|
||||
bool do_shutdown = false;
|
||||
CRITICAL_REGION_BEGIN(m_send_que_lock);
|
||||
if(!m_send_que.size())
|
||||
|
|
Loading…
Reference in a new issue