mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
netbase: use reliable send() during SOCKS5 handshake
`send(2)` can be interrupted or for another reason it may not fully complete sending all the bytes. We should be ready to retry the send with the remaining bytes. This is what `Sock::SendComplete()` does, thus use it in `Socks5()`. Since `Sock::SendComplete()` takes a `CThreadInterrupt` argument, change also the recv part of `Socks5()` to use `CThreadInterrupt` instead of a boolean. Easier reviewed with `git show -b` (ignore white-space changes).
This commit is contained in:
@@ -3260,7 +3260,6 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
|
||||
// Start threads
|
||||
//
|
||||
assert(m_msgproc);
|
||||
InterruptSocks5(false);
|
||||
interruptNet.reset();
|
||||
flagInterruptMsgProc = false;
|
||||
|
||||
@@ -3332,7 +3331,7 @@ void CConnman::Interrupt()
|
||||
condMsgProc.notify_all();
|
||||
|
||||
interruptNet();
|
||||
InterruptSocks5(true);
|
||||
g_socks5_interrupt();
|
||||
|
||||
if (semOutbound) {
|
||||
for (int i=0; i<m_max_outbound; i++) {
|
||||
|
||||
Reference in New Issue
Block a user