Refine RNG usage

- Create instance once, bind it to ShadowsocksController

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
This commit is contained in:
Syrone Wong
2016-11-09 10:28:50 +08:00
parent c908caa584
commit 8fcb66b6ff
5 changed files with 52 additions and 6 deletions
@@ -272,6 +272,7 @@ namespace Shadowsocks.Controller
{
SystemProxy.Update(_config, true);
}
Encryption.RNG.Close();
}
public void TouchPACFile()
@@ -413,6 +414,7 @@ namespace Shadowsocks.Controller
protected void Reload()
{
Encryption.RNG.Reload();
// some logic in configuration updated the config when saving, we need to read it again
_config = Configuration.Load();
StatisticsConfiguration = StatisticsStrategyConfiguration.Load();