Преглед изворни кода

Drop connection if client and peer are both seeders.

Tatsuhiro Tsujikawa пре 14 година
родитељ
комит
653951f70a
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      src/DefaultBtInteractive.cc

+ 4 - 0
src/DefaultBtInteractive.cc

@@ -461,6 +461,10 @@ void DefaultBtInteractive::checkActiveInteraction()
              static_cast<long int>(interval)));
     }
   }
+  // If both of us are seeders, drop connection.
+  if(peer_->isSeeder() && pieceStorage_->downloadFinished()) {
+    throw DL_ABORT_EX(MSG_GOOD_BYE_SEEDER);
+  }
 }
 
 void DefaultBtInteractive::addPeerExchangeMessage()