diff --git a/ChangeLog b/ChangeLog index d7feb5a8..251065ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-10-06 Tatsuhiro Tsujikawa + + Changed the type of _numNewConnection to unsigned int. + * src/ActivePeerConnectionCommand.cc + * src/ActivePeerConnectionCommand.h + 2008-10-06 Tatsuhiro Tsujikawa * Release 0.16.0 diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc index 346f45c2..36a7416f 100644 --- a/src/ActivePeerConnectionCommand.cc +++ b/src/ActivePeerConnectionCommand.cc @@ -89,11 +89,11 @@ bool ActivePeerConnectionCommand::execute() { (!pieceStorage->downloadFinished() && (tstat.getDownloadSpeed() < _thresholdSpeed || btRuntime->lessThanMinPeers()))) { - size_t numConnection = pieceStorage->downloadFinished() ? + unsigned int numConnection = pieceStorage->downloadFinished() ? std::min(_numNewConnection, BtRuntime::MAX_PEERS-btRuntime->getConnections()) : _numNewConnection; - for(size_t numAdd = numConnection; + for(unsigned int numAdd = numConnection; numAdd > 0 && peerStorage->isPeerAvailable(); --numAdd) { PeerHandle peer = peerStorage->getUnusedPeer(); connectToPeer(peer); diff --git a/src/ActivePeerConnectionCommand.h b/src/ActivePeerConnectionCommand.h index 4414ea37..6204ad76 100644 --- a/src/ActivePeerConnectionCommand.h +++ b/src/ActivePeerConnectionCommand.h @@ -55,7 +55,7 @@ private: Time checkPoint; unsigned int _thresholdSpeed; // UNIT: byte/sec unsigned int _maxUploadSpeedLimit; - size_t _numNewConnection; // the number of the connection to establish. + unsigned int _numNewConnection; // the number of the connection to establish. public: ActivePeerConnectionCommand(int cuid, RequestGroup* requestGroup,