diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-03-20 14:30:36 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-03-20 14:30:36 +0000 |
| commit | bf5f559c5cfd3a7111a67b542008ca0878ac43d1 (patch) | |
| tree | 603dbeab0cfc8b8d3ca34ade9c281a9649d4c7fd /src | |
| parent | 10edc156eabd363e5138d5d974050ea5d7655c30 (diff) | |
2010-03-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use cuid_t type for cuid.
Diffstat (limited to 'src')
136 files changed, 190 insertions, 169 deletions
diff --git a/src/AbstractBtMessage.h b/src/AbstractBtMessage.h index 4a6a296d..9713937b 100644 --- a/src/AbstractBtMessage.h +++ b/src/AbstractBtMessage.h @@ -36,6 +36,7 @@ #define _D_ABSTRACT_BT_MESSAGE_H_ #include "BtMessage.h" +#include "Command.h" namespace aria2 { @@ -53,7 +54,7 @@ protected: bool sendingInProgress; bool invalidate; bool uploading; - int32_t cuid; + cuid_t cuid; std::string _name; @@ -103,11 +104,11 @@ public: this->uploading = uploading; } - int32_t getCuid() const { + cuid_t getCuid() const { return cuid; } - void setCuid(int32_t cuid) { + void setCuid(cuid_t cuid) { this->cuid = cuid; } diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc index a43cd284..180831e7 100644 --- a/src/AbstractCommand.cc +++ b/src/AbstractCommand.cc @@ -68,7 +68,7 @@ namespace aria2 { -AbstractCommand::AbstractCommand(int32_t cuid, +AbstractCommand::AbstractCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/AbstractCommand.h b/src/AbstractCommand.h index 6028d1fe..6f9393f6 100644 --- a/src/AbstractCommand.h +++ b/src/AbstractCommand.h @@ -152,7 +152,7 @@ private: #endif // ENABLE_ASYNC_DNS public: - AbstractCommand(int32_t cuid, const SharedHandle<Request>& req, + AbstractCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<SocketCore>& s = SharedHandle<SocketCore>()); diff --git a/src/AbstractProxyRequestCommand.cc b/src/AbstractProxyRequestCommand.cc index d870d241..a4a2070a 100644 --- a/src/AbstractProxyRequestCommand.cc +++ b/src/AbstractProxyRequestCommand.cc @@ -50,7 +50,7 @@ namespace aria2 { AbstractProxyRequestCommand::AbstractProxyRequestCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/AbstractProxyRequestCommand.h b/src/AbstractProxyRequestCommand.h index 93d11dc2..4ffad746 100644 --- a/src/AbstractProxyRequestCommand.h +++ b/src/AbstractProxyRequestCommand.h @@ -54,7 +54,7 @@ protected: virtual bool executeInternal(); public: - AbstractProxyRequestCommand(int cuid, + AbstractProxyRequestCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/AbstractProxyResponseCommand.cc b/src/AbstractProxyResponseCommand.cc index e04dcc1d..1c46b8d9 100644 --- a/src/AbstractProxyResponseCommand.cc +++ b/src/AbstractProxyResponseCommand.cc @@ -50,7 +50,7 @@ namespace aria2 { AbstractProxyResponseCommand::AbstractProxyResponseCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/AbstractProxyResponseCommand.h b/src/AbstractProxyResponseCommand.h index fa167046..e0b06a8f 100644 --- a/src/AbstractProxyResponseCommand.h +++ b/src/AbstractProxyResponseCommand.h @@ -49,7 +49,7 @@ protected: virtual bool executeInternal(); public: AbstractProxyResponseCommand - (int cuid, + (cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc index 995475c8..524172b1 100644 --- a/src/ActivePeerConnectionCommand.cc +++ b/src/ActivePeerConnectionCommand.cc @@ -54,7 +54,7 @@ namespace aria2 { ActivePeerConnectionCommand::ActivePeerConnectionCommand -(int cuid, +(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, time_t interval) diff --git a/src/ActivePeerConnectionCommand.h b/src/ActivePeerConnectionCommand.h index a34b0d41..ff58b6ba 100644 --- a/src/ActivePeerConnectionCommand.h +++ b/src/ActivePeerConnectionCommand.h @@ -62,7 +62,7 @@ private: Time checkPoint; unsigned int _numNewConnection; // the number of the connection to establish. public: - ActivePeerConnectionCommand(int cuid, + ActivePeerConnectionCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, time_t interval); diff --git a/src/AutoSaveCommand.cc b/src/AutoSaveCommand.cc index c70b671b..af98f316 100644 --- a/src/AutoSaveCommand.cc +++ b/src/AutoSaveCommand.cc @@ -39,7 +39,7 @@ namespace aria2 { -AutoSaveCommand::AutoSaveCommand(int32_t cuid, DownloadEngine* e, time_t interval): +AutoSaveCommand::AutoSaveCommand(cuid_t cuid, DownloadEngine* e, time_t interval): TimeBasedCommand(cuid, e, interval, true) {} AutoSaveCommand::~AutoSaveCommand() {} diff --git a/src/AutoSaveCommand.h b/src/AutoSaveCommand.h index 663e4890..89f25f5d 100644 --- a/src/AutoSaveCommand.h +++ b/src/AutoSaveCommand.h @@ -42,7 +42,7 @@ namespace aria2 { class AutoSaveCommand : public TimeBasedCommand { public: - AutoSaveCommand(int32_t cuid, DownloadEngine* e, time_t interval); + AutoSaveCommand(cuid_t cuid, DownloadEngine* e, time_t interval); virtual ~AutoSaveCommand(); diff --git a/src/BtStopDownloadCommand.cc b/src/BtStopDownloadCommand.cc index a1c36b62..93abbe6e 100644 --- a/src/BtStopDownloadCommand.cc +++ b/src/BtStopDownloadCommand.cc @@ -44,7 +44,7 @@ namespace aria2 { BtStopDownloadCommand::BtStopDownloadCommand -(int32_t cuid, +(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, time_t timeout): diff --git a/src/BtStopDownloadCommand.h b/src/BtStopDownloadCommand.h index 23449bc4..193b5439 100644 --- a/src/BtStopDownloadCommand.h +++ b/src/BtStopDownloadCommand.h @@ -59,7 +59,7 @@ private: SharedHandle<PieceStorage> _pieceStorage; public: BtStopDownloadCommand - (int32_t cuid, + (cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, time_t timeout); diff --git a/src/CheckIntegrityCommand.cc b/src/CheckIntegrityCommand.cc index 00d8c354..4d82bf78 100644 --- a/src/CheckIntegrityCommand.cc +++ b/src/CheckIntegrityCommand.cc @@ -46,7 +46,7 @@ namespace aria2 { CheckIntegrityCommand::CheckIntegrityCommand -(int32_t cuid, RequestGroup* requestGroup, DownloadEngine* e, +(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<CheckIntegrityEntry>& entry): RealtimeCommand(cuid, requestGroup, e), _entry(entry) diff --git a/src/CheckIntegrityCommand.h b/src/CheckIntegrityCommand.h index 7eeab09e..b950a43b 100644 --- a/src/CheckIntegrityCommand.h +++ b/src/CheckIntegrityCommand.h @@ -48,7 +48,7 @@ private: SharedHandle<CheckIntegrityEntry> _entry; Time _timer; public: - CheckIntegrityCommand(int32_t cuid, + CheckIntegrityCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<CheckIntegrityEntry>& entry); diff --git a/src/CheckIntegrityDispatcherCommand.cc b/src/CheckIntegrityDispatcherCommand.cc index ccc9c5f3..6b1dee88 100644 --- a/src/CheckIntegrityDispatcherCommand.cc +++ b/src/CheckIntegrityDispatcherCommand.cc @@ -42,7 +42,7 @@ namespace aria2 { CheckIntegrityDispatcherCommand::CheckIntegrityDispatcherCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<CheckIntegrityMan>& fileAllocMan, DownloadEngine* e):SequentialDispatcherCommand<CheckIntegrityEntry> (cuid, fileAllocMan, e) @@ -53,7 +53,7 @@ CheckIntegrityDispatcherCommand::CheckIntegrityDispatcherCommand Command* CheckIntegrityDispatcherCommand::createCommand (const SharedHandle<CheckIntegrityEntry>& entry) { - int32_t newCUID = _e->newCUID(); + cuid_t newCUID = _e->newCUID(); logger->info("CUID#%d - Dispatching CheckIntegrityCommand CUID#%d.", cuid, newCUID); return new CheckIntegrityCommand diff --git a/src/CheckIntegrityDispatcherCommand.h b/src/CheckIntegrityDispatcherCommand.h index 5eeee085..a1c79e50 100644 --- a/src/CheckIntegrityDispatcherCommand.h +++ b/src/CheckIntegrityDispatcherCommand.h @@ -46,7 +46,7 @@ class CheckIntegrityDispatcherCommand : public SequentialDispatcherCommand<CheckIntegrityEntry> { public: CheckIntegrityDispatcherCommand - (int32_t cuid, + (cuid_t cuid, const SharedHandle<CheckIntegrityMan>& checkMan, DownloadEngine* e); protected: diff --git a/src/Command.h b/src/Command.h index 34647ada..4a2b60d2 100644 --- a/src/Command.h +++ b/src/Command.h @@ -60,7 +60,7 @@ private: static int32_t uuidGen; STATUS status; protected: - int32_t cuid; + cuid_t cuid; Logger* logger; bool _readEvent; diff --git a/src/CreateRequestCommand.cc b/src/CreateRequestCommand.cc index b41189d9..8edb9b05 100644 --- a/src/CreateRequestCommand.cc +++ b/src/CreateRequestCommand.cc @@ -49,7 +49,7 @@ namespace aria2 { -CreateRequestCommand::CreateRequestCommand(int32_t cuid, +CreateRequestCommand::CreateRequestCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e): AbstractCommand diff --git a/src/CreateRequestCommand.h b/src/CreateRequestCommand.h index 0afe87b8..7d8abf26 100644 --- a/src/CreateRequestCommand.h +++ b/src/CreateRequestCommand.h @@ -41,7 +41,7 @@ namespace aria2 { class CreateRequestCommand:public AbstractCommand { public: - CreateRequestCommand(int32_t cuid, + CreateRequestCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e); protected: diff --git a/src/DHTAutoSaveCommand.cc b/src/DHTAutoSaveCommand.cc index a2453d08..f4645850 100644 --- a/src/DHTAutoSaveCommand.cc +++ b/src/DHTAutoSaveCommand.cc @@ -58,7 +58,7 @@ namespace aria2 { -DHTAutoSaveCommand::DHTAutoSaveCommand(int32_t cuid, DownloadEngine* e, time_t interval): +DHTAutoSaveCommand::DHTAutoSaveCommand(cuid_t cuid, DownloadEngine* e, time_t interval): TimeBasedCommand(cuid, e, interval) {} DHTAutoSaveCommand::~DHTAutoSaveCommand() {} diff --git a/src/DHTAutoSaveCommand.h b/src/DHTAutoSaveCommand.h index a1f5522f..1a672849 100644 --- a/src/DHTAutoSaveCommand.h +++ b/src/DHTAutoSaveCommand.h @@ -52,7 +52,7 @@ private: void save(); public: - DHTAutoSaveCommand(int32_t cuid, DownloadEngine* e, time_t interval); + DHTAutoSaveCommand(cuid_t cuid, DownloadEngine* e, time_t interval); virtual ~DHTAutoSaveCommand(); diff --git a/src/DHTBucketRefreshCommand.cc b/src/DHTBucketRefreshCommand.cc index 41a51ea7..04e67ba9 100644 --- a/src/DHTBucketRefreshCommand.cc +++ b/src/DHTBucketRefreshCommand.cc @@ -43,7 +43,8 @@ namespace aria2 { -DHTBucketRefreshCommand::DHTBucketRefreshCommand(int32_t cuid, DownloadEngine* e, time_t interval): +DHTBucketRefreshCommand::DHTBucketRefreshCommand +(cuid_t cuid, DownloadEngine* e, time_t interval): TimeBasedCommand(cuid, e, interval) {} DHTBucketRefreshCommand::~DHTBucketRefreshCommand() {} diff --git a/src/DHTBucketRefreshCommand.h b/src/DHTBucketRefreshCommand.h index d6056339..b408f1e6 100644 --- a/src/DHTBucketRefreshCommand.h +++ b/src/DHTBucketRefreshCommand.h @@ -52,7 +52,7 @@ private: SharedHandle<DHTTaskFactory> _taskFactory; public: - DHTBucketRefreshCommand(int32_t cuid, DownloadEngine* e, time_t interval); + DHTBucketRefreshCommand(cuid_t cuid, DownloadEngine* e, time_t interval); virtual ~DHTBucketRefreshCommand(); diff --git a/src/DHTEntryPointNameResolveCommand.cc b/src/DHTEntryPointNameResolveCommand.cc index c4c5be8c..ca3daaad 100644 --- a/src/DHTEntryPointNameResolveCommand.cc +++ b/src/DHTEntryPointNameResolveCommand.cc @@ -56,7 +56,7 @@ namespace aria2 { DHTEntryPointNameResolveCommand::DHTEntryPointNameResolveCommand -(int32_t cuid, DownloadEngine* e, +(cuid_t cuid, DownloadEngine* e, const std::vector<std::pair<std::string, uint16_t> >& entryPoints): Command(cuid), _e(e), diff --git a/src/DHTEntryPointNameResolveCommand.h b/src/DHTEntryPointNameResolveCommand.h index 85c9c92a..0982f9ec 100644 --- a/src/DHTEntryPointNameResolveCommand.h +++ b/src/DHTEntryPointNameResolveCommand.h @@ -89,7 +89,7 @@ private: public: DHTEntryPointNameResolveCommand - (int32_t cuid, DownloadEngine* e, + (cuid_t cuid, DownloadEngine* e, const std::vector<std::pair<std:: string, uint16_t> >& entryPoints); virtual ~DHTEntryPointNameResolveCommand(); diff --git a/src/DHTGetPeersCommand.cc b/src/DHTGetPeersCommand.cc index 6ac17a1f..3841d4ac 100644 --- a/src/DHTGetPeersCommand.cc +++ b/src/DHTGetPeersCommand.cc @@ -50,7 +50,7 @@ namespace aria2 { -DHTGetPeersCommand::DHTGetPeersCommand(int32_t cuid, +DHTGetPeersCommand::DHTGetPeersCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e): Command(cuid), diff --git a/src/DHTGetPeersCommand.h b/src/DHTGetPeersCommand.h index ad45bb7a..7fbd7483 100644 --- a/src/DHTGetPeersCommand.h +++ b/src/DHTGetPeersCommand.h @@ -74,7 +74,7 @@ private: Time _lastGetPeerTime; public: - DHTGetPeersCommand(int32_t cuid, RequestGroup* requestGroup, + DHTGetPeersCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e); virtual ~DHTGetPeersCommand(); diff --git a/src/DHTInteractionCommand.cc b/src/DHTInteractionCommand.cc index f62dbf6a..28bf5059 100644 --- a/src/DHTInteractionCommand.cc +++ b/src/DHTInteractionCommand.cc @@ -49,7 +49,7 @@ namespace aria2 { -DHTInteractionCommand::DHTInteractionCommand(int32_t cuid, DownloadEngine* e): +DHTInteractionCommand::DHTInteractionCommand(cuid_t cuid, DownloadEngine* e): Command(cuid), _e(e) {} diff --git a/src/DHTInteractionCommand.h b/src/DHTInteractionCommand.h index e4cfacc8..f5a3f049 100644 --- a/src/DHTInteractionCommand.h +++ b/src/DHTInteractionCommand.h @@ -56,7 +56,7 @@ private: SharedHandle<SocketCore> _readCheckSocket; public: - DHTInteractionCommand(int32_t cuid, DownloadEngine* e); + DHTInteractionCommand(cuid_t cuid, DownloadEngine* e); virtual ~DHTInteractionCommand(); diff --git a/src/DHTPeerAnnounceCommand.cc b/src/DHTPeerAnnounceCommand.cc index 6271f9b9..823f8ffb 100644 --- a/src/DHTPeerAnnounceCommand.cc +++ b/src/DHTPeerAnnounceCommand.cc @@ -43,7 +43,8 @@ namespace aria2 { -DHTPeerAnnounceCommand::DHTPeerAnnounceCommand(int32_t cuid, DownloadEngine* e, time_t interval): +DHTPeerAnnounceCommand::DHTPeerAnnounceCommand +(cuid_t cuid, DownloadEngine* e, time_t interval): TimeBasedCommand(cuid, e, interval) {} DHTPeerAnnounceCommand::~DHTPeerAnnounceCommand() {} diff --git a/src/DHTPeerAnnounceCommand.h b/src/DHTPeerAnnounceCommand.h index 8ab2ee25..35abdbbc 100644 --- a/src/DHTPeerAnnounceCommand.h +++ b/src/DHTPeerAnnounceCommand.h @@ -46,7 +46,7 @@ class DHTPeerAnnounceCommand:public TimeBasedCommand { private: SharedHandle<DHTPeerAnnounceStorage> _peerAnnounceStorage; public: - DHTPeerAnnounceCommand(int32_t cuid, DownloadEngine* e, time_t interval); + DHTPeerAnnounceCommand(cuid_t cuid, DownloadEngine* e, time_t interval); virtual ~DHTPeerAnnounceCommand(); diff --git a/src/DHTTokenUpdateCommand.cc b/src/DHTTokenUpdateCommand.cc index 943c56fe..908b11bc 100644 --- a/src/DHTTokenUpdateCommand.cc +++ b/src/DHTTokenUpdateCommand.cc @@ -43,7 +43,7 @@ namespace aria2 { -DHTTokenUpdateCommand::DHTTokenUpdateCommand(int32_t cuid, +DHTTokenUpdateCommand::DHTTokenUpdateCommand(cuid_t cuid, DownloadEngine* e, time_t interval): TimeBasedCommand(cuid, e, interval) {} diff --git a/src/DHTTokenUpdateCommand.h b/src/DHTTokenUpdateCommand.h index 8f011fb8..9ba2242d 100644 --- a/src/DHTTokenUpdateCommand.h +++ b/src/DHTTokenUpdateCommand.h @@ -46,7 +46,7 @@ class DHTTokenUpdateCommand:public TimeBasedCommand { private: SharedHandle<DHTTokenTracker> _tokenTracker; public: - DHTTokenUpdateCommand(int32_t cuid, DownloadEngine* e, time_t interval); + DHTTokenUpdateCommand(cuid_t cuid, DownloadEngine* e, time_t interval); virtual ~DHTTokenUpdateCommand(); diff --git a/src/DefaultBtInteractive.h b/src/DefaultBtInteractive.h index b3511e75..5b72f12d 100644 --- a/src/DefaultBtInteractive.h +++ b/src/DefaultBtInteractive.h @@ -40,6 +40,7 @@ #include <limits.h> #include "TimeA2.h" +#include "Command.h" namespace aria2 { @@ -97,7 +98,7 @@ public: class DefaultBtInteractive : public BtInteractive { private: - int32_t cuid; + cuid_t cuid; SharedHandle<DownloadContext> _downloadContext; @@ -188,7 +189,8 @@ public: virtual size_t countOutstandingRequest(); - void setCuid(int32_t cuid) { + void setCuid(cuid_t cuid) + { this->cuid = cuid; } diff --git a/src/DefaultBtMessageDispatcher.cc b/src/DefaultBtMessageDispatcher.cc index f67e39ab..b33decb0 100644 --- a/src/DefaultBtMessageDispatcher.cc +++ b/src/DefaultBtMessageDispatcher.cc @@ -140,10 +140,10 @@ void DefaultBtMessageDispatcher::doCancelSendingPieceAction class AbortOutstandingRequest { private: SharedHandle<Piece> _piece; - int32_t _cuid; + cuid_t _cuid; Logger* _logger; public: - AbortOutstandingRequest(const SharedHandle<Piece>& piece, int32_t cuid): + AbortOutstandingRequest(const SharedHandle<Piece>& piece, cuid_t cuid): _piece(piece), _cuid(cuid), _logger(LogFactory::getInstance()) {} @@ -185,12 +185,12 @@ void DefaultBtMessageDispatcher::doAbortOutstandingRequestAction class ProcessChokedRequestSlot { private: - int32_t _cuid; + cuid_t _cuid; SharedHandle<Peer> _peer; SharedHandle<PieceStorage> _pieceStorage; Logger* _logger; public: - ProcessChokedRequestSlot(int32_t cuid, + ProcessChokedRequestSlot(cuid_t cuid, const SharedHandle<Peer>& peer, const SharedHandle<PieceStorage>& pieceStorage): _cuid(cuid), @@ -252,7 +252,7 @@ void DefaultBtMessageDispatcher::doChokingAction() class ProcessStaleRequestSlot { private: - int32_t _cuid; + cuid_t _cuid; SharedHandle<Peer> _peer; SharedHandle<PieceStorage> _pieceStorage; BtMessageDispatcher* _messageDispatcher; @@ -260,7 +260,7 @@ private: time_t _requestTimeout; Logger* _logger; public: - ProcessStaleRequestSlot(int32_t cuid, const SharedHandle<Peer>& peer, + ProcessStaleRequestSlot(cuid_t cuid, const SharedHandle<Peer>& peer, const SharedHandle<PieceStorage>& pieceStorage, BtMessageDispatcher* dispatcher, const WeakHandle<BtMessageFactory>& factory, diff --git a/src/DefaultBtMessageDispatcher.h b/src/DefaultBtMessageDispatcher.h index 861f8b1e..3bad0828 100644 --- a/src/DefaultBtMessageDispatcher.h +++ b/src/DefaultBtMessageDispatcher.h @@ -40,6 +40,7 @@ #include <deque> #include "a2time.h" +#include "Command.h" namespace aria2 { @@ -55,7 +56,7 @@ class RequestGroupMan; class DefaultBtMessageDispatcher : public BtMessageDispatcher { private: - int32_t cuid; + cuid_t cuid; std::deque<SharedHandle<BtMessage> > messageQueue; std::deque<RequestSlot> requestSlots; SharedHandle<DownloadContext> _downloadContext; @@ -133,7 +134,8 @@ public: void setRequestGroupMan(const WeakHandle<RequestGroupMan>& rgman); - void setCuid(int32_t cuid) { + void setCuid(cuid_t cuid) + { this->cuid = cuid; } diff --git a/src/DefaultBtMessageFactory.h b/src/DefaultBtMessageFactory.h index 811b2315..b654540d 100644 --- a/src/DefaultBtMessageFactory.h +++ b/src/DefaultBtMessageFactory.h @@ -36,6 +36,7 @@ #define _D_DEFAULT_BT_MESSAGE_FACTORY_H_ #include "BtMessageFactory.h" +#include "Command.h" namespace aria2 { @@ -55,7 +56,7 @@ class DHTTaskFactory; class DefaultBtMessageFactory : public BtMessageFactory { private: - int32_t cuid; + cuid_t cuid; SharedHandle<DownloadContext> _downloadContext; SharedHandle<PieceStorage> _pieceStorage; SharedHandle<PeerStorage> _peerStorage; @@ -142,7 +143,8 @@ public: void setPeerStorage(const SharedHandle<PeerStorage>& peerStorage); - void setCuid(int32_t cuid) { + void setCuid(cuid_t cuid) + { this->cuid = cuid; } diff --git a/src/DefaultBtMessageReceiver.h b/src/DefaultBtMessageReceiver.h index c66b46f0..73edfe99 100644 --- a/src/DefaultBtMessageReceiver.h +++ b/src/DefaultBtMessageReceiver.h @@ -36,6 +36,7 @@ #define _D_DEFAULT_BT_MESSAGE_RECEIVER_H_ #include "BtMessageReceiver.h" +#include "Command.h" namespace aria2 { @@ -48,7 +49,7 @@ class Logger; class DefaultBtMessageReceiver : public BtMessageReceiver { private: - int32_t cuid; + cuid_t cuid; bool handshakeSent; SharedHandle<DownloadContext> _downloadContext; SharedHandle<Peer> peer; @@ -69,11 +70,13 @@ public: virtual SharedHandle<BtMessage> receiveMessage(); - void setCuid(int32_t cuid) { + void setCuid(cuid_t cuid) + { this->cuid = cuid; } - int32_t getCuid() const { + cuid_t getCuid() const + { return cuid; } diff --git a/src/DefaultBtRequestFactory.h b/src/DefaultBtRequestFactory.h index 7be2bf01..5f5c54f9 100644 --- a/src/DefaultBtRequestFactory.h +++ b/src/DefaultBtRequestFactory.h @@ -39,6 +39,8 @@ #include <deque> +#include "Command.h" + namespace aria2 { class PieceStorage; @@ -50,7 +52,7 @@ class Logger; class DefaultBtRequestFactory : public BtRequestFactory { private: - int32_t cuid; + cuid_t cuid; SharedHandle<PieceStorage> _pieceStorage; SharedHandle<Peer> peer; WeakHandle<BtMessageDispatcher> dispatcher; @@ -91,7 +93,7 @@ public: return pieces; } - void setCuid(int32_t cuid) + void setCuid(cuid_t cuid) { this->cuid = cuid; } diff --git a/src/DefaultPieceStorage.cc b/src/DefaultPieceStorage.cc index 47d1254e..dc39d621 100644 --- a/src/DefaultPieceStorage.cc +++ b/src/DefaultPieceStorage.cc @@ -535,7 +535,7 @@ size_t DefaultPieceStorage::getPieceLength(size_t index) return bitfieldMan->getBlockLength(index); } -void DefaultPieceStorage::advertisePiece(int32_t cuid, size_t index) +void DefaultPieceStorage::advertisePiece(cuid_t cuid, size_t index) { HaveEntry entry(cuid, index); haves.push_front(entry); @@ -543,7 +543,7 @@ void DefaultPieceStorage::advertisePiece(int32_t cuid, size_t index) void DefaultPieceStorage::getAdvertisedPieceIndexes(std::vector<size_t>& indexes, - int32_t myCuid, + cuid_t myCuid, const Time& lastCheckTime) { for(std::deque<HaveEntry>::const_iterator itr = haves.begin(), diff --git a/src/DefaultPieceStorage.h b/src/DefaultPieceStorage.h index d759758c..9e6f06e8 100644 --- a/src/DefaultPieceStorage.h +++ b/src/DefaultPieceStorage.h @@ -54,15 +54,15 @@ class PieceSelector; class HaveEntry { private: - int32_t cuid; + cuid_t cuid; size_t index; Time registeredTime; public: - HaveEntry(int32_t cuid, size_t index): + HaveEntry(cuid_t cuid, size_t index): cuid(cuid), index(index) {} - int32_t getCuid() const { return cuid; } + cuid_t getCuid() const { return cuid; } size_t getIndex() const { return index; } @@ -191,11 +191,11 @@ public: virtual size_t getPieceLength(size_t index); - virtual void advertisePiece(int32_t cuid, size_t index); + virtual void advertisePiece(cuid_t cuid, size_t index); virtual void getAdvertisedPieceIndexes(std::vector<size_t>& indexes, - int32_t myCuid, const Time& lastCheckTime); + cuid_t myCuid, const Time& lastCheckTime); virtual void removeAdvertisedPiece(time_t elapsed); diff --git a/src/DownloadCommand.cc b/src/DownloadCommand.cc index 213e54e8..1dd9d549 100644 --- a/src/DownloadCommand.cc +++ b/src/DownloadCommand.cc @@ -67,7 +67,7 @@ namespace aria2 { static const size_t BUFSIZE = 16*1024; -DownloadCommand::DownloadCommand(int cuid, +DownloadCommand::DownloadCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/DownloadCommand.h b/src/DownloadCommand.h index 9f3c937c..af63c093 100644 --- a/src/DownloadCommand.h +++ b/src/DownloadCommand.h @@ -76,7 +76,7 @@ protected: virtual bool prepareForNextSegment(); public: - DownloadCommand(int cuid, + DownloadCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FileAllocationCommand.cc b/src/FileAllocationCommand.cc index 94260f34..2293a975 100644 --- a/src/FileAllocationCommand.cc +++ b/src/FileAllocationCommand.cc @@ -49,7 +49,7 @@ namespace aria2 { FileAllocationCommand::FileAllocationCommand -(int cuid, RequestGroup* requestGroup, DownloadEngine* e, +(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<FileAllocationEntry>& fileAllocationEntry): RealtimeCommand(cuid, requestGroup, e), _fileAllocationEntry(fileAllocationEntry) {} diff --git a/src/FileAllocationCommand.h b/src/FileAllocationCommand.h index 08e82bdf..42177fa9 100644 --- a/src/FileAllocationCommand.h +++ b/src/FileAllocationCommand.h @@ -48,7 +48,7 @@ private: SharedHandle<FileAllocationEntry> _fileAllocationEntry; Time _timer; public: - FileAllocationCommand(int cuid, RequestGroup* requestGroup, + FileAllocationCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<FileAllocationEntry>& fileAllocationEntry); diff --git a/src/FileAllocationDispatcherCommand.cc b/src/FileAllocationDispatcherCommand.cc index 777abf3e..15f71aa1 100644 --- a/src/FileAllocationDispatcherCommand.cc +++ b/src/FileAllocationDispatcherCommand.cc @@ -42,7 +42,7 @@ namespace aria2 { FileAllocationDispatcherCommand::FileAllocationDispatcherCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<FileAllocationMan>& fileAllocMan, DownloadEngine* e):SequentialDispatcherCommand<FileAllocationEntry> (cuid, fileAllocMan, e) {} @@ -50,7 +50,7 @@ FileAllocationDispatcherCommand::FileAllocationDispatcherCommand Command* FileAllocationDispatcherCommand::createCommand (const SharedHandle<FileAllocationEntry>& entry) { - int32_t newCUID = _e->newCUID(); + cuid_t newCUID = _e->newCUID(); logger->info(MSG_FILE_ALLOCATION_DISPATCH, newCUID); FileAllocationCommand* command = new FileAllocationCommand(newCUID, entry->getRequestGroup(), _e, entry); diff --git a/src/FileAllocationDispatcherCommand.h b/src/FileAllocationDispatcherCommand.h index 8615d974..03721e9a 100644 --- a/src/FileAllocationDispatcherCommand.h +++ b/src/FileAllocationDispatcherCommand.h @@ -46,7 +46,7 @@ class FileAllocationDispatcherCommand : public SequentialDispatcherCommand<FileAllocationEntry> { public: FileAllocationDispatcherCommand - (int32_t cuid, + (cuid_t cuid, const SharedHandle<FileAllocationMan>& fileAllocMan, DownloadEngine* e); protected: diff --git a/src/FillRequestGroupCommand.cc b/src/FillRequestGroupCommand.cc index 34f56f3e..b8e74db0 100644 --- a/src/FillRequestGroupCommand.cc +++ b/src/FillRequestGroupCommand.cc @@ -44,7 +44,7 @@ namespace aria2 { -FillRequestGroupCommand::FillRequestGroupCommand(int32_t cuid, +FillRequestGroupCommand::FillRequestGroupCommand(cuid_t cuid, DownloadEngine* e, time_t interval): Command(cuid), diff --git a/src/FillRequestGroupCommand.h b/src/FillRequestGroupCommand.h index 262b8f7b..e6ba46ee 100644 --- a/src/FillRequestGroupCommand.h +++ b/src/FillRequestGroupCommand.h @@ -50,7 +50,7 @@ private: time_t _interval; Time _checkPoint; public: - FillRequestGroupCommand(int32_t cuid, DownloadEngine* e, time_t interval); + FillRequestGroupCommand(cuid_t cuid, DownloadEngine* e, time_t interval); virtual ~FillRequestGroupCommand(); diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index f14262ba..5d14e202 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -62,7 +62,7 @@ const std::string FtpConnection::A("A"); const std::string FtpConnection::I("I"); -FtpConnection::FtpConnection(int32_t cuid, const SocketHandle& socket, +FtpConnection::FtpConnection(cuid_t cuid, const SocketHandle& socket, const SharedHandle<Request>& req, const SharedHandle<AuthConfig>& authConfig, const Option* op): diff --git a/src/FtpConnection.h b/src/FtpConnection.h index b6a3c67e..d95594ac 100644 --- a/src/FtpConnection.h +++ b/src/FtpConnection.h @@ -43,6 +43,7 @@ #include "SharedHandle.h" #include "TimeA2.h" #include "SocketBuffer.h" +#include "Command.h" namespace aria2 { @@ -55,7 +56,7 @@ class AuthConfig; class FtpConnection { private: - int32_t cuid; + cuid_t cuid; SharedHandle<SocketCore> socket; SharedHandle<Request> req; @@ -82,7 +83,7 @@ private: //prepare for large banners static const size_t MAX_RECV_BUFFER = 65536; public: - FtpConnection(int32_t cuid, const SharedHandle<SocketCore>& socket, + FtpConnection(cuid_t cuid, const SharedHandle<SocketCore>& socket, const SharedHandle<Request>& req, const SharedHandle<AuthConfig>& authConfig, const Option* op); diff --git a/src/FtpDownloadCommand.cc b/src/FtpDownloadCommand.cc index a1a9ec45..35e70560 100644 --- a/src/FtpDownloadCommand.cc +++ b/src/FtpDownloadCommand.cc @@ -48,7 +48,7 @@ namespace aria2 { FtpDownloadCommand::FtpDownloadCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpDownloadCommand.h b/src/FtpDownloadCommand.h index acc7bb92..194b0345 100644 --- a/src/FtpDownloadCommand.h +++ b/src/FtpDownloadCommand.h @@ -49,7 +49,7 @@ private: protected: virtual bool prepareForNextSegment(); public: - FtpDownloadCommand(int cuid, + FtpDownloadCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpFinishDownloadCommand.cc b/src/FtpFinishDownloadCommand.cc index 22f61bc5..d4beb6c8 100644 --- a/src/FtpFinishDownloadCommand.cc +++ b/src/FtpFinishDownloadCommand.cc @@ -52,7 +52,7 @@ namespace aria2 { FtpFinishDownloadCommand::FtpFinishDownloadCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpFinishDownloadCommand.h b/src/FtpFinishDownloadCommand.h index 261e12d0..81c02e26 100644 --- a/src/FtpFinishDownloadCommand.h +++ b/src/FtpFinishDownloadCommand.h @@ -49,7 +49,7 @@ protected: virtual bool executeInternal(); public: - FtpFinishDownloadCommand(int cuid, + FtpFinishDownloadCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpInitiateConnectionCommand.cc b/src/FtpInitiateConnectionCommand.cc index 2ec6720d..af3ee604 100644 --- a/src/FtpInitiateConnectionCommand.cc +++ b/src/FtpInitiateConnectionCommand.cc @@ -55,7 +55,7 @@ namespace aria2 { FtpInitiateConnectionCommand::FtpInitiateConnectionCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpInitiateConnectionCommand.h b/src/FtpInitiateConnectionCommand.h index ecc086d1..57f3ee7b 100644 --- a/src/FtpInitiateConnectionCommand.h +++ b/src/FtpInitiateConnectionCommand.h @@ -46,7 +46,7 @@ protected: const std::vector<std::string>& resolvedAddresses, const SharedHandle<Request>& proxyRequest); public: - FtpInitiateConnectionCommand(int cuid, const SharedHandle<Request>& req, + FtpInitiateConnectionCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e); diff --git a/src/FtpNegotiationCommand.cc b/src/FtpNegotiationCommand.cc index 53c373e0..31f956f6 100644 --- a/src/FtpNegotiationCommand.cc +++ b/src/FtpNegotiationCommand.cc @@ -69,7 +69,7 @@ namespace aria2 { FtpNegotiationCommand::FtpNegotiationCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpNegotiationCommand.h b/src/FtpNegotiationCommand.h index 04613733..6e829ca4 100644 --- a/src/FtpNegotiationCommand.h +++ b/src/FtpNegotiationCommand.h @@ -126,7 +126,7 @@ private: protected: virtual bool executeInternal(); public: - FtpNegotiationCommand(int32_t cuid, + FtpNegotiationCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpTunnelRequestCommand.cc b/src/FtpTunnelRequestCommand.cc index ae5f5c62..613e144d 100644 --- a/src/FtpTunnelRequestCommand.cc +++ b/src/FtpTunnelRequestCommand.cc @@ -41,7 +41,7 @@ namespace aria2 { FtpTunnelRequestCommand::FtpTunnelRequestCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpTunnelRequestCommand.h b/src/FtpTunnelRequestCommand.h index 7dd9d54e..369a3fdc 100644 --- a/src/FtpTunnelRequestCommand.h +++ b/src/FtpTunnelRequestCommand.h @@ -43,7 +43,7 @@ class SocketCore; class FtpTunnelRequestCommand : public AbstractProxyRequestCommand { public: - FtpTunnelRequestCommand(int cuid, + FtpTunnelRequestCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpTunnelResponseCommand.cc b/src/FtpTunnelResponseCommand.cc index 950f1510..61f85588 100644 --- a/src/FtpTunnelResponseCommand.cc +++ b/src/FtpTunnelResponseCommand.cc @@ -44,7 +44,7 @@ namespace aria2 { FtpTunnelResponseCommand::FtpTunnelResponseCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/FtpTunnelResponseCommand.h b/src/FtpTunnelResponseCommand.h index c0f7712b..558241f3 100644 --- a/src/FtpTunnelResponseCommand.h +++ b/src/FtpTunnelResponseCommand.h @@ -43,7 +43,7 @@ class SocketCore; class FtpTunnelResponseCommand : public AbstractProxyResponseCommand { public: - FtpTunnelResponseCommand(int cuid, + FtpTunnelResponseCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HaveEraseCommand.cc b/src/HaveEraseCommand.cc index 8fc8ea7a..d8e4fd47 100644 --- a/src/HaveEraseCommand.cc +++ b/src/HaveEraseCommand.cc @@ -41,7 +41,7 @@ namespace aria2 { -HaveEraseCommand::HaveEraseCommand(int32_t cuid, DownloadEngine* e, time_t interval) +HaveEraseCommand::HaveEraseCommand(cuid_t cuid, DownloadEngine* e, time_t interval) :TimeBasedCommand(cuid, e, interval, true) {} HaveEraseCommand::~HaveEraseCommand() {} diff --git a/src/HaveEraseCommand.h b/src/HaveEraseCommand.h index 5848f856..d3078057 100644 --- a/src/HaveEraseCommand.h +++ b/src/HaveEraseCommand.h @@ -42,7 +42,7 @@ namespace aria2 { class HaveEraseCommand : public TimeBasedCommand { public: - HaveEraseCommand(int32_t cuid, DownloadEngine* e, time_t interval); + HaveEraseCommand(cuid_t cuid, DownloadEngine* e, time_t interval); virtual ~HaveEraseCommand(); diff --git a/src/HttpConnection.cc b/src/HttpConnection.cc index f1aeb932..29f85210 100644 --- a/src/HttpConnection.cc +++ b/src/HttpConnection.cc @@ -65,7 +65,7 @@ HttpRequestEntry::HttpRequestEntry HttpRequestEntry::~HttpRequestEntry() {} -HttpConnection::HttpConnection(int32_t cuid, +HttpConnection::HttpConnection(cuid_t cuid, const SocketHandle& socket, const Option* op): cuid(cuid), socket(socket), diff --git a/src/HttpConnection.h b/src/HttpConnection.h index 7042310b..33f33839 100644 --- a/src/HttpConnection.h +++ b/src/HttpConnection.h @@ -42,6 +42,7 @@ #include "SharedHandle.h" #include "SocketBuffer.h" +#include "Command.h" namespace aria2 { @@ -78,7 +79,7 @@ typedef std::deque<HttpRequestEntryHandle> HttpRequestEntries; class HttpConnection { private: - int32_t cuid; + cuid_t cuid; SharedHandle<SocketCore> socket; SocketBuffer _socketBuffer; const Option* option; @@ -88,7 +89,7 @@ private: std::string eraseConfidentialInfo(const std::string& request); public: - HttpConnection(int32_t cuid, + HttpConnection(cuid_t cuid, const SharedHandle<SocketCore>& socket, const Option* op); diff --git a/src/HttpDownloadCommand.cc b/src/HttpDownloadCommand.cc index 74865327..20811f41 100644 --- a/src/HttpDownloadCommand.cc +++ b/src/HttpDownloadCommand.cc @@ -52,7 +52,7 @@ namespace aria2 { HttpDownloadCommand::HttpDownloadCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpDownloadCommand.h b/src/HttpDownloadCommand.h index 20d14586..31bb37e1 100644 --- a/src/HttpDownloadCommand.h +++ b/src/HttpDownloadCommand.h @@ -49,7 +49,7 @@ private: protected: virtual bool prepareForNextSegment(); public: - HttpDownloadCommand(int cuid, + HttpDownloadCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpInitiateConnectionCommand.cc b/src/HttpInitiateConnectionCommand.cc index 9f39ac8c..3f9a0975 100644 --- a/src/HttpInitiateConnectionCommand.cc +++ b/src/HttpInitiateConnectionCommand.cc @@ -52,7 +52,7 @@ namespace aria2 { HttpInitiateConnectionCommand::HttpInitiateConnectionCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpInitiateConnectionCommand.h b/src/HttpInitiateConnectionCommand.h index 6c8c400d..7d8c80d0 100644 --- a/src/HttpInitiateConnectionCommand.h +++ b/src/HttpInitiateConnectionCommand.h @@ -46,7 +46,7 @@ protected: const std::vector<std::string>& resolvedAddresses, const SharedHandle<Request>& proxyRequest); public: - HttpInitiateConnectionCommand(int cuid, const SharedHandle<Request>& req, + HttpInitiateConnectionCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e); diff --git a/src/HttpListenCommand.cc b/src/HttpListenCommand.cc index 2e85410f..eaaf2042 100644 --- a/src/HttpListenCommand.cc +++ b/src/HttpListenCommand.cc @@ -47,7 +47,7 @@ namespace aria2 { -HttpListenCommand::HttpListenCommand(int32_t cuid, DownloadEngine* e): +HttpListenCommand::HttpListenCommand(cuid_t cuid, DownloadEngine* e): Command(cuid),_e(e) {} HttpListenCommand::~HttpListenCommand() diff --git a/src/HttpListenCommand.h b/src/HttpListenCommand.h index ee77b296..f56babcc 100644 --- a/src/HttpListenCommand.h +++ b/src/HttpListenCommand.h @@ -48,7 +48,7 @@ private: DownloadEngine* _e; SharedHandle<SocketCore> _serverSocket; public: - HttpListenCommand(int32_t cuid, DownloadEngine* e); + HttpListenCommand(cuid_t cuid, DownloadEngine* e); virtual ~HttpListenCommand(); diff --git a/src/HttpProxyRequestCommand.cc b/src/HttpProxyRequestCommand.cc index 92bf3d29..677c0bda 100644 --- a/src/HttpProxyRequestCommand.cc +++ b/src/HttpProxyRequestCommand.cc @@ -41,7 +41,7 @@ namespace aria2 { HttpProxyRequestCommand::HttpProxyRequestCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpProxyRequestCommand.h b/src/HttpProxyRequestCommand.h index 3e28645e..6b153fd2 100644 --- a/src/HttpProxyRequestCommand.h +++ b/src/HttpProxyRequestCommand.h @@ -43,7 +43,7 @@ class SocketCore; class HttpProxyRequestCommand : public AbstractProxyRequestCommand { public: - HttpProxyRequestCommand(int cuid, + HttpProxyRequestCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpProxyResponseCommand.cc b/src/HttpProxyResponseCommand.cc index eb842f98..efcb809d 100644 --- a/src/HttpProxyResponseCommand.cc +++ b/src/HttpProxyResponseCommand.cc @@ -44,7 +44,7 @@ namespace aria2 { HttpProxyResponseCommand::HttpProxyResponseCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpProxyResponseCommand.h b/src/HttpProxyResponseCommand.h index 6fba8441..41e2263d 100644 --- a/src/HttpProxyResponseCommand.h +++ b/src/HttpProxyResponseCommand.h @@ -43,7 +43,7 @@ class SocketCore; class HttpProxyResponseCommand : public AbstractProxyResponseCommand { public: - HttpProxyResponseCommand(int cuid, + HttpProxyResponseCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc index 39f6f17c..407b0c38 100644 --- a/src/HttpRequestCommand.cc +++ b/src/HttpRequestCommand.cc @@ -57,7 +57,7 @@ namespace aria2 { HttpRequestCommand::HttpRequestCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpRequestCommand.h b/src/HttpRequestCommand.h index ccfd5f69..5b1166bc 100644 --- a/src/HttpRequestCommand.h +++ b/src/HttpRequestCommand.h @@ -54,7 +54,7 @@ private: protected: virtual bool executeInternal(); public: - HttpRequestCommand(int cuid, + HttpRequestCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpResponse.h b/src/HttpResponse.h index 693a332b..e9997dea 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -41,6 +41,7 @@ #include "SharedHandle.h" #include "TimeA2.h" +#include "Command.h" namespace aria2 { @@ -51,7 +52,7 @@ class Decoder; class HttpResponse { private: - int32_t cuid; + cuid_t cuid; SharedHandle<HttpRequest> httpRequest; SharedHandle<HttpHeader> httpHeader; Logger* logger; @@ -116,7 +117,7 @@ public: return httpRequest; } - void setCuid(int32_t cuid) + void setCuid(cuid_t cuid) { this->cuid = cuid; } diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index c6c8f5ac..9dede630 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -76,7 +76,7 @@ static SharedHandle<Decoder> getContentEncodingDecoder (const SharedHandle<HttpResponse>& httpResponse); HttpResponseCommand::HttpResponseCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpResponseCommand.h b/src/HttpResponseCommand.h index 2e43ac81..20371905 100644 --- a/src/HttpResponseCommand.h +++ b/src/HttpResponseCommand.h @@ -73,7 +73,7 @@ protected: (const SharedHandle<HttpResponse>& httpResponse); public: - HttpResponseCommand(int32_t cuid, + HttpResponseCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpServerBodyCommand.cc b/src/HttpServerBodyCommand.cc index 8bb7f11b..37fc3115 100644 --- a/src/HttpServerBodyCommand.cc +++ b/src/HttpServerBodyCommand.cc @@ -55,7 +55,7 @@ namespace aria2 { HttpServerBodyCommand::HttpServerBodyCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<HttpServer>& httpServer, DownloadEngine* e, const SharedHandle<SocketCore>& socket): diff --git a/src/HttpServerBodyCommand.h b/src/HttpServerBodyCommand.h index b3276ac2..1e5c3834 100644 --- a/src/HttpServerBodyCommand.h +++ b/src/HttpServerBodyCommand.h @@ -52,7 +52,7 @@ private: SharedHandle<HttpServer> _httpServer; Time _timeout; public: - HttpServerBodyCommand(int32_t cuid, + HttpServerBodyCommand(cuid_t cuid, const SharedHandle<HttpServer>& httpServer, DownloadEngine* e, const SharedHandle<SocketCore>& socket); diff --git a/src/HttpServerCommand.cc b/src/HttpServerCommand.cc index f005fc61..2f1c8fd0 100644 --- a/src/HttpServerCommand.cc +++ b/src/HttpServerCommand.cc @@ -51,7 +51,7 @@ namespace aria2 { -HttpServerCommand::HttpServerCommand(int32_t cuid, DownloadEngine* e, +HttpServerCommand::HttpServerCommand(cuid_t cuid, DownloadEngine* e, const SharedHandle<SocketCore>& socket): Command(cuid), _e(e), @@ -69,7 +69,7 @@ HttpServerCommand::HttpServerCommand(int32_t cuid, DownloadEngine* e, #endif // !HAVE_LIBZ } -HttpServerCommand::HttpServerCommand(int32_t cuid, +HttpServerCommand::HttpServerCommand(cuid_t cuid, const SharedHandle<HttpServer>& httpServer, DownloadEngine* e, const SharedHandle<SocketCore>& socket): diff --git a/src/HttpServerCommand.h b/src/HttpServerCommand.h index 65a378e7..09181f80 100644 --- a/src/HttpServerCommand.h +++ b/src/HttpServerCommand.h @@ -52,10 +52,10 @@ private: SharedHandle<HttpServer> _httpServer; Time _timeout; public: - HttpServerCommand(int32_t cuid, DownloadEngine* e, + HttpServerCommand(cuid_t cuid, DownloadEngine* e, const SharedHandle<SocketCore>& socket); - HttpServerCommand(int32_t cuid, + HttpServerCommand(cuid_t cuid, const SharedHandle<HttpServer>& httpServer, DownloadEngine* e, const SharedHandle<SocketCore>& socket); diff --git a/src/HttpServerResponseCommand.cc b/src/HttpServerResponseCommand.cc index 337e7c35..a88580b4 100644 --- a/src/HttpServerResponseCommand.cc +++ b/src/HttpServerResponseCommand.cc @@ -46,7 +46,7 @@ namespace aria2 { HttpServerResponseCommand::HttpServerResponseCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<HttpServer>& httpServer, DownloadEngine* e, const SharedHandle<SocketCore>& socket): diff --git a/src/HttpServerResponseCommand.h b/src/HttpServerResponseCommand.h index c1fbc9de..7fc0eaca 100644 --- a/src/HttpServerResponseCommand.h +++ b/src/HttpServerResponseCommand.h @@ -52,7 +52,7 @@ private: SharedHandle<HttpServer> _httpServer; Time _timeout; public: - HttpServerResponseCommand(int32_t cuid, + HttpServerResponseCommand(cuid_t cuid, const SharedHandle<HttpServer>& httpServer, DownloadEngine* e, const SharedHandle<SocketCore>& socket); diff --git a/src/HttpSkipResponseCommand.cc b/src/HttpSkipResponseCommand.cc index 4915e64a..24963d05 100644 --- a/src/HttpSkipResponseCommand.cc +++ b/src/HttpSkipResponseCommand.cc @@ -58,7 +58,7 @@ namespace aria2 { HttpSkipResponseCommand::HttpSkipResponseCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/HttpSkipResponseCommand.h b/src/HttpSkipResponseCommand.h index 1109f389..8de62fd0 100644 --- a/src/HttpSkipResponseCommand.h +++ b/src/HttpSkipResponseCommand.h @@ -61,7 +61,7 @@ private: protected: virtual bool executeInternal(); public: - HttpSkipResponseCommand(int cuid, + HttpSkipResponseCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/InitiateConnectionCommand.cc b/src/InitiateConnectionCommand.cc index b32184c8..3e2074ff 100644 --- a/src/InitiateConnectionCommand.cc +++ b/src/InitiateConnectionCommand.cc @@ -52,7 +52,7 @@ namespace aria2 { InitiateConnectionCommand::InitiateConnectionCommand -(int cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/InitiateConnectionCommand.h b/src/InitiateConnectionCommand.h index 7c326786..1e25da89 100644 --- a/src/InitiateConnectionCommand.h +++ b/src/InitiateConnectionCommand.h @@ -60,7 +60,7 @@ protected: const std::vector<std::string>& resolvedAddresses, const SharedHandle<Request>& proxyRequest) = 0; public: - InitiateConnectionCommand(int cuid, const SharedHandle<Request>& req, + InitiateConnectionCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e); diff --git a/src/InitiateConnectionCommandFactory.cc b/src/InitiateConnectionCommandFactory.cc index d9512197..cff833fc 100644 --- a/src/InitiateConnectionCommandFactory.cc +++ b/src/InitiateConnectionCommandFactory.cc @@ -49,7 +49,7 @@ namespace aria2 { Command* InitiateConnectionCommandFactory::createInitiateConnectionCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/InitiateConnectionCommandFactory.h b/src/InitiateConnectionCommandFactory.h index 936df12f..97cc16f5 100644 --- a/src/InitiateConnectionCommandFactory.h +++ b/src/InitiateConnectionCommandFactory.h @@ -37,19 +37,19 @@ #include "common.h" #include "SharedHandle.h" +#include "Command.h" namespace aria2 { class Request; class RequestGroup; class DownloadEngine; -class Command; class FileEntry; class InitiateConnectionCommandFactory { public: static Command* - createInitiateConnectionCommand(int32_t cuid, + createInitiateConnectionCommand(cuid_t cuid, const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, diff --git a/src/InitiatorMSEHandshakeCommand.cc b/src/InitiatorMSEHandshakeCommand.cc index 893c4405..de4c20c0 100644 --- a/src/InitiatorMSEHandshakeCommand.cc +++ b/src/InitiatorMSEHandshakeCommand.cc @@ -57,7 +57,7 @@ namespace aria2 { InitiatorMSEHandshakeCommand::InitiatorMSEHandshakeCommand -(int32_t cuid, +(cuid_t cuid, RequestGroup* requestGroup, const SharedHandle<Peer>& p, DownloadEngine* e, diff --git a/src/InitiatorMSEHandshakeCommand.h b/src/InitiatorMSEHandshakeCommand.h index 8edd05fb..0d0d381d 100644 --- a/src/InitiatorMSEHandshakeCommand.h +++ b/src/InitiatorMSEHandshakeCommand.h @@ -77,7 +77,7 @@ protected: virtual bool exitBeforeExecute(); public: InitiatorMSEHandshakeCommand - (int32_t cuid, + (cuid_t cuid, RequestGroup* requestGroup, const SharedHandle<Peer>& peer, DownloadEngine* e, diff --git a/src/LpdDispatchMessageCommand.cc b/src/LpdDispatchMessageCommand.cc index b469935d..50cd94fb 100644 --- a/src/LpdDispatchMessageCommand.cc +++ b/src/LpdDispatchMessageCommand.cc @@ -44,7 +44,7 @@ namespace aria2 { LpdDispatchMessageCommand::LpdDispatchMessageCommand -(int cuid, +(cuid_t cuid, const SharedHandle<LpdMessageDispatcher>& dispatcher, DownloadEngine* e): Command(cuid), diff --git a/src/LpdDispatchMessageCommand.h b/src/LpdDispatchMessageCommand.h index 4e4708e0..15b0aab7 100644 --- a/src/LpdDispatchMessageCommand.h +++ b/src/LpdDispatchMessageCommand.h @@ -52,7 +52,7 @@ private: SharedHandle<BtRuntime> _btRuntime; public: LpdDispatchMessageCommand - (int cuid, + (cuid_t cuid, const SharedHandle<LpdMessageDispatcher>& dispatcher, DownloadEngine* e); diff --git a/src/LpdReceiveMessageCommand.cc b/src/LpdReceiveMessageCommand.cc index f3297f90..ac16b06d 100644 --- a/src/LpdReceiveMessageCommand.cc +++ b/src/LpdReceiveMessageCommand.cc @@ -57,7 +57,7 @@ unsigned int LpdReceiveMessageCommand::__numInstance = 0; LpdReceiveMessageCommand* LpdReceiveMessageCommand::__instance = 0; LpdReceiveMessageCommand::LpdReceiveMessageCommand -(int32_t cuid, const SharedHandle<LpdMessageReceiver>& receiver, +(cuid_t cuid, const SharedHandle<LpdMessageReceiver>& receiver, DownloadEngine* e):Command(cuid), _receiver(receiver), _e(e) { _e->addSocketForReadCheck(_receiver->getSocket(), this); diff --git a/src/LpdReceiveMessageCommand.h b/src/LpdReceiveMessageCommand.h index 5c2706d3..28f9a248 100644 --- a/src/LpdReceiveMessageCommand.h +++ b/src/LpdReceiveMessageCommand.h @@ -53,7 +53,7 @@ private: static LpdReceiveMessageCommand* __instance; LpdReceiveMessageCommand - (int32_t cuid, const SharedHandle<LpdMessageReceiver>& receiver, + (cuid_t cuid, const SharedHandle<LpdMessageReceiver>& receiver, DownloadEngine* e); protected: DownloadEngine* _e; diff --git a/src/MSEHandshake.cc b/src/MSEHandshake.cc index 3ee612d3..a788f513 100644 --- a/src/MSEHandshake.cc +++ b/src/MSEHandshake.cc @@ -64,7 +64,7 @@ const unsigned char* MSEHandshake::GENERATOR = reinterpret_cast<const unsigned c const unsigned char MSEHandshake::VC[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -MSEHandshake::MSEHandshake(int32_t cuid, +MSEHandshake::MSEHandshake(cuid_t cuid, const SocketHandle& socket, const Option* op): _cuid(cuid), diff --git a/src/MSEHandshake.h b/src/MSEHandshake.h index 8ce66386..17d2e4a5 100644 --- a/src/MSEHandshake.h +++ b/src/MSEHandshake.h @@ -42,6 +42,7 @@ #include "SharedHandle.h" #include "BtConstants.h" #include "SocketBuffer.h" +#include "Command.h" namespace aria2 { @@ -80,7 +81,7 @@ private: static const size_t MAX_BUFFER_LENGTH = 6*1024; - int32_t _cuid; + cuid_t _cuid; SharedHandle<SocketCore> _socket; const Option* _option; Logger* _logger; @@ -132,7 +133,7 @@ private: size_t receiveNBytes(size_t bytes); public: - MSEHandshake(int32_t cuid, const SharedHandle<SocketCore>& socket, + MSEHandshake(cuid_t cuid, const SharedHandle<SocketCore>& socket, const Option* op); ~MSEHandshake(); diff --git a/src/Peer.cc b/src/Peer.cc index 61ab9195..ee2014a9 100644 --- a/src/Peer.cc +++ b/src/Peer.cc @@ -67,7 +67,7 @@ Peer::~Peer() releaseSessionResource(); } -void Peer::usedBy(int32_t cuid) +void Peer::usedBy(cuid_t cuid) { _cuid = cuid; } @@ -47,6 +47,7 @@ #include "BtConstants.h" #include "PeerStat.h" #include "a2functional.h" +#include "Command.h" namespace aria2 { @@ -63,7 +64,7 @@ public: private: std::string id; - int32_t _cuid; + cuid_t _cuid; unsigned char _peerId[PEER_ID_LENGTH]; @@ -102,9 +103,9 @@ public: void resetStatus(); - void usedBy(int32_t cuid); + void usedBy(cuid_t cuid); - int32_t usedBy() const + cuid_t usedBy() const { return _cuid; } diff --git a/src/PeerAbstractCommand.cc b/src/PeerAbstractCommand.cc index 0d3c8413..f8d55094 100644 --- a/src/PeerAbstractCommand.cc +++ b/src/PeerAbstractCommand.cc @@ -47,7 +47,7 @@ namespace aria2 { -PeerAbstractCommand::PeerAbstractCommand(int32_t cuid, +PeerAbstractCommand::PeerAbstractCommand(cuid_t cuid, const SharedHandle<Peer>& peer, DownloadEngine* e, const SocketHandle& s): diff --git a/src/PeerAbstractCommand.h b/src/PeerAbstractCommand.h index 06c5f8a0..f8618b7a 100644 --- a/src/PeerAbstractCommand.h +++ b/src/PeerAbstractCommand.h @@ -76,7 +76,7 @@ private: SharedHandle<SocketCore> writeCheckTarget; bool noCheck; public: - PeerAbstractCommand(int32_t cuid, + PeerAbstractCommand(cuid_t cuid, const SharedHandle<Peer>& peer, DownloadEngine* e, const SharedHandle<SocketCore>& s = diff --git a/src/PeerChokeCommand.cc b/src/PeerChokeCommand.cc index 53c41f05..bd4a502c 100644 --- a/src/PeerChokeCommand.cc +++ b/src/PeerChokeCommand.cc @@ -39,7 +39,7 @@ namespace aria2 { -PeerChokeCommand::PeerChokeCommand(int32_t cuid, +PeerChokeCommand::PeerChokeCommand(cuid_t cuid, DownloadEngine* e): Command(cuid), e(e) {} diff --git a/src/PeerChokeCommand.h b/src/PeerChokeCommand.h index c10a38cf..ab9f59ec 100644 --- a/src/PeerChokeCommand.h +++ b/src/PeerChokeCommand.h @@ -52,7 +52,7 @@ private: SharedHandle<BtRuntime> _btRuntime; public: - PeerChokeCommand(int32_t cuid, + PeerChokeCommand(cuid_t cuid, DownloadEngine* e); virtual ~PeerChokeCommand(); diff --git a/src/PeerConnection.cc b/src/PeerConnection.cc index 5d475722..c16802ba 100644 --- a/src/PeerConnection.cc +++ b/src/PeerConnection.cc @@ -51,7 +51,7 @@ namespace aria2 { -PeerConnection::PeerConnection(int32_t cuid, const SocketHandle& socket) +PeerConnection::PeerConnection(cuid_t cuid, const SocketHandle& socket) :cuid(cuid), socket(socket), diff --git a/src/PeerConnection.h b/src/PeerConnection.h index 46719e66..5a51189e 100644 --- a/src/PeerConnection.h +++ b/src/PeerConnection.h @@ -41,6 +41,7 @@ #include "SharedHandle.h" #include "SocketBuffer.h" +#include "Command.h" namespace aria2 { @@ -55,7 +56,7 @@ class ARC4Decryptor; class PeerConnection { private: - int32_t cuid; + cuid_t cuid; SharedHandle<SocketCore> socket; Logger* logger; @@ -78,7 +79,7 @@ private: ssize_t sendData(const unsigned char* data, size_t length, bool encryption); public: - PeerConnection(int32_t cuid, const SharedHandle<SocketCore>& socket); + PeerConnection(cuid_t cuid, const SharedHandle<SocketCore>& socket); ~PeerConnection(); diff --git a/src/PeerInitiateConnectionCommand.cc b/src/PeerInitiateConnectionCommand.cc index c6e783e9..7e7d8445 100644 --- a/src/PeerInitiateConnectionCommand.cc +++ b/src/PeerInitiateConnectionCommand.cc @@ -52,7 +52,7 @@ namespace aria2 { PeerInitiateConnectionCommand::PeerInitiateConnectionCommand -(int cuid, +(cuid_t cuid, RequestGroup* requestGroup, const SharedHandle<Peer>& peer, DownloadEngine* e, diff --git a/src/PeerInitiateConnectionCommand.h b/src/PeerInitiateConnectionCommand.h index b72cb1bd..6b824da9 100644 --- a/src/PeerInitiateConnectionCommand.h +++ b/src/PeerInitiateConnectionCommand.h @@ -62,7 +62,7 @@ protected: virtual bool exitBeforeExecute(); public: - PeerInitiateConnectionCommand(int cuid, + PeerInitiateConnectionCommand(cuid_t cuid, RequestGroup* requestGroup, const SharedHandle<Peer>& peer, DownloadEngine* e, diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index 23274a78..c6128a21 100644 --- a/src/PeerInteractionCommand.cc +++ b/src/PeerInteractionCommand.cc @@ -76,7 +76,7 @@ namespace aria2 { PeerInteractionCommand::PeerInteractionCommand -(int32_t cuid, +(cuid_t cuid, RequestGroup* requestGroup, const SharedHandle<Peer>& p, DownloadEngine* e, diff --git a/src/PeerInteractionCommand.h b/src/PeerInteractionCommand.h index 4c65c34c..ad72c697 100644 --- a/src/PeerInteractionCommand.h +++ b/src/PeerInteractionCommand.h @@ -74,7 +74,7 @@ protected: virtual void onFailure(); virtual bool exitBeforeExecute(); public: - PeerInteractionCommand(int32_t cuid, + PeerInteractionCommand(cuid_t cuid, RequestGroup* requestGroup, const SharedHandle<Peer>& peer, DownloadEngine* e, diff --git a/src/PeerListenCommand.cc b/src/PeerListenCommand.cc index c3ee46b8..cf2b38fd 100644 --- a/src/PeerListenCommand.cc +++ b/src/PeerListenCommand.cc @@ -54,7 +54,7 @@ unsigned int PeerListenCommand::__numInstance = 0; PeerListenCommand* PeerListenCommand::__instance = 0; -PeerListenCommand::PeerListenCommand(int32_t cuid, DownloadEngine* e): +PeerListenCommand::PeerListenCommand(cuid_t cuid, DownloadEngine* e): Command(cuid), e(e), _lowestSpeedLimit(20*1024) @@ -120,7 +120,7 @@ bool PeerListenCommand::execute() { peerSocket->setNonBlockingMode(); SharedHandle<Peer> peer(new Peer(peerInfo.first, peerInfo.second, true)); - int32_t cuid = e->newCUID(); + cuid_t cuid = e->newCUID(); Command* command = new ReceiverMSEHandshakeCommand(cuid, peer, e, peerSocket); e->commands.push_back(command); diff --git a/src/PeerListenCommand.h b/src/PeerListenCommand.h index 1af4d295..f800f7ff 100644 --- a/src/PeerListenCommand.h +++ b/src/PeerListenCommand.h @@ -55,7 +55,7 @@ private: static PeerListenCommand* __instance; public: - PeerListenCommand(int32_t cuid, DownloadEngine* e); + PeerListenCommand(cuid_t cuid, DownloadEngine* e); virtual ~PeerListenCommand(); diff --git a/src/PeerReceiveHandshakeCommand.cc b/src/PeerReceiveHandshakeCommand.cc index 31299bc7..b43e3097 100644 --- a/src/PeerReceiveHandshakeCommand.cc +++ b/src/PeerReceiveHandshakeCommand.cc @@ -60,7 +60,7 @@ namespace aria2 { PeerReceiveHandshakeCommand::PeerReceiveHandshakeCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<Peer>& peer, DownloadEngine* e, const SocketHandle& s, diff --git a/src/PeerReceiveHandshakeCommand.h b/src/PeerReceiveHandshakeCommand.h index 884b9984..70bad064 100644 --- a/src/PeerReceiveHandshakeCommand.h +++ b/src/PeerReceiveHandshakeCommand.h @@ -52,7 +52,7 @@ protected: virtual bool exitBeforeExecute(); public: PeerReceiveHandshakeCommand - (int32_t cuid, + (cuid_t cuid, const SharedHandle<Peer>& peer, DownloadEngine* e, const SharedHandle<SocketCore>& s, diff --git a/src/PieceStorage.h b/src/PieceStorage.h index 6934b39e..0c30139d 100644 --- a/src/PieceStorage.h +++ b/src/PieceStorage.h @@ -42,6 +42,7 @@ #include "SharedHandle.h" #include "TimeA2.h" +#include "Command.h" namespace aria2 { @@ -198,14 +199,14 @@ public: * Adds piece index to advertise to other commands. They send have message * based on this information. */ - virtual void advertisePiece(int32_t cuid, size_t index) = 0; + virtual void advertisePiece(cuid_t cuid, size_t index) = 0; /** * indexes is filled with piece index which is not advertised by the caller * command and newer than lastCheckTime. */ virtual void getAdvertisedPieceIndexes(std::vector<size_t>& indexes, - int32_t myCuid, + cuid_t myCuid, const Time& lastCheckTime) = 0; /** diff --git a/src/RealtimeCommand.cc b/src/RealtimeCommand.cc index 28b325fb..210258d3 100644 --- a/src/RealtimeCommand.cc +++ b/src/RealtimeCommand.cc @@ -40,7 +40,7 @@ namespace aria2 { -RealtimeCommand::RealtimeCommand(int cuid, RequestGroup* requestGroup, +RealtimeCommand::RealtimeCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e): Command(cuid), _requestGroup(requestGroup), diff --git a/src/RealtimeCommand.h b/src/RealtimeCommand.h index 1d465320..34b9f635 100644 --- a/src/RealtimeCommand.h +++ b/src/RealtimeCommand.h @@ -48,7 +48,7 @@ protected: RequestGroup* _requestGroup; DownloadEngine* _e; public: - RealtimeCommand(int cuid, RequestGroup* requestGroup, DownloadEngine* e); + RealtimeCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e); virtual ~RealtimeCommand(); diff --git a/src/ReceiverMSEHandshakeCommand.cc b/src/ReceiverMSEHandshakeCommand.cc index 5cc71438..43498acb 100644 --- a/src/ReceiverMSEHandshakeCommand.cc +++ b/src/ReceiverMSEHandshakeCommand.cc @@ -59,7 +59,7 @@ namespace aria2 { ReceiverMSEHandshakeCommand::ReceiverMSEHandshakeCommand -(int32_t cuid, +(cuid_t cuid, const SharedHandle<Peer>& peer, DownloadEngine* e, const SharedHandle<SocketCore>& s): diff --git a/src/ReceiverMSEHandshakeCommand.h b/src/ReceiverMSEHandshakeCommand.h index 2d07b616..925c7a7c 100644 --- a/src/ReceiverMSEHandshakeCommand.h +++ b/src/ReceiverMSEHandshakeCommand.h @@ -67,7 +67,7 @@ protected: virtual bool executeInternal(); virtual bool exitBeforeExecute(); public: - ReceiverMSEHandshakeCommand(int32_t cuid, + ReceiverMSEHandshakeCommand(cuid_t cuid, const SharedHandle<Peer>& peer, DownloadEngine* e, const SharedHandle<SocketCore>& s); diff --git a/src/SeedCheckCommand.cc b/src/SeedCheckCommand.cc index f254658a..4d56d3f0 100644 --- a/src/SeedCheckCommand.cc +++ b/src/SeedCheckCommand.cc @@ -45,7 +45,7 @@ namespace aria2 { SeedCheckCommand::SeedCheckCommand -(int cuid, +(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<SeedCriteria>& seedCriteria) diff --git a/src/SeedCheckCommand.h b/src/SeedCheckCommand.h index 43c0592b..daaa02de 100644 --- a/src/SeedCheckCommand.h +++ b/src/SeedCheckCommand.h @@ -56,7 +56,7 @@ private: SharedHandle<SeedCriteria> seedCriteria; bool checkStarted; public: - SeedCheckCommand(int cuid, + SeedCheckCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<SeedCriteria>& seedCriteria); diff --git a/src/SequentialDispatcherCommand.h b/src/SequentialDispatcherCommand.h index e7de64fd..7128af16 100644 --- a/src/SequentialDispatcherCommand.h +++ b/src/SequentialDispatcherCommand.h @@ -52,7 +52,7 @@ protected: DownloadEngine* _e; public: - SequentialDispatcherCommand(int32_t cuid, + SequentialDispatcherCommand(cuid_t cuid, const SharedHandle<SequentialPicker<T> >& picker, DownloadEngine* e): Command(cuid), _picker(picker), _e(e) diff --git a/src/SleepCommand.cc b/src/SleepCommand.cc index 1c22385d..dca19457 100644 --- a/src/SleepCommand.cc +++ b/src/SleepCommand.cc @@ -40,7 +40,7 @@ namespace aria2 { -SleepCommand::SleepCommand(int32_t cuid, DownloadEngine* e, +SleepCommand::SleepCommand(cuid_t cuid, DownloadEngine* e, RequestGroup* requestGroup, Command* nextCommand, time_t wait): Command(cuid), engine(e), _requestGroup(requestGroup), diff --git a/src/SleepCommand.h b/src/SleepCommand.h index 4e279a99..0bf80ef8 100644 --- a/src/SleepCommand.h +++ b/src/SleepCommand.h @@ -51,7 +51,7 @@ private: time_t wait; Time checkPoint; public: - SleepCommand(int32_t cuid, DownloadEngine* e, RequestGroup* requestGroup, + SleepCommand(cuid_t cuid, DownloadEngine* e, RequestGroup* requestGroup, Command* nextCommand, time_t wait); virtual ~SleepCommand(); bool execute(); diff --git a/src/TimeBasedCommand.cc b/src/TimeBasedCommand.cc index 23ee5248..cfd7f2d2 100644 --- a/src/TimeBasedCommand.cc +++ b/src/TimeBasedCommand.cc @@ -38,7 +38,7 @@ namespace aria2 { -TimeBasedCommand::TimeBasedCommand(int32_t cuid, DownloadEngine* e, +TimeBasedCommand::TimeBasedCommand(cuid_t cuid, DownloadEngine* e, time_t interval, bool routineCommand): Command(cuid), _e(e),_exit(false), _interval(interval), diff --git a/src/TimeBasedCommand.h b/src/TimeBasedCommand.h index 625b547e..f08a9af1 100644 --- a/src/TimeBasedCommand.h +++ b/src/TimeBasedCommand.h @@ -79,7 +79,7 @@ public: virtual void postProcess() {}; public: - TimeBasedCommand(int32_t cuid, DownloadEngine* e, time_t interval, + TimeBasedCommand(cuid_t cuid, DownloadEngine* e, time_t interval, bool routineCommand = false); virtual ~TimeBasedCommand(); diff --git a/src/TimedHaltCommand.cc b/src/TimedHaltCommand.cc index 334f331e..f4ccff1b 100644 --- a/src/TimedHaltCommand.cc +++ b/src/TimedHaltCommand.cc @@ -41,7 +41,7 @@ namespace aria2 { -TimedHaltCommand::TimedHaltCommand(int32_t cuid, DownloadEngine* e, +TimedHaltCommand::TimedHaltCommand(cuid_t cuid, DownloadEngine* e, time_t secondsToHalt): TimeBasedCommand(cuid, e, secondsToHalt, true) {} diff --git a/src/TimedHaltCommand.h b/src/TimedHaltCommand.h index 89352107..fe7880ab 100644 --- a/src/TimedHaltCommand.h +++ b/src/TimedHaltCommand.h @@ -41,7 +41,7 @@ namespace aria2 { class TimedHaltCommand:public TimeBasedCommand { public: - TimedHaltCommand(int32_t cuid, DownloadEngine* e, time_t secondsToHalt); + TimedHaltCommand(cuid_t cuid, DownloadEngine* e, time_t secondsToHalt); virtual ~TimedHaltCommand(); diff --git a/src/TrackerWatcherCommand.cc b/src/TrackerWatcherCommand.cc index f9875b0b..b3b14f39 100644 --- a/src/TrackerWatcherCommand.cc +++ b/src/TrackerWatcherCommand.cc @@ -64,7 +64,7 @@ namespace aria2 { TrackerWatcherCommand::TrackerWatcherCommand -(int32_t cuid, RequestGroup* requestGroup, DownloadEngine* e): +(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e): Command(cuid), _requestGroup(requestGroup), e(e) diff --git a/src/TrackerWatcherCommand.h b/src/TrackerWatcherCommand.h index 1e9f2b8c..5c2ec716 100644 --- a/src/TrackerWatcherCommand.h +++ b/src/TrackerWatcherCommand.h @@ -76,7 +76,7 @@ private: const SharedHandle<Option>& getOption() const; public: - TrackerWatcherCommand(int32_t cuid, + TrackerWatcherCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e); diff --git a/src/UnknownLengthPieceStorage.h b/src/UnknownLengthPieceStorage.h index 3c9cfaf1..9015689d 100644 --- a/src/UnknownLengthPieceStorage.h +++ b/src/UnknownLengthPieceStorage.h @@ -221,7 +221,7 @@ public: * Adds piece index to advertise to other commands. They send have message * based on this information. */ - virtual void advertisePiece(int32_t cuid, size_t index) {} + virtual void advertisePiece(cuid_t cuid, size_t index) {} /** * Returns piece index which is not advertised by the caller command and @@ -229,7 +229,7 @@ public: */ virtual void getAdvertisedPieceIndexes(std::vector<size_t>& indexes, - int32_t myCuid, const Time& lastCheckTime) + cuid_t myCuid, const Time& lastCheckTime) {} /** |
