diff options
Diffstat (limited to 'src/PeerInteractionCommand.cc')
| -rw-r--r-- | src/PeerInteractionCommand.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index b10fb3ce..e451a8e2 100644 --- a/src/PeerInteractionCommand.cc +++ b/src/PeerInteractionCommand.cc @@ -43,6 +43,7 @@ #include "message.h" #include "prefs.h" #include "SocketCore.h" +#include "uTPCore.h" #include "Option.h" #include "DownloadContext.h" #include "Peer.h" @@ -376,6 +377,22 @@ bool PeerInteractionCommand::executeInternal() return false; } +bool PeerInteractionCommand::retryDifferentProtocol() +{ + int tried = getPeer()->triedProtocols(); + tried |= (getPeer()->isuTP() ? PEER_UTP : PEER_TCP); + if (tried == PEER_ALL) { + return false; + } + getPeer()->triedProtocols(tried); + auto command = make_unique<PeerInitiateConnectionCommand>( + getCuid(), requestGroup_, getPeer(), getDownloadEngine(), btRuntime_); + command->setPeerStorage(peerStorage_); + command->setPieceStorage(pieceStorage_); + getDownloadEngine()->addCommand(std::move(command)); + return true; +} + // TODO this method removed when PeerBalancerCommand is implemented bool PeerInteractionCommand::prepareForNextPeer(time_t wait) { |
