pull/354/head
2dust 2019-12-17 16:16:47 +08:00
parent 4a74102eb7
commit 068fe3113b
5 changed files with 25 additions and 13 deletions

View File

@ -966,9 +966,9 @@ namespace v2rayN.Forms
} }
private void ClearTestResult() private void ClearTestResult()
{ {
for (int k = 0; k < config.vmess.Count; k++) for (int k = 0; k < lvSelecteds.Count; k++)
{ {
SetTestResult(k, ""); SetTestResult(lvSelecteds[k], "");
} }
} }
private void UpdateSpeedtestHandler(int index, string msg) private void UpdateSpeedtestHandler(int index, string msg)

View File

@ -182,6 +182,7 @@ namespace v2rayN.Handler
} }
} }
private void RunSpeedTest() private void RunSpeedTest()
{ {
if (_config.vmess.Count <= 0) if (_config.vmess.Count <= 0)
@ -244,7 +245,7 @@ namespace v2rayN.Handler
testCounter++; testCounter++;
var webProxy = new WebProxy(Global.Loopback, httpPort + index); var webProxy = new WebProxy(Global.Loopback, httpPort + index);
downloadHandle2.DownloadFileAsync(_config, url, webProxy, 30); downloadHandle2.DownloadFileAsync(_config, url, webProxy, 20);
return 0; return 0;
} }

View File

@ -1398,6 +1398,8 @@ namespace v2rayN.Handler
msg = UIRes.I18N("InitialConfiguration"); msg = UIRes.I18N("InitialConfiguration");
Config configCopy = Utils.DeepCopy<Config>(config);
string result = Utils.GetEmbedText(SampleClient); string result = Utils.GetEmbedText(SampleClient);
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
@ -1412,21 +1414,21 @@ namespace v2rayN.Handler
return -1; return -1;
} }
log(config, ref v2rayConfig, false); log(configCopy, ref v2rayConfig, false);
//routing(config, ref v2rayConfig); //routing(config, ref v2rayConfig);
dns(config, ref v2rayConfig); dns(configCopy, ref v2rayConfig);
var httpPort = config.GetLocalPort("speedtest"); var httpPort = configCopy.GetLocalPort("speedtest");
for (int k = 0; k < selecteds.Count; k++) for (int k = 0; k < selecteds.Count; k++)
{ {
int index = selecteds[k]; int index = selecteds[k];
if (config.vmess[index].configType == (int)EConfigType.Custom) if (configCopy.vmess[index].configType == (int)EConfigType.Custom)
{ {
continue; continue;
} }
config.index = index; configCopy.index = index;
var inbound = new Inbounds(); var inbound = new Inbounds();
inbound.listen = Global.Loopback; inbound.listen = Global.Loopback;
@ -1437,7 +1439,7 @@ namespace v2rayN.Handler
var v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result); var v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result);
outbound(config, ref v2rayConfigCopy); outbound(configCopy, ref v2rayConfigCopy);
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString(); v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]); v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]);
@ -1450,7 +1452,7 @@ namespace v2rayN.Handler
Utils.ToJsonFile(v2rayConfig, fileName); Utils.ToJsonFile(v2rayConfig, fileName);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary()); msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), configCopy.getSummary());
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”: // 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")] //[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("3.0")] [assembly: AssemblyFileVersion("3.2")]

View File

@ -77,9 +77,18 @@ namespace v2rayN.Tool
foreach (ZipArchiveEntry entry in archive.Entries) foreach (ZipArchiveEntry entry in archive.Entries)
{ {
if (entry.Length == 0) if (entry.Length == 0)
{
continue; continue;
}
try
{
entry.ExtractToFile(Utils.GetPath(entry.Name), true); entry.ExtractToFile(Utils.GetPath(entry.Name), true);
} }
catch (IOException ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
} }
} }
catch (Exception ex) catch (Exception ex)