diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-07-02 17:22:38 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-07-02 17:22:38 +0100 |
| commit | 991099ad1f33d1ed6fd0423964f196b34b0c1669 (patch) | |
| tree | 3831efb2aac6bd473766d277c3bb388343dca931 /rotord/rotord.cpp | |
| parent | 0d867b8b615add6e1a5aaa300c5a39b87614d906 (diff) | |
xml with root nodes
Diffstat (limited to 'rotord/rotord.cpp')
| -rwxr-xr-x | rotord/rotord.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index 6ece98a..b46cebc 100755 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -105,13 +105,13 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS xmlIO XML; //xml object handles the servers responses XML.addTag("rotor"); - XML.pushTag("rotor"); //can we create a tinyxml object here and pass a pointer to it to the render context? //can tinyxml output to a string? is there any reason to use poco instead? if (command.size()) { if (command[0]=="new") { + XML.pushTag("rotor"); if (request.getMethod()=="GET") { string sID=idGen.createOne().toString(); //create() seems to cause problems //Creates a new time-based UUID, using the MAC address of one of the system's ethernet adapters. @@ -135,6 +135,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS } } else if (command[0]=="list") { + XML.pushTag("rotor"); if (request.getMethod()=="GET") { //std::list < Poco::AutoPtr < Poco::Task > >::iterator it; //it=manager.taskList().begin(); @@ -161,6 +162,8 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS if(task->name()==command[0]) { //valid session command found=true; + XML.addAttribute("rotor","context",task->name(),0); + XML.pushTag("rotor"); if (command.size()==1) { //just invoking sID if (request.getMethod()=="DELETE") { @@ -195,6 +198,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS } if (!found) { status=HTTPResponse::HTTP_NOT_FOUND; + XML.pushTag("rotor"); XML.addValue("error","Render context not found"); } } |
