From f4e2c7f0603fdb0609bf163ee5ea683a44b98d69 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 20 Mar 2012 21:42:09 +0900 Subject: Added JSON-RPC over WebSocket. Wslay library must be placed under deps/wslay. --- src/AbstractHttpServerResponseCommand.h | 75 +++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/AbstractHttpServerResponseCommand.h (limited to 'src/AbstractHttpServerResponseCommand.h') diff --git a/src/AbstractHttpServerResponseCommand.h b/src/AbstractHttpServerResponseCommand.h new file mode 100644 index 00000000..7dbc71dd --- /dev/null +++ b/src/AbstractHttpServerResponseCommand.h @@ -0,0 +1,75 @@ +/* */ +#ifndef D_ABSTRACT_HTTP_SERVER_RESPONSE_COMMAND_H +#define D_ABSTRACT_HTTP_SERVER_RESPONSE_COMMAND_H + +#include "Command.h" +#include "SharedHandle.h" +#include "TimerA2.h" + +namespace aria2 { + +class DownloadEngine; +class SocketCore; +class HttpServer; + +class AbstractHttpServerResponseCommand : public Command { +private: + DownloadEngine* e_; + SharedHandle socket_; + SharedHandle httpServer_; + Timer timeoutTimer_; +protected: + DownloadEngine* getDownloadEngine() + { + return e_; + } + // Called after content body is completely sent. + virtual void afterSend(const SharedHandle& httpServer, + DownloadEngine* e) = 0; +public: + AbstractHttpServerResponseCommand(cuid_t cuid, + const SharedHandle& httpServer, + DownloadEngine* e, + const SharedHandle& socket); + + virtual ~AbstractHttpServerResponseCommand(); + + virtual bool execute(); +}; + +} // namespace aria2 + +#endif // D_ABSTRACT_HTTP_SERVER_RESPONSE_COMMAND_H -- cgit