SF.net SVN: fclient:[964] trunk/fclient/fclient/impl/lib/fcp2/iohandler.py
Status: Pre-Alpha
Brought to you by:
jurner
From: <jU...@us...> - 2008-08-26 16:31:03
|
Revision: 964 http://fclient.svn.sourceforge.net/fclient/?rev=964&view=rev Author: jUrner Date: 2008-08-26 16:31:11 +0000 (Tue, 26 Aug 2008) Log Message: ----------- fix for msg.data Modified Paths: -------------- trunk/fclient/fclient/impl/lib/fcp2/iohandler.py Modified: trunk/fclient/fclient/impl/lib/fcp2/iohandler.py =================================================================== --- trunk/fclient/fclient/impl/lib/fcp2/iohandler.py 2008-08-25 00:20:54 UTC (rev 963) +++ trunk/fclient/fclient/impl/lib/fcp2/iohandler.py 2008-08-26 16:31:11 UTC (rev 964) @@ -291,6 +291,8 @@ raise self.ErrorMessageParse('No message name present') msgName = p.pop(0) msgClass = message.MessagesAll.get(msgName, None) + + #TODO: can not pass unicode to type.__new__. maybe skip this part and log an error if msgClass is None: consts.ConstLogger.IOHandler.debug(consts.ConstLogMessages.CreatingNewMessageType + ' "%s"' % msgName) msgClass = message.newMessageClass(msgName) @@ -318,15 +320,15 @@ raise consts.ErrorMessageParse('DataLength must be type(int)') if n > 0: - while self._receiveBuffer: + while True: if len(self._receiveBuffer) >= n: msg.data, self._receiveBuffer = self._receiveBuffer[ :n], self._receiveBuffer[n: ] break try: self.readBytes(self.io.BufferSize) - except ErrorIOTimeout, details: # try again later + except consts.ErrorIOTimeout, details: # try again later self._receiveBuffer = chunk + self._receiveBuffer - raise ErrorIOTimeout(details) + raise consts.ErrorIOTimeout(details) consts.ConstLogger.IOHandler.log(consts.ConstDebugVerbosity.Message, consts.ConstLogMessages.Received + msg.pprint()) return msg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |