[or-cvs] r22809: {arm} fix: bandwidth stats above the graph weren't getting reset b (in arm/trunk/interface: . graphing)
Damian Johnson
atagar1 at gmail.com
Fri Aug 6 04:48:49 UTC 2010
Author: atagar
Date: 2010-08-06 04:48:49 +0000 (Fri, 06 Aug 2010)
New Revision: 22809
Modified:
arm/trunk/interface/confPanel.py
arm/trunk/interface/connPanel.py
arm/trunk/interface/controller.py
arm/trunk/interface/graphing/bandwidthStats.py
Log:
fix: bandwidth stats above the graph weren't getting reset by sighups (caught by voidzero)
fix: config panel and connection panels were failing to parse torrcs with tabs (caught by voidzero)
fix: connection panel was dropping exit policy entries beyond the first for determining exits
fix: race condition between heartbeat detection and getting the first BW event
Modified: arm/trunk/interface/confPanel.py
===================================================================
--- arm/trunk/interface/confPanel.py 2010-08-05 20:29:05 UTC (rev 22808)
+++ arm/trunk/interface/confPanel.py 2010-08-06 04:48:49 UTC (rev 22809)
@@ -113,6 +113,10 @@
# replace aliases with the internal representation of the command
if command in CONF_ALIASES: command = CONF_ALIASES[command]
+ # tor appears to replace tabs with a space, for instance:
+ # "accept\t*:563" is read back as "accept *:563"
+ argument = argument.replace("\t", " ")
+
# expands value if it's a size or time
comp = argument.strip().lower().split(" ")
if len(comp) > 1:
@@ -257,6 +261,11 @@
command, argument, comment = lineText[:ctlEnd], lineText[ctlEnd:argEnd], lineText[argEnd:]
if self.stripComments: comment = ""
+ # Tabs print as three spaces. Keeping them as tabs is problematic for
+ # the layout since it's counted as a single character, but occupies
+ # several cells.
+ argument = argument.replace("\t", " ")
+
# changes presentation if value's incorrect or irrelevant
if lineNum in self.corrections.keys():
argumentColor = "red"
Modified: arm/trunk/interface/connPanel.py
===================================================================
--- arm/trunk/interface/connPanel.py 2010-08-05 20:29:05 UTC (rev 22808)
+++ arm/trunk/interface/connPanel.py 2010-08-06 04:48:49 UTC (rev 22809)
@@ -8,7 +8,7 @@
from threading import RLock
from TorCtl import TorCtl
-from util import log, connections, hostnames, panel, uiTools
+from util import log, connections, hostnames, panel, torTools, uiTools
# Scrubs private data from any connection that might belong to client or exit
# traffic. This is a little overly conservative, hiding anything that isn't
@@ -192,8 +192,11 @@
else: self.family = []
self.isBridge = self.conn.get_option("BridgeRelay")[0][1] == "1"
- self.exitPolicy = self.conn.get_option("ExitPolicy")[0][1]
+ policyEntries = torTools.getConn().getOption("ExitPolicy", multiple=True)
+ self.exitPolicy = ",".join(policyEntries)
+ self.exitPolicy = self.exitPolicy.replace("\\t", " ").replace("\"", "")
+
if self.exitPolicy: self.exitPolicy += "," + self.conn.get_info("exit-policy/default")["exit-policy/default"]
else: self.exitPolicy = self.conn.get_info("exit-policy/default")["exit-policy/default"]
Modified: arm/trunk/interface/controller.py
===================================================================
--- arm/trunk/interface/controller.py 2010-08-05 20:29:05 UTC (rev 22808)
+++ arm/trunk/interface/controller.py 2010-08-06 04:48:49 UTC (rev 22809)
@@ -490,9 +490,8 @@
tmpStartY += panels[panelKey].getHeight()
# provides a notice if there's been ten seconds since the last BW event
- if torTools.getConn().isAlive():
- lastHeartbeat = torTools.getConn().getHeartbeat()
-
+ lastHeartbeat = torTools.getConn().getHeartbeat()
+ if torTools.getConn().isAlive() and lastHeartbeat != 0:
if not isUnresponsive and (time.time() - lastHeartbeat) >= 10:
isUnresponsive = True
log.log(log.NOTICE, "Relay unresponsive (last heartbeat: %s)" % time.ctime(lastHeartbeat))
Modified: arm/trunk/interface/graphing/bandwidthStats.py
===================================================================
--- arm/trunk/interface/graphing/bandwidthStats.py 2010-08-05 20:29:05 UTC (rev 22808)
+++ arm/trunk/interface/graphing/bandwidthStats.py 2010-08-06 04:48:49 UTC (rev 22809)
@@ -48,6 +48,7 @@
def resetListener(self, conn, eventType):
# updates title parameters and accounting status if they changed
+ self._titleStats = [] # force reset of title
self.new_desc_event(None) # updates title params
if self._config["features.graph.bw.accounting.show"]:
More information about the tor-commits
mailing list