From 30e0e19e671697f8f62b43b1e03772ad29ca2407 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 8 Dec 2011 21:51:52 +0900 Subject: [PATCH] Code cleanup --- src/DHTGetPeersCommand.cc | 12 ++++++------ src/DHTGetPeersCommand.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/DHTGetPeersCommand.cc b/src/DHTGetPeersCommand.cc index d19a00c5..0bc6cc44 100644 --- a/src/DHTGetPeersCommand.cc +++ b/src/DHTGetPeersCommand.cc @@ -63,7 +63,7 @@ const time_t GET_PEER_INTERVAL_ZERO = 60; // Interval for retry. const time_t GET_PEER_INTERVAL_RETRY = 5; // Maximum retries. Try more than 5 to drop bad node. -const size_t MAX_RETRIES = 10; +const int MAX_RETRIES = 10; } // namespace @@ -112,13 +112,13 @@ bool DHTGetPeersCommand::execute() lastGetPeerTime_ = global::wallclock(); if(numRetry_ < MAX_RETRIES && (btRuntime_->getMaxPeers() == 0 || - btRuntime_->getMaxPeers() > peerStorage_->countPeer())) { + btRuntime_->getMaxPeers()) > peerStorage_->countPeer()) { ++numRetry_; - A2_LOG_DEBUG(fmt("Too few peers. peers=%lu, max_peers=%lu." - " Try again(%lu)", + A2_LOG_DEBUG(fmt("Too few peers. peers=%lu, max_peers=%d." + " Try again(%d)", static_cast(peerStorage_->countPeer()), - static_cast(btRuntime_->getMaxPeers()), - static_cast(numRetry_))); + btRuntime_->getMaxPeers(), + numRetry_)); } else { numRetry_ = 0; } diff --git a/src/DHTGetPeersCommand.h b/src/DHTGetPeersCommand.h index 145351e2..9715709a 100644 --- a/src/DHTGetPeersCommand.h +++ b/src/DHTGetPeersCommand.h @@ -66,7 +66,7 @@ private: SharedHandle task_; - size_t numRetry_; + int numRetry_; Timer lastGetPeerTime_; public: