From b5cc6916efd24cbe7b6daddb54ec49d5286e1064 Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Tue, 22 Oct 2024 05:31:11 +0800 Subject: [PATCH] fix: don't retry plain handshake in `AwaitingVc` state (#6969) --- libtransmission/handshake.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtransmission/handshake.cc b/libtransmission/handshake.cc index ee6878484..19dbda556 100644 --- a/libtransmission/handshake.cc +++ b/libtransmission/handshake.cc @@ -664,8 +664,8 @@ void tr_handshake::on_error(tr_peerIo* io, tr_error const& error, void* vhandsha /* if the error happened while we were sending a public key, we might * have encountered a peer that doesn't do encryption... reconnect and * try a plaintext handshake */ - if ((handshake->is_state(State::AwaitingYb) || handshake->is_state(State::AwaitingVc)) && - handshake->encryption_mode_ != TR_ENCRYPTION_REQUIRED && handshake->mediator_->allows_tcp() && io->reconnect()) + if (handshake->is_state(State::AwaitingYb) && handshake->encryption_mode_ != TR_ENCRYPTION_REQUIRED && + handshake->mediator_->allows_tcp() && io->reconnect()) { tr_logAddTraceHand(handshake, "handshake failed, trying plaintext..."); retry();