SF.net SVN: fclient: [451] trunk/fcp2/src/fcp2/client.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-01 08:03:45
|
Revision: 451
http://fclient.svn.sourceforge.net/fclient/?rev=451&view=rev
Author: jUrner
Date: 2008-07-01 01:03:55 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
added hack to handle persistents from other clients (kill them with fire ;-)
Modified Paths:
--------------
trunk/fcp2/src/fcp2/client.py
Modified: trunk/fcp2/src/fcp2/client.py
===================================================================
--- trunk/fcp2/src/fcp2/client.py 2008-07-01 08:03:27 UTC (rev 450)
+++ trunk/fcp2/src/fcp2/client.py 2008-07-01 08:03:55 UTC (rev 451)
@@ -142,7 +142,7 @@
#
# suggested dropping of global persistents. pretty dangerous and unhandy imo.
#
-#
+#FIX: at least some are implemented in the client
#--------------------------------------------------------------------------------------------------------------------------------------------------
@@ -878,7 +878,7 @@
if initialRequest is None:
if CancelPersistentRequests:
self.sendMessage(
- message.RemovePersistentRequest(
+ message.RemoveRequest(
Identifier=msg['Identifier'],
Global=msg['Global'],
)
@@ -1120,8 +1120,18 @@
@note: use this method to run the client step by step. If you want to run the
client unconditionally use L{run}
"""
+
+ #FIX: [0002083] we may run into persistents of other clients by accident. the client can not handle them.
+ # so remove them, no matter what....
+ def hackyInvalidMessageCallback(msg, requests=self._requests):
+ if msg == message.PersistentGet or msg == message.PersistentPut or msg == message.PersistentPutDir:
+ requestIdentifier = msg['Identifier']
+ if requestIdentifier not in requests:
+ msgRemove = message.RemoveRequest(Identifier=msg['Identifier'], Global=msg['Global'])
+ self.sendMessage(msgRemove)
+
try:
- msg = self.ioHandler.readMessage()
+ msg = self.ioHandler.readMessage(hackyInvalidMessageCallback=hackyInvalidMessageCallback)
except consts.IOTimeoutError, details:
msg = message.ClientSocketTimeout()
if dispatch:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|