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

[minion-cvs] Make pychecker far happier; update many copyright notic...



Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv4440/lib/mixminion/server

Modified Files:
	EventStats.py MMTPServer.py Modules.py PacketHandler.py 
	ServerMain.py 
Log Message:
Make pychecker far happier; update many copyright notices; fix a couple actual bugs

Index: EventStats.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/EventStats.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- EventStats.py	3 Dec 2003 23:18:53 -0000	1.13
+++ EventStats.py	3 Jan 2004 07:35:24 -0000	1.14
@@ -1,4 +1,4 @@
-# Copyright 2002-2003 Nick Mathewson.  See LICENSE for licensing information.
+# Copyright 2002-2004 Nick Mathewson.  See LICENSE for licensing information.
 # $Id$
 
 """mixminion.server.EventStats
@@ -324,6 +324,8 @@
         workfile = os.path.join(config.getWorkDir(), "stats.tmp")
         log = EventLog(
            workfile, statsfile, config['Server']['StatsInterval'].getSeconds())
+        import mixminion.MMTPClient
+        mixminion.MMTPClient.useEventStats()
         LOG.info("Statistics logging enabled")
     else:
         log = NilEventLog()

Index: MMTPServer.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/MMTPServer.py,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- MMTPServer.py	3 Jan 2004 05:45:26 -0000	1.65
+++ MMTPServer.py	3 Jan 2004 07:35:24 -0000	1.66
@@ -23,7 +23,6 @@
 import socket
 import select
 import re
-import sys
 import time
 from types import StringType
 
@@ -34,7 +33,7 @@
 from mixminion.Crypto import sha1, getCommonPRNG
 from mixminion.Packet import PACKET_LEN, DIGEST_LEN, IPV4Info, MMTPHostInfo
 from mixminion.MMTPClient import PeerCertificateCache, MMTPClientConnection
-from mixminion.NetUtils import IN_PROGRESS_ERRNOS, getProtocolSupport, AF_INET, AF_INET6
+from mixminion.NetUtils import getProtocolSupport, AF_INET, AF_INET6
 import mixminion.server.EventStats as EventStats
 from mixminion.Filestore import CorruptedFile
 from mixminion.ServerInfo import displayServer
@@ -271,7 +270,7 @@
         if s is None:
             return
         elif s == -1:
-            self.startShudown()
+            self.startShutdown()
             #failed
             return
 
@@ -373,13 +372,9 @@
 REJECTED_CONTROL     = "REJECTED\r\n"
 SEND_CONTROL_LEN     = len(SEND_CONTROL)
 RECEIVED_CONTROL_LEN = len(RECEIVED_CONTROL)
-SEND_RECORD_LEN      = len(SEND_CONTROL) + PACKET_LEN + DIGEST_LEN
-RECEIVED_RECORD_LEN  = RECEIVED_CONTROL_LEN + DIGEST_LEN
 
 #----------------------------------------------------------------------
 
-NULL_KEYID = "\x00"*20
-
 class DeliverablePacket(mixminion.MMTPClient.DeliverableMessage):
     """Implementation of DeliverableMessage.
 
@@ -420,7 +415,7 @@
 
     def __init__(self, config, servercontext):
         AsyncServer.__init__(self)
-
+        
         self.serverContext = servercontext
         self.clientContext = _ml.TLSContext_new()
         # FFFF Don't always listen; don't always retransmit!

Index: Modules.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/Modules.py,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- Modules.py	14 Dec 2003 01:43:25 -0000	1.67
+++ Modules.py	3 Jan 2004 07:35:24 -0000	1.68
@@ -1,4 +1,4 @@
-# Copyright 2002-2003 Nick Mathewson.  See LICENSE for licensing information.
+# Copyright 2002-2004 Nick Mathewson.  See LICENSE for licensing information.
 # $Id$
 
 """mixminion.server.Modules
@@ -624,6 +624,8 @@
                 self._queue = None
         finally:
             self.lock.release()
+    def processMessage(self, packet):
+        raise AssertionError
 
 class FragmentDeliveryQueue:
     """Delivery queue for FragmentModule.

Index: PacketHandler.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/PacketHandler.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- PacketHandler.py	8 Dec 2003 02:22:56 -0000	1.34
+++ PacketHandler.py	3 Jan 2004 07:35:24 -0000	1.35
@@ -1,4 +1,4 @@
-# Copyright 2002-2003 Nick Mathewson.  See LICENSE for licensing information.
+# Copyright 2002-2004 Nick Mathewson.  See LICENSE for licensing information.
 # $Id$
 
 """mixminion.server.PacketHandler: Code to process mixminion packets"""
@@ -10,15 +10,14 @@
 from mixminion.Common import encodeBase64, formatBase64, LOG
 import mixminion.Crypto as Crypto
 import mixminion.Packet as Packet
-import mixminion.Common as Common
 import mixminion.BuildMessage
 
 from mixminion.ServerInfo import PACKET_KEY_BYTES
-from mixminion.Common import MixError, isPrintingAscii
+from mixminion.Common import MixError, MixFatalError, isPrintingAscii
 
 __all__ = [ 'PacketHandler', 'ContentError', 'DeliveryPacket', 'RelayedPacket']
 
-class ContentError(Common.MixError):
+class ContentError(MixError):
     """Exception raised when a packed is malformatted or unacceptable."""
     pass
 
@@ -61,7 +60,7 @@
             for k in keys:
                 newKeys[k.encode_key(1)] = 1
                 if k.get_modulus_bytes() != PACKET_KEY_BYTES:
-                    raise Common.MixFatalError("Incorrect packet key length")
+                    raise MixFatalError("Incorrect packet key length")
             # For all old public keys, if they aren't in the new set, close
             # their hashlogs.
             for k, h in self.privatekeys:

Index: ServerMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerMain.py,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- ServerMain.py	14 Dec 2003 02:15:20 -0000	1.111
+++ ServerMain.py	3 Jan 2004 07:35:24 -0000	1.112
@@ -1,4 +1,4 @@
-# Copyright 2002-2003 Nick Mathewson.  See LICENSE for licensing information.
+# Copyright 2002-2004 Nick Mathewson.  See LICENSE for licensing information.
 # $Id$
 
 """mixminion.ServerMain
@@ -1031,7 +1031,6 @@
         sys.exit(0)
     configFile = None
     forceDaemon = None
-    echo = 0
     severity = None
     for o,v in options:
         if o in ('-h', '--help'):
@@ -1303,7 +1302,6 @@
 
     checkHomedirVersion(config)
 
-    homeDir = config.getBaseDir()
     keyDir = config.getKeyDir()
     hashDir = os.path.join(config.getWorkDir(), 'hashlogs')
     if not os.path.exists(keyDir):
@@ -1350,11 +1348,11 @@
     """[Entry point] Send a SIGHUP or a SIGTERM to a running mixminion
        server."""
     if cmd.endswith("server-stop"):
-        reload = 0
+        sig_reload = 0
         usage = _SIGNAL_SERVER_USAGE % ("server-stop", "shut down")
     else:
         assert cmd.endswith("server-reload")
-        reload = 1
+        sig_reload = 1
         usage = _SIGNAL_SERVER_USAGE % ("server-reload",
                                         "rescan its configuration")
 
@@ -1363,14 +1361,13 @@
 
     checkHomedirVersion(config)
 
-    _signalServer(config, reload)
+    _signalServer(config, sig_reload)
 
 def _signalServer(config, reload):
     """Given a configuration file, sends a signal to the corresponding
        server if it's running.  If 'reload', the signal is HUP.  Else,
        the signal is TERM.
     """
-    homeDir = config.getBaseDir()
     pidFile = config.getPidFile()
     if not os.path.exists(pidFile):
         raise UIError("No server seems to be running.")