From b5df96fd37da30fe3655a07a5aceb6c60f0de314 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 4 Jan 2017 19:42:13 +0100 Subject: [PATCH] Fix issue enabling/disabling http (nw) --- src/emu/emuopts.h | 2 +- src/emu/machine.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 2046661146b..99b5463f540 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -386,7 +386,7 @@ public: const char *language() const { return value(OPTION_LANGUAGE); } // 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); } const char *http_root() const { return value(OPTION_HTTP_ROOT); } diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index ebeca3fe3c1..d528d9afd40 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -1183,6 +1183,8 @@ running_machine::logerror_callback_item::logerror_callback_item(logerror_callbac void running_machine::export_http_api() { + if (!options().http()) return; + m_manager.http_server()->on_get("/api/machine", [this](auto response, auto request) { rapidjson::StringBuffer s;