From 9c67466cde9ed52d96e0de9be1098d55c6912789 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 31 Mar 2006 16:17:52 +0000 Subject: [PATCH] --- src/PeerInteractionCommand.cc | 2 +- src/PeerInteractionCommand.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index e04d93d4..64f83fc6 100644 --- a/src/PeerInteractionCommand.cc +++ b/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 { diff --git a/src/PeerInteractionCommand.h b/src/PeerInteractionCommand.h index 72488391..24e7057e 100644 --- a/src/PeerInteractionCommand.h +++ b/src/PeerInteractionCommand.h @@ -28,6 +28,8 @@ using namespace std; +#define MAX_PEER_CHOKING_INTERVAL (3*60) + class PeerInteractionCommand : public PeerAbstractCommand { private: int sequence;