Fix issue enabling/disabling http (nw)

This commit is contained in:
Miodrag Milanovic 2017-01-04 19:42:13 +01:00
parent 74b24ecefb
commit b5df96fd37
2 changed files with 3 additions and 1 deletions

View File

@ -386,7 +386,7 @@ public:
const char *language() const { return value(OPTION_LANGUAGE); } const char *language() const { return value(OPTION_LANGUAGE); }
// Web server specific optopns // Web server specific optopns
bool http() const { return value(OPTION_HTTP); } bool http() const { return bool_value(OPTION_HTTP); }
short http_port() const { return int_value(OPTION_HTTP_PORT); } short http_port() const { return int_value(OPTION_HTTP_PORT); }
const char *http_root() const { return value(OPTION_HTTP_ROOT); } const char *http_root() const { return value(OPTION_HTTP_ROOT); }

View File

@ -1183,6 +1183,8 @@ running_machine::logerror_callback_item::logerror_callback_item(logerror_callbac
void running_machine::export_http_api() void running_machine::export_http_api()
{ {
if (!options().http()) return;
m_manager.http_server()->on_get("/api/machine", [this](auto response, auto request) m_manager.http_server()->on_get("/api/machine", [this](auto response, auto request)
{ {
rapidjson::StringBuffer s; rapidjson::StringBuffer s;