summaryrefslogtreecommitdiff
path: root/src/Peer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Peer.h')
-rw-r--r--src/Peer.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/Peer.h b/src/Peer.h
index f669ad05..7fd304ae 100644
--- a/src/Peer.h
+++ b/src/Peer.h
@@ -53,6 +53,8 @@ namespace aria2 {
class PeerSessionResource;
class BtMessageDispatcher;
+enum PeerProtocols { PEER_UTP = 1, PEER_TCP = 2, PEER_ALL = 3 };
+
class Peer {
private:
std::string ipaddr_;
@@ -64,8 +66,6 @@ private:
// is used to distinguish peer identity.
uint16_t origPort_;
- bool supportUtp_;
-
cuid_t cuid_;
unsigned char peerId_[PEER_ID_LENGTH];
@@ -74,10 +74,15 @@ private:
Timer dropStartTime_;
- bool seeder_;
-
std::unique_ptr<PeerSessionResource> res_;
+ int triedProtocols_ = 0;
+
+ bool isuTP_;
+ bool uTPSupport_;
+
+ bool seeder_;
+
// If true, port is assumed not to be a listening port.
bool incoming_;
@@ -105,9 +110,17 @@ public:
uint16_t getOrigPort() const { return origPort_; }
- bool supportUtp() const { return supportUtp_; }
+ bool isuTP() const { return isuTP_; }
+
+ void isuTP(bool uTP) { isuTP_ = uTP; }
+
+ bool uTPSupport() const { return uTPSupport_; }
+
+ void uTPSupport(bool support) { uTPSupport_ = support; }
+
+ int triedProtocols() const { return triedProtocols_; }
- void supportUtp(bool support) { supportUtp_ = support; }
+ void triedProtocols(int tried) { triedProtocols_ = tried; }
void usedBy(cuid_t cuid);