diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-02 11:22:47 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-02 11:22:47 +0000 |
| commit | 46f0e018d462f2b145ea180b0daa530831ea09b0 (patch) | |
| tree | 35d23f84f4e4ba2a1cb046fa94a720af29bc2bfe /src/Peer.h | |
| parent | d4215a82b757a3928a7c8a2babbd1645cf7d7e71 (diff) | |
2008-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added _incoming member to Peer class and made it true if the
peer
initiated connection. Don't add those peer to UTPex message.
If extended handshake is received, assign _incoming to false.
* src/DefaultBtInteractive.cc
* src/HandshakeExtensionMessage.cc
* src/Peer.cc
* src/Peer.h
* src/PeerListenCommand.cc
Diffstat (limited to 'src/Peer.h')
| -rw-r--r-- | src/Peer.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -69,12 +69,15 @@ private: PeerSessionResource* _res; + // If true, port is assumed not to be a listening port. + bool _incoming; + // Before calling updateSeeder(), make sure that // allocateSessionResource() is called and _res is created. // Otherwise assertion fails. void updateSeeder(); public: - Peer(std::string ipaddr, uint16_t port); + Peer(std::string ipaddr, uint16_t port, bool incoming = false); ~Peer(); @@ -237,6 +240,10 @@ public: const Time& getLastAmUnchoking() const; uint64_t getCompletedLength() const; + + bool isIncomingPeer() const; + + void setIncomingPeer(bool incoming); }; typedef SharedHandle<Peer> PeerHandle; |
