diff options
Diffstat (limited to 'src/Peer.h')
| -rw-r--r-- | src/Peer.h | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -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); |
