updated hide

This commit is contained in:
jcli
2016-07-20 13:04:56 -07:00
parent c4c877da81
commit f0584404e2
3 changed files with 36 additions and 5 deletions

View File

@@ -296,9 +296,19 @@ static void handle_app_hide(struct mg_connection *conn,
mg_send_http_error(conn, 404, "Not Found", "Not Found");
} else {
// not implemented in reference
fprintf(stderr, "Hide not implemented for reference.");
mg_send_http_error(conn, 501, "Not Implemented",
"Not Implemented");
DIALStatus status = app->callbacks.hide_cb(ds, app_name, app->run_id, app->callback_data);
if (status!=kDIALStatusHide){
fprintf(stderr, "Hide not implemented for reference.\n");
mg_send_http_error(conn, 501, "Not Implemented",
"Not Implemented");
}else{
app->state = kDIALStatusHide;
mg_printf(conn, "HTTP/1.1 200 OK\r\n"
"Content-Type: text/plain\r\n"
"Access-Control-Allow-Origin: %s\r\n"
"\r\n",
origin_header);
}
}
ds_unlock(ds);
}