summaryrefslogtreecommitdiff
path: root/rotord/src/rendercontext.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-11-08 11:21:06 +0000
committerTim Redfern <tim@eclectronics.org>2013-11-08 11:21:06 +0000
commitb5857aaff7cbdc5382a398de58494b97b0616536 (patch)
tree92a52f0f04f94e48746a0b0de456d6297e4a1b6e /rotord/src/rendercontext.cpp
parentb0a84b45721643298870322bd2335e20c359b10d (diff)
catch empty features request
Diffstat (limited to 'rotord/src/rendercontext.cpp')
-rw-r--r--rotord/src/rendercontext.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp
index c3d8b93..2f07c89 100644
--- a/rotord/src/rendercontext.cpp
+++ b/rotord/src/rendercontext.cpp
@@ -420,14 +420,20 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H
if (command.commands[1]=="features") {
if (command.method=="GET") {
if(state==IDLE){
- //parse json to get preview spec, return XML? this is a mess
- string features_node=command.commands[2];
- if (graph.print_features(XML,features_node)) {
- status=HTTPResponse::HTTP_OK;
+ if (command.commands.size()>2){
+ //parse json to get preview spec, return XML? this is a mess
+ string features_node=command.commands[2];
+ if (graph.print_features(XML,features_node)) {
+ status=HTTPResponse::HTTP_OK;
+ }
+ else {
+ status=HTTPResponse::HTTP_BAD_REQUEST;
+ logger.error("ERROR: Could not print features for node /"+features_node+"/");
+ }
}
else {
status=HTTPResponse::HTTP_BAD_REQUEST;
- logger.error("ERROR: Could not print features for node /"+features_node+"/");
+ logger.error("ERROR: Features node not specified");
}
}
else {