[tor-commits] [vidalia/alpha] Fix RouterDescriptor values when updated from a RouterStatus

chiiph at torproject.org chiiph at torproject.org
Mon Aug 13 21:39:37 UTC 2012


commit da706b72cf029c5022ce823e504c8e6e0fd547b9
Author: Tomás Touceda <chiiph at torproject.org>
Date:   Mon Aug 13 18:35:41 2012 -0300

    Fix RouterDescriptor values when updated from a RouterStatus
    
    Conflicts:
    
    	src/vidalia/network/RouterDescriptorView.cpp
---
 changes/bug6601                     |    2 ++
 src/torcontrol/RouterDescriptor.cpp |    7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/changes/bug6601 b/changes/bug6601
new file mode 100644
index 0000000..cea8133
--- /dev/null
+++ b/changes/bug6601
@@ -0,0 +1,2 @@
+  o Fix RouterDescriptor's bandwidth and uptime values when defined from the
+    consensus. Fixes bug 6601.
diff --git a/src/torcontrol/RouterDescriptor.cpp b/src/torcontrol/RouterDescriptor.cpp
index 0fead9c..a3ee3eb 100644
--- a/src/torcontrol/RouterDescriptor.cpp
+++ b/src/torcontrol/RouterDescriptor.cpp
@@ -107,9 +107,10 @@ RouterDescriptor::appendRouterStatusInfo(const RouterStatus &rs)
   _ip = rs.ipAddress();
   _orPort = rs.orPort();
   _dirPort = rs.dirPort();
-  _avgBandwidth = rs.bandwidth();
-  _burstBandwidth = rs.bandwidth();
-  _observedBandwidth = rs.bandwidth();
+  _avgBandwidth = rs.bandwidth() * 1024;
+  _burstBandwidth = rs.bandwidth() * 1024;
+  _observedBandwidth = rs.bandwidth() * 1024;
+  _published = rs.published();
 }
 
 RouterDescriptor *



More information about the tor-commits mailing list