Tatsuhiro Tsujikawa 19 years ago
parent
commit
9c67466cde
2 changed files with 3 additions and 1 deletions
  1. 1 1
      src/PeerInteractionCommand.cc
  2. 2 0
      src/PeerInteractionCommand.h

+ 1 - 1
src/PeerInteractionCommand.cc

@@ -170,7 +170,7 @@ void PeerInteractionCommand::checkLongTimePeerChoking() {
     }
   } else {
     if(peer->amInterested && peer->peerChoking) {
-      if(Util::difftv(now, chokeCheckPoint) >= 3*60*1000000) {
+      if(Util::difftv(now, chokeCheckPoint) >= MAX_PEER_CHOKING_INTERVAL*1000000) {
 	throw new DlAbortEx("too long choking");
       }
     } else {

+ 2 - 0
src/PeerInteractionCommand.h

@@ -28,6 +28,8 @@
 
 using namespace std;
 
+#define MAX_PEER_CHOKING_INTERVAL (3*60)
+
 class PeerInteractionCommand : public PeerAbstractCommand {
 private:
   int sequence;