SF.net SVN: fclient: [629] trunk/fclient/src/fclient/lib/fcp2/iohandler.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-15 14:53:16
|
Revision: 629
http://fclient.svn.sourceforge.net/fclient/?rev=629&view=rev
Author: jUrner
Date: 2008-07-15 07:52:39 -0700 (Tue, 15 Jul 2008)
Log Message:
-----------
message params without '=value' where not handled
msg.data was None if DataLenght was None. fix to ''
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/iohandler.py
Modified: trunk/fclient/src/fclient/lib/fcp2/iohandler.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/iohandler.py 2008-07-15 14:48:13 UTC (rev 628)
+++ trunk/fclient/src/fclient/lib/fcp2/iohandler.py 2008-07-15 14:52:39 UTC (rev 629)
@@ -297,7 +297,10 @@
msg = msgClass()
# process param --> value fields
- params = dict([line.split('=', 1) for line in p])
+ try:
+ params = dict([line.split('=', 1) for line in p])
+ except ValueError: # param not followed by =
+ raise consts.ErrorMessageParse('Invalid message parameters in: %s": ' % chunk, consts.ConstLogger.IOHandler.error)
if not msg._restoreParams(params):
#HACK:
if hackyInvalidMessageCallback is not None:
@@ -306,6 +309,7 @@
# get associated data if necessary
if mayHaveData:
+ msg.data = ''
n = msg._getDataLength()
if not isinstance(n, (int, long)):
#HACK:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|