From bae5295da242899abddc79bb307d7a5581b65ce7 Mon Sep 17 00:00:00 2001 From: Richard Powell Date: Wed, 13 Jun 2018 13:24:46 +0100 Subject: [PATCH] Don't start up the CivetWeb server in sc2_connection.cc - the websocket client doesn't require it. --- src/sc2api/sc2_connection.cc | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/sc2api/sc2_connection.cc b/src/sc2api/sc2_connection.cc index 17075620..6c9ce865 100644 --- a/src/sc2api/sc2_connection.cc +++ b/src/sc2api/sc2_connection.cc @@ -14,36 +14,6 @@ namespace sc2 { -void StartCivetweb() { - static bool is_initialized = false; - static const char* REQUEST_TIMEOUT_MS = "5000"; - static const char* WEBSOCKET_TIMEOUT_MS = "1200000"; - static const char* NUM_THREADS = "4"; - static const char* NO_DELAY = "1"; - - if (is_initialized) { - return; - } - - const char* options[] = { - "request_timeout_ms", - REQUEST_TIMEOUT_MS, - "websocket_timeout_ms", - WEBSOCKET_TIMEOUT_MS, - "num_threads", - NUM_THREADS, - "tcp_nodelay", - NO_DELAY, - 0 - }; - - mg_callbacks callbacks; - memset(&callbacks, 0, sizeof(callbacks)); - mg_start(&callbacks, nullptr, options); - - is_initialized = true; -} - bool GetClientData(const mg_connection* connection, sc2::Connection*& out) { if (!connection) { return false; @@ -101,7 +71,6 @@ Connection::Connection() : bool Connection::Connect(const std::string& address, int port, bool verbose) { - StartCivetweb(); verbose_ = verbose; char ebuff[100] = { 0 };