Revert "Change the way to call the core in the speed test"

This reverts commit dd85ccd3f8.
pull/3107/head
2dust 2023-01-09 19:39:45 +08:00
parent 75f63afadc
commit 4909a557d5
1 changed files with 5 additions and 12 deletions

View File

@ -228,21 +228,15 @@ namespace v2rayN.Handler
string fileName = CoreFindexe(coreInfo);
if (fileName == "") return -1;
var pathTemp = Utils.GetConfigPath($"temp_{Utils.GetGUID(false)}.json");
File.WriteAllText(pathTemp, configStr);
if (!File.Exists(pathTemp))
{
return -1;
}
Process p = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = fileName,
Arguments = $"-config \"{pathTemp}\"",
Arguments = "-config stdin:",
WorkingDirectory = Utils.GetConfigPath(),
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
@ -261,16 +255,15 @@ namespace v2rayN.Handler
p.Start();
p.BeginOutputReadLine();
p.StandardInput.Write(configStr);
p.StandardInput.Close();
if (p.WaitForExit(1000))
{
throw new Exception(p.StandardError.ReadToEnd());
}
Global.processJob.AddProcess(p.Handle);
Thread.Sleep(1000);
File.Delete(pathTemp);
return p.Id;
}
catch (Exception ex)