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

[minion-cvs] Rewrite MMTP implementation to conform to spec, transfe...



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

Modified Files:
	MMTPServer.py 
Log Message:
Rewrite MMTP implementation to conform to spec, transfer data with less
latency, and take up less space.  Should be backward compatible, but
probably needs some more burn-in.

Also, misc pychecker work.


Index: MMTPServer.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/MMTPServer.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- MMTPServer.py	18 Dec 2003 22:55:27 -0000	1.64
+++ MMTPServer.py	3 Jan 2004 05:45:26 -0000	1.65
@@ -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.MMTPServer
 
@@ -27,12 +27,13 @@
 import time
 from types import StringType
 
+import mixminion.TLSConnection
 import mixminion._minionlib as _ml
[...1242 lines suppressed...]
+            con = MMTPClientConnection(
+                family, ip, port, keyID, serverName=serverName,
+                context=self.clientContext, certCache=self.certificateCache)
+            con.allPacketsSent = finished
+        except (socket.error, MixProtocolError), e:
             LOG.error("Unexpected socket error connecting to %s: %s",
                       serverName, e)
             EventStats.log.failedConnect() #FFFF addr
@@ -1269,7 +602,10 @@
             # No exception: We created the connection successfully.
             # Thus, register it in clientConByAddr
             assert addr == con.getAddr()
-            con.register(self)
+            for d in deliverable:
+                con.addPacket(d)
+
+            self.register(con)
             self.clientConByAddr[addr] = con
 
     def __clientFinished(self, addr):