[Nym3-commit] r454 - in trunk/nymbaron: . Server
zax at conuropsis.org
zax at conuropsis.org
Mon Mar 6 16:48:25 CET 2006
Author: zax
Date: 2006-03-06 16:48:22 +0100 (Mon, 06 Mar 2006)
New Revision: 454
Modified:
trunk/nymbaron/Mail.py
trunk/nymbaron/Server/Main.py
Log:
Minor change to relay function that will make it easier to test and debug other relay methods.
Modified: trunk/nymbaron/Mail.py
===================================================================
--- trunk/nymbaron/Mail.py 2006-02-27 18:06:16 UTC (rev 453)
+++ trunk/nymbaron/Mail.py 2006-03-06 15:48:22 UTC (rev 454)
@@ -170,13 +170,8 @@
body = filter_header(body)
b = 'From: ' + nym + '@' + sname + "\n\n" + body
fname = tmpFileMsg(b) #TODO we can avoid the tempfile with some fd manipultation : exec mixminion, write b in its stdin
- mixcmd = "mixminion send -t 0x" + b2s(rt[0]) + b2s(rt[1]) + ":" + ri + " -i " + fname
- print mixcmd
- ec = os.system(mixcmd)
- # TODO : debugging cruft
- #os.unlink(fname)
- print "Raw relayed message left in " + fname
- return ec
+ relaycmd = "mixminion send -t 0x" + b2s(rt[0]) + b2s(rt[1]) + ":" + ri + " -i " + fname
+ return relaycmd
def genMid(length = midLen):
"""Randomly generates a mid of given length different from oldestMid"""
Modified: trunk/nymbaron/Server/Main.py
===================================================================
--- trunk/nymbaron/Server/Main.py 2006-02-27 18:06:16 UTC (rev 453)
+++ trunk/nymbaron/Server/Main.py 2006-03-06 15:48:22 UTC (rev 454)
@@ -240,9 +240,13 @@
elif (com.ct() == Message.CToSCODE['Newpk']):
nymUser.setKeys(com.kid,com.kenc)
elif (com.ct() == Message.CToSCODE['Relay']):
- ec = Mail.relay(h.nym, com.rt, com.ri,
+ relaycmd = Mail.relay(h.nym, com.rt, com.ri,
config.serverName, com.body)
- if (ec != 0):
+ logger.debug('Attempting to relay nymholder message using command %s' % relaycmd)
+ ec = os.system(relaycmd)
+ if (ec == 0):
+ logger.debug('Message relay successfully processed')
+ else:
logger.error("mixminion exited abnormally with error code %d" % ec)
sys.exit(2)
More information about the Nym3-commit
mailing list