[CLI] Bugfix: disable server mode for using with CLI interpreter.
authorOleg Lekarev <o.lekarev@samsung.com>
Thu, 25 Nov 2021 16:12:29 +0000 (19:12 +0300)
committerAlexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Thu, 2 Dec 2021 16:59:41 +0000 (19:59 +0300)
src/main.cpp

index 358d7b53951e27ea41ff621c8416070924841b72..0c295d654299a6a73517ad15472093801d995083 100644 (file)
@@ -377,6 +377,12 @@ int main(int argc, char* argv[])
         exit(EXIT_FAILURE);
     }
 
+    if (protocol_constructor == &instantiate_protocol<CLIProtocol> && serverPort)
+    {
+        fprintf(stderr, "server mode can't be used with CLI interpreter!\n");
+        exit(EXIT_FAILURE);
+    }
+
     LOGI("Netcoredbg started");
     // Note: there is no possibility to know which exception caused call to std::terminate
     std::set_terminate([]{ LOGF("Netcoredbg is terminated due to call to std::terminate: see stderr..."); });