/* */ #ifndef _D_BT_STOP_DOWNLOAD_COMMAND_H_ #define _D_BT_STOP_DOWNLOAD_COMMAND_H_ #include "TimeBasedCommand.h" #include "SharedHandle.h" namespace aria2 { class RequestGroup; class PieceStorage; class BtRuntime; // Stop downloading torrent if in consecutive _timeout seconds, // download speed is zero and the number of seeder is 0. class BtStopDownloadCommand:public TimeBasedCommand { private: RequestGroup* _requestGroup; time_t _timeout; Time _checkPoint; SharedHandle _btRuntime; SharedHandle _pieceStorage; public: BtStopDownloadCommand (int32_t cuid, RequestGroup* requestGroup, DownloadEngine* e, time_t timeout); virtual void preProcess(); virtual void process(); void setBtRuntime(const SharedHandle& btRuntime) { _btRuntime = btRuntime; } void setPieceStorage(const SharedHandle& pieceStorage) { _pieceStorage = pieceStorage; } }; } // namespace aria2 #endif // _D_BT_STOP_DOWNLOAD_COMMAND_H_