@@ -109,6 +109,10 @@ namespace Shadowsocks.Controller | |||||
{ | { | ||||
return strategy.GetAServer(type, localIPEndPoint); | return strategy.GetAServer(type, localIPEndPoint); | ||||
} | } | ||||
if (_config.index < 0) | |||||
{ | |||||
_config.index = 0; | |||||
} | |||||
return GetCurrentServer(); | return GetCurrentServer(); | ||||
} | } | ||||
@@ -293,7 +297,8 @@ namespace Shadowsocks.Controller | |||||
polipoRunner.Stop(); | polipoRunner.Stop(); | ||||
try | try | ||||
{ | { | ||||
foreach (var strategy in GetStrategies()) | |||||
var strategy = GetCurrentStrategy(); | |||||
if (strategy != null) | |||||
{ | { | ||||
strategy.ReloadServers(); | strategy.ReloadServers(); | ||||
} | } | ||||
@@ -55,6 +55,13 @@ namespace Shadowsocks.Model | |||||
{ | { | ||||
config.localPort = 1080; | config.localPort = 1080; | ||||
} | } | ||||
if (config.index == -1) | |||||
{ | |||||
if (config.strategy == null) | |||||
{ | |||||
config.index = 0; | |||||
} | |||||
} | |||||
return config; | return config; | ||||
} | } | ||||
catch (Exception e) | catch (Exception e) | ||||
@@ -86,6 +93,13 @@ namespace Shadowsocks.Model | |||||
{ | { | ||||
config.index = -1; | config.index = -1; | ||||
} | } | ||||
if (config.index == -1) | |||||
{ | |||||
if (config.strategy == null) | |||||
{ | |||||
config.index = 0; | |||||
} | |||||
} | |||||
config.isDefault = false; | config.isDefault = false; | ||||
try | try | ||||
{ | { | ||||