From fcec167c727f688d93e7e8d54d4ff32cd1dc6ad7 Mon Sep 17 00:00:00 2001 From: Gang Zhuo Date: Thu, 14 Jan 2016 03:45:57 -0500 Subject: [PATCH] revert save bandwidth Some bugs on Save Bandwidth. Maybe commit again after all is ok. --- shadowsocks-csharp/Controller/ShadowsocksController.cs | 6 ------ shadowsocks-csharp/Model/Server.cs | 2 -- 2 files changed, 8 deletions(-) diff --git a/shadowsocks-csharp/Controller/ShadowsocksController.cs b/shadowsocks-csharp/Controller/ShadowsocksController.cs index 356f58cb3..f7d50bd35 100755 --- a/shadowsocks-csharp/Controller/ShadowsocksController.cs +++ b/shadowsocks-csharp/Controller/ShadowsocksController.cs @@ -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(); @@ -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) diff --git a/shadowsocks-csharp/Model/Server.cs b/shadowsocks-csharp/Model/Server.cs index 4ae22fde8..8306d9e32 100755 --- a/shadowsocks-csharp/Model/Server.cs +++ b/shadowsocks-csharp/Model/Server.cs @@ -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() {