From 8a9fa9a692e15396285cd0a4d993eb7882ae6898 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 10 Mar 2011 00:56:37 +0900 Subject: Added JSON-RPC 2.0 batch call. --- src/HttpServerBodyCommand.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/HttpServerBodyCommand.h') diff --git a/src/HttpServerBodyCommand.h b/src/HttpServerBodyCommand.h index a8215dda..b4503a8c 100644 --- a/src/HttpServerBodyCommand.h +++ b/src/HttpServerBodyCommand.h @@ -38,6 +38,8 @@ #include "Command.h" #include "SharedHandle.h" #include "TimerA2.h" +#include "ValueBase.h" +#include "XmlRpcResponse.h" namespace aria2 { @@ -51,6 +53,20 @@ private: SharedHandle socket_; SharedHandle httpServer_; Timer timeoutTimer_; + void sendJsonRpcErrorResponse + (const std::string& httpStatus, + int code, + const std::string& message, + const SharedHandle& id, + const std::string& callback); + void sendJsonRpcResponse + (const xmlrpc::XmlRpcResponse& res, + const std::string& callback); + void sendJsonRpcBatchResponse + (const std::vector& results, + const std::string& callback); + xmlrpc::XmlRpcResponse processJsonRpcRequest(const Dict* jsondict); + void addHttpServerResponseCommand(); public: HttpServerBodyCommand(cuid_t cuid, const SharedHandle& httpServer, -- cgit