[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [arm/master] Dropping the old sighup tracker



commit 2df780f6d3a8c676b670db7542930d88e942b595
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Fri May 13 19:44:18 2011 -0700

    Dropping the old sighup tracker
    
    This functionality has been replaced by connection state listeners, and the
    last users of this hack have been refactored.
---
 src/cli/controller.py |   31 -------------------------------
 1 files changed, 0 insertions(+), 31 deletions(-)

diff --git a/src/cli/controller.py b/src/cli/controller.py
index 63f62e5..030b1d3 100644
--- a/src/cli/controller.py
+++ b/src/cli/controller.py
@@ -179,20 +179,6 @@ class ControlPanel(panel.Panel):
       self.addstr(0, xLoc + 1, " " * barProgress, curses.A_STANDOUT | uiTools.getColor("red"))
       self.addstr(0, xLoc + barWidth + 1, "]", curses.A_BOLD)
 
-class sighupListener(TorCtl.PostEventListener):
-  """
-  Listens for reload signal (hup), which is produced by:
-  pkill -sighup tor
-  causing the torrc and internal state to be reset.
-  """
-  
-  def __init__(self):
-    TorCtl.PostEventListener.__init__(self)
-    self.isReset = False
-  
-  def msg_event(self, event):
-    self.isReset |= event.level == "NOTICE" and event.msg.startswith("Received reload signal (hup)")
-
 def setPauseState(panels, monitorIsPaused, currentPage, overwrite=False):
   """
   Resets the isPaused state of panels. If overwrite is True then this pauses
@@ -332,12 +318,10 @@ def drawTorMonitor(stdscr, startTime, loggedEvents, isBlindMode):
   elif graphType == 3: panels["graph"].setStats("system resources")
   
   # listeners that update bandwidth and log panels with Tor status
-  sighupTracker = sighupListener()
   #conn.add_event_listener(panels["log"])
   conn.add_event_listener(panels["graph"].stats["bandwidth"])
   conn.add_event_listener(panels["graph"].stats["system resources"])
   if not isBlindMode: conn.add_event_listener(panels["graph"].stats["connections"])
-  conn.add_event_listener(sighupTracker)
   
   # prepopulates bandwidth values from state file
   if CONFIG["features.graph.bw.prepopulate"]:
@@ -420,21 +404,6 @@ def drawTorMonitor(stdscr, startTime, loggedEvents, isBlindMode):
     try:
       redrawStartTime = time.time()
       
-      # if sighup received then reload related information
-      if sighupTracker.isReset:
-        #panels["header"]._updateParams(True)
-        
-        # other panels that use torrc data
-        #if not isBlindMode: panels["graph"].stats["connections"].resetOptions(conn)
-        #panels["graph"].stats["bandwidth"].resetOptions()
-        
-        # if bandwidth graph is being shown then height might have changed
-        if panels["graph"].currentDisplay == "bandwidth":
-          panels["graph"].setHeight(panels["graph"].stats["bandwidth"].getContentHeight())
-        
-        
-        sighupTracker.isReset = False
-      
       # gives panels a chance to take advantage of the maximum bounds
       # originally this checked in the bounds changed but 'recreate' is a no-op
       # if panel properties are unchanged and checking every redraw is more

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits