diff --git a/src/client/spark/App.xaml.cs b/src/client/spark/App.xaml.cs index 25aecff08..ea2b1de78 100644 --- a/src/client/spark/App.xaml.cs +++ b/src/client/spark/App.xaml.cs @@ -75,6 +75,41 @@ namespace mbts.ui.shell Environment.Exit(0); } + void start_stunnel(string path, uint job_error) + { + string config_error; + if (!mbts.config.Configuration.try_initialize(out config_error)) + { + _stunnel_process = Process.Start(path + "bin\\stunnel.exe"); + if (_stunnel_process != null) + { + for (int i = 0; i < 10; i++) + { + if (mbts.config.Configuration.try_initialize(out config_error)) + break; + System.Threading.Thread.Sleep(500); + } + } + else + stunnel_job_error = "Stunnel Job Error code: " + job_error + + " could not start stunnel " + (config_error ?? string.Empty); + } + } + + void kill_stunnel() + { + try + { + Process[] ps = Process.GetProcessesByName("stunnel"); + ps.ForEach(p => + { + try { p.Kill(); } + catch {} + }); + } + catch { } + } + Process _stunnel_process; static internal string stunnel_job_error { get; private set;} void init_stunnel(string[] argv) @@ -85,24 +120,10 @@ namespace mbts.ui.shell if (File.Exists(path + "config\\stunnel.conf")) { uint job_error = BTSUINativeMethods.setup_process_job_object(); - if(job_error == 0) - { - _stunnel_process = Process.Start(path + "bin\\stunnel.exe"); - string config_error; bool success = false; - if(_stunnel_process != null) - { - for(int i = 0; i < 10; i++) - { - if(success = mbts.config.Configuration.try_initialize(out config_error)) - break; - System.Threading.Thread.Sleep(500); - } - } - else - stunnel_job_error = "Stunnel Job Error code: " + job_error + " could not start stunnel"; - } - else - stunnel_job_error = "Stunnel Job Error code: " + job_error; + //if we can't put this process and stunnel into a job, try to stop stunnel then restart + if(job_error != 0) + kill_stunnel(); + start_stunnel(path, job_error); } } catch(Exception ex) diff --git a/src/client/spark/Spark.csproj b/src/client/spark/Spark.csproj index c6eb7e982..dbf62a939 100644 --- a/src/client/spark/Spark.csproj +++ b/src/client/spark/Spark.csproj @@ -4,7 +4,8 @@ Blue Trading Systems Blue Trading Systems Spark - The game has changed. Make your Move. + Advanced Derivatives Trading + spark.manifest true Debug;Release x64 diff --git a/src/client/sparkcmd/Program.cs b/src/client/sparkcmd/Program.cs index 790308e27..504ce8daf 100644 --- a/src/client/sparkcmd/Program.cs +++ b/src/client/sparkcmd/Program.cs @@ -9,7 +9,7 @@ using System.Linq; namespace sparkcmd { class Program { static int Main(string[] args) { - mbts.config.Configuration.initialize(); + mbts.utils.BTSNativeMethods.provide_command_line(args, args.Length); var commands = ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(Program)); return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out); } diff --git a/src/lib/md/relay/QueryServer.cpp b/src/lib/md/relay/QueryServer.cpp index ac40920d6..248491942 100644 --- a/src/lib/md/relay/QueryServer.cpp +++ b/src/lib/md/relay/QueryServer.cpp @@ -382,10 +382,7 @@ public: google::protobuf::MapPair v(h.handle.key(), security.ice().security_desc()); x->insert(v); } - else - { - LOG(md,Error, "Invalid ExchangeData_case {}", security.ExchangeData_case()); - } + // There is currently no ExchangeData for synthetics } } }