diff options
| author | tobtoht <tob@featherwallet.org> | 2026-06-05 11:02:27 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2026-06-05 11:02:27 +0000 |
| commit | 82fdc1dd730e3ff20ece280e3c9bfc9508353b61 (patch) | |
| tree | 0db1f615105b0562f0967074dc23d5a98afa2f90 /contrib | |
| parent | 34c9abfc4c43adf52e3eb67424ac0d70a6c5f655 (diff) | |
| parent | c5c9420d8cc9b5b44fd6dc177b3cac773e5e1674 (diff) | |
| download | monzero-core-82fdc1dd730e3ff20ece280e3c9bfc9508353b61.tar.gz monzero-core-82fdc1dd730e3ff20ece280e3c9bfc9508353b61.tar.xz monzero-core-82fdc1dd730e3ff20ece280e3c9bfc9508353b61.zip | |
Merge pull request #10495
c5c9420 p2p: cleaner connection close() (j-berman)
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/epee/include/net/abstract_tcp_server2.inl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index 56d3d7de2..4c09a09fe 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -1140,7 +1140,9 @@ namespace net_utils bool connection<T>::close(const bool wait_for_shutdown) { std::lock_guard<std::mutex> guard(m_state.lock); - if (m_state.status != status_t::RUNNING) + if (m_state.status == status_t::TERMINATED || m_state.status == status_t::WASTED) + return true; + if (!wait_for_shutdown && m_state.status != status_t::RUNNING) return false; terminate_async(); |
