From d601a85b50bbac9fc9c46321af64f1137aaf5af7 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 28 Aug 2013 13:42:34 +0100 Subject: installer work --- rotord/src/rendercontext.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'rotord/src/rendercontext.cpp') diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp index 47ff9c1..77adc71 100644 --- a/rotord/src/rendercontext.cpp +++ b/rotord/src/rendercontext.cpp @@ -295,6 +295,47 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H XML.addValue("error","Bad request"); } } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Bad request"); + XML.addValue("error","Bad request"); + } + } + if (command.commands[1]=="preview") { + if (command.method=="GET") { + if(state==IDLE){ + //parse json to get preview spec, return XML? this is a mess + string preview_node=command.commands[2]; + Json::Value root; // will contains the root value after parsing. + Json::Reader reader; + if (reader.parse( command.body, root )) { + int frame=root["frame"].asInt(); + int width=root["width"].asInt(); + int height=root["height"].asInt(); + string resolution=root["resolution"].asString(); + cerr<<"preview: "<