/* */ #ifndef D_ABSTRACT_HTTP_SERVER_RESPONSE_COMMAND_H #define D_ABSTRACT_HTTP_SERVER_RESPONSE_COMMAND_H #include "Command.h" #include #include "TimerA2.h" namespace aria2 { class DownloadEngine; class SocketCore; class HttpServer; class AbstractHttpServerResponseCommand : public Command { private: DownloadEngine* e_; std::shared_ptr socket_; std::shared_ptr httpServer_; Timer timeoutTimer_; bool readCheck_; bool writeCheck_; void updateReadWriteCheck(); protected: DownloadEngine* getDownloadEngine() { return e_; } // Called after content body is completely sent. virtual void afterSend(const std::shared_ptr& httpServer, DownloadEngine* e) = 0; public: AbstractHttpServerResponseCommand(cuid_t cuid, const std::shared_ptr& httpServer, DownloadEngine* e, const std::shared_ptr& socket); virtual ~AbstractHttpServerResponseCommand(); virtual bool execute() CXX11_OVERRIDE; }; } // namespace aria2 #endif // D_ABSTRACT_HTTP_SERVER_RESPONSE_COMMAND_H