fix: don't retry plain handshake in `AwaitingVc` state (#6969)

This commit is contained in:
Yat Ho 2024-10-22 05:31:11 +08:00 committed by GitHub
parent 819d7f4136
commit b5cc6916ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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();