diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-12 11:27:47 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-12 12:10:50 +0000 |
commit | 1b91bebd2e9aff014c018496e7730de8feee1a80 (patch) | |
tree | 19965f8886a3a6c22dd92668047c2793ec4c65d3 /contrib/epee/include/net | |
parent | Merge pull request #5876 (diff) | |
download | monero-1b91bebd2e9aff014c018496e7730de8feee1a80.tar.xz |
abstract_tcp_server2: fix lingering connections
Resetting the timer after shutdown was initiated would keep
a reference to the object inside ASIO, which would keep the
connection alive until the timer timed out
Diffstat (limited to 'contrib/epee/include/net')
-rw-r--r-- | contrib/epee/include/net/abstract_tcp_server2.inl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index 12a87071a..729951341 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -736,6 +736,11 @@ PRAGMA_WARNING_DISABLE_VS(4355) MERROR("Resetting timer on a dead object"); return; } + if (m_was_shutdown) + { + MERROR("Setting timer on a shut down object"); + return; + } if (add) ms += m_timer.expires_from_now(); m_timer.expires_from_now(ms); |