Skip to content

Commit

Permalink
revert save bandwidth
Browse files Browse the repository at this point in the history
Some bugs on Save Bandwidth. Maybe commit again after all is ok.
  • Loading branch information
GangZhuo committed Jan 14, 2016
1 parent 3c76238 commit fcec167
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
6 changes: 0 additions & 6 deletions shadowsocks-csharp/Controller/ShadowsocksController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ public class PathEventArgs : EventArgs
public ShadowsocksController()
{
_config = Configuration.Load();
inboundCounter = _config.GetCurrentServer().bandwidthIn;
outboundCounter = _config.GetCurrentServer().bandwidthOut;
StatisticsConfiguration = StatisticsStrategyConfiguration.Load();
_strategyManager = new StrategyManager(this);
StartReleasingMemory();
Expand Down Expand Up @@ -312,21 +310,17 @@ public void SaveLogViewerConfig(LogViewerConfig newConfig)
public void UpdateInboundCounter(long n)
{
Interlocked.Add(ref inboundCounter, n);
_config.GetCurrentServer().bandwidthIn = inboundCounter;
}

public void UpdateOutboundCounter(long n)
{
Interlocked.Add(ref outboundCounter, n);
_config.GetCurrentServer().bandwidthOut = outboundCounter;
}

protected void Reload()
{
// some logic in configuration updated the config when saving, we need to read it again
_config = Configuration.Load();
inboundCounter = _config.GetCurrentServer().bandwidthIn;
outboundCounter = _config.GetCurrentServer().bandwidthOut;
StatisticsConfiguration = StatisticsStrategyConfiguration.Load();

if (polipoRunner == null)
Expand Down
2 changes: 0 additions & 2 deletions shadowsocks-csharp/Model/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public class Server
public string method;
public string remarks;
public bool auth;
public long bandwidthIn;
public long bandwidthOut;

public override int GetHashCode()
{
Expand Down

0 comments on commit fcec167

Please sign in to comment.