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

[minion-cvs] Make client send messages successfully on win32



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

Modified Files:
	ClientMain.py MMTPClient.py 
Log Message:
Make client send messages successfully on win32

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- ClientMain.py	10 Jul 2003 21:16:05 -0000	1.98
+++ ClientMain.py	10 Jul 2003 21:52:31 -0000	1.99
@@ -40,7 +40,7 @@
 from mixminion.Crypto import sha1, ctr_crypt, trng
 from mixminion.Config import ClientConfig, ConfigError
 from mixminion.ServerInfo import ServerInfo, ServerDirectory
-from mixminion.Packet import encodeMessageHeaders, ParseError, parseMBOXInfo, \
+from mixminion.Packet import encodeMailHeaders, ParseError, parseMBOXInfo, \
      parseReplyBlocks, parseSMTPInfo, parseTextEncodedMessages, \
      parseTextReplyBlocks, ReplyBlock, MBOX_TYPE, SMTP_TYPE, DROP_TYPE
 
@@ -2172,6 +2172,11 @@
   --no-queue                 Do not attempt to queue the message.""" }
     sys.exit(0)
 
+if sys.platform == 'win32':
+    EOF_STR = "Ctrl-Z, Return"
+else:
+    EOF_STR = "Ctrl-D"
+
 def runClient(cmd, args):
     """[Entry point]  Generate an outgoing mixminion message and possibly
        send it.  Implements 'mixminion send' and 'mixminion queue'."""
@@ -2267,7 +2272,8 @@
 
         try:
             if inFile == '-':
-                print "Enter your message now.  Type Ctrl-D when you are done."
+                print "Enter your message now.  Type %s when you are done."%(
+                        EOF_STR)
                 payload = sys.stdin.read()
             else:
                 payload = readFile(inFile)
@@ -2275,7 +2281,7 @@
             print "Interrupted.  Message not sent."
             sys.exit(1)
 
-    payload = "%s%s" % headerStr, payload
+    payload = "%s%s" % (headerStr, payload)
 
     if parser.usingSURBList:
         assert isinstance(path2, ListType)

Index: MMTPClient.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/MMTPClient.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- MMTPClient.py	14 Jun 2003 23:15:15 -0000	1.34
+++ MMTPClient.py	10 Jul 2003 21:52:31 -0000	1.35
@@ -90,6 +90,9 @@
     def _connect(self, connectTimeout=None):
         """Helper method; implements _connect."""
         # FFFF There should be a way to specify timeout for communication.
+        if not hasattr(signal, 'alarm'): #WWWW
+            connectTimeout = None
+
         def sigalarmHandler(sig, _):
             assert sig == signal.SIGALRM
         if connectTimeout: