summaryrefslogtreecommitdiff
path: root/src/TrackerUpdateCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-05-20 15:22:50 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-05-20 15:22:50 +0000
commitad7078db28a19c5206bd7c9a2d9c00c725b40354 (patch)
tree41dce05bf4f0c80171ad7409e22ab21bff830bec /src/TrackerUpdateCommand.cc
parentf3995b1f7ebb2d659fc1c6b1561f15e79741d5fa (diff)
Use CUIDCounter instead of BtRuntime::getNewCuid():
* src/ActivePeerConnectionCommand.cc * src/PeerInteractionCommand.cc * src/BtRuntime.h (cuidCounter): Removed. (getNewCuid): Removed. * src/DownloadEngineFactory.cc * src/PeerListenCommand.cc * src/TrackerUpdateCommand.cc * src/PeerInitiateConnectionCommand.cc Use CUIDCounter instead of BtRuntime::getNewCuid(): * src/ActivePeerConnectionCommand.cc * src/PeerInteractionCommand.cc * src/BtRuntime.h (cuidCounter): Removed. (getNewCuid): Removed. * src/DownloadEngineFactory.cc * src/PeerListenCommand.cc * src/TrackerUpdateCommand.cc * src/PeerInitiateConnectionCommand.cc
Diffstat (limited to 'src/TrackerUpdateCommand.cc')
-rw-r--r--src/TrackerUpdateCommand.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/TrackerUpdateCommand.cc b/src/TrackerUpdateCommand.cc
index 53796e76..24f57d71 100644
--- a/src/TrackerUpdateCommand.cc
+++ b/src/TrackerUpdateCommand.cc
@@ -39,6 +39,7 @@
#include "PeerInitiateConnectionCommand.h"
#include "SleepCommand.h"
#include "Util.h"
+#include "CUIDCounter.h"
TrackerUpdateCommand::TrackerUpdateCommand(int cuid,
TorrentDownloadEngine* e,
@@ -101,15 +102,14 @@ bool TrackerUpdateCommand::execute() {
if(peer.isNull()) {
break;
}
- int newCuid = btRuntime->getNewCuid();
- peer->cuid = newCuid;
+ peer->cuid = CUIDCounterSingletonHolder::instance()->newID();
PeerInitiateConnectionCommand* command =
- new PeerInitiateConnectionCommand(newCuid,
+ new PeerInitiateConnectionCommand(peer->cuid,
peer,
e,
btContext);
e->commands.push_back(command);
- logger->debug("CUID#%d - Adding new command CUID#%d", cuid, newCuid);
+ logger->debug("CUID#%d - Adding new command CUID#%d", cuid, peer->cuid);
}
btAnnounce->announceSuccess();
btAnnounce->resetAnnounce();