/* */ #ifndef _D_DOWNLOAD_COMMAND_H_ #define _D_DOWNLOAD_COMMAND_H_ #include "AbstractCommand.h" namespace aria2 { class TransferEncoding; class PeerStat; #ifdef ENABLE_MESSAGE_DIGEST class MessageDigestContext; #endif // ENABLE_MESSAGE_DIGEST class DownloadCommand : public AbstractCommand { private: unsigned int maxDownloadSpeedLimit; time_t startupIdleTime; unsigned int lowestDownloadSpeedLimit; SharedHandle peerStat; #ifdef ENABLE_MESSAGE_DIGEST MessageDigestContext* _messageDigestContext; #endif // ENABLE_MESSAGE_DIGEST void validatePieceHash(const SharedHandle& segment); void checkLowestDownloadSpeed() const; protected: SharedHandle transferDecoder; virtual bool executeInternal(); virtual bool prepareForNextSegment(); public: DownloadCommand(int cuid, const SharedHandle& req, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle& s); virtual ~DownloadCommand(); void setTransferDecoder(const SharedHandle& transferDecoder); void setMaxDownloadSpeedLimit(unsigned int maxDownloadSpeedLimit) { this->maxDownloadSpeedLimit = maxDownloadSpeedLimit; } void setStartupIdleTime(time_t startupIdleTime) { this->startupIdleTime = startupIdleTime; } void setLowestDownloadSpeedLimit(unsigned int lowestDownloadSpeedLimit) { this->lowestDownloadSpeedLimit = lowestDownloadSpeedLimit; } }; } // namespace aria2 #endif // _D_DOWNLOAD_COMMAND_H_