diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-06-05 11:21:48 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-06-05 11:21:48 +0900 |
| commit | 12b903f3121683cd287c2f27dfdcd1fc19bab894 (patch) | |
| tree | 21824797fce73128f8dbbac89bf5c3a93bd38da4 | |
| parent | e31a49b8ee56f2068d9d10bcc055ec7c58ea1208 (diff) | |
Set Peer::chokingRequired(true) for all active peer
| -rw-r--r-- | src/BtLeecherStateChoke.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/BtLeecherStateChoke.cc b/src/BtLeecherStateChoke.cc index 98db9e3e..5c734a4f 100644 --- a/src/BtLeecherStateChoke.cc +++ b/src/BtLeecherStateChoke.cc @@ -218,10 +218,17 @@ void BtLeecherStateChoke::executeChoke(const PeerSet& peerSet) std::vector<PeerEntry> peerEntries; for (const auto& p : peerSet) { - if (p->isActive() && !p->snubbing()) { - p->chokingRequired(true); - peerEntries.push_back(PeerEntry(p)); + if (!p->isActive()) { + continue; + } + + p->chokingRequired(true); + + if (p->snubbing()) { + continue; } + + peerEntries.push_back(PeerEntry(p)); } // planned optimistic unchoke |
