diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-07-09 16:34:23 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-07-09 16:34:23 +0100 |
| commit | 06c6f158088ce9132375cfe7f5c27f7c200b44dc (patch) | |
| tree | fa1f90f9a3d5eab842638a6b009f817f10f481b6 /rotord/rotord.cpp | |
| parent | 1f7aeab37ebe41d57972f429fc0884d2de7eab4d (diff) | |
load graph from body
Diffstat (limited to 'rotord/rotord.cpp')
| -rwxr-xr-x | rotord/rotord.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index 8790d39..77725ff 100755 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -61,10 +61,19 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS if (request.getMethod()=="PUT") { //unofficial manual thread name if (body.size()) { string sID=body; - cerr << "Rotor: starting thread "<< sID << endl; - manager.start(new Rotor::Render_context(sID)); - XML.addValue("sID",sID); - status=HTTPResponse::HTTP_OK; + bool found=false; + for (auto& task: manager.taskList()) { + if(task->name()==sID) { + XML.addValue("error","Render context /"+sID+"/ exists already"); + found=true; + } + } + if (!found){ + cerr << "Rotor: starting thread "<< sID << endl; + manager.start(new Rotor::Render_context(sID)); + XML.addValue("sID",sID); + status=HTTPResponse::HTTP_OK; + } } } } |
