Commit 28e8004c authored by Jeremy Hylton's avatar Jeremy Hylton

Set self.__closed in closeIntensionally() rather than close().

closeIntensionally() is called when the storage's close() method is
called.  close() is called when the other end reset the connection.
The __closed should only be set with the asyncRPC object should never
re-open the connection.

Reported by Dyon Balding.
parent ff04bff1
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
"""Simple rpc mechanisms """Simple rpc mechanisms
""" """
__version__ = "$Revision: 1.17 $"[11:-2] __version__ = "$Revision: 1.18 $"[11:-2]
from cPickle import loads from cPickle import loads
import cPickle import cPickle
...@@ -287,12 +287,15 @@ class asyncRPC(SizedMessageAsyncConnection): ...@@ -287,12 +287,15 @@ class asyncRPC(SizedMessageAsyncConnection):
# We aren't willing to close until told to by the main loop. # We aren't willing to close until told to by the main loop.
# So we'll tell the main loop to tell us. :) # So we'll tell the main loop to tell us. :)
self.__Wakeup(lambda self=self: self.close()) self.__Wakeup(lambda self=self: self.close())
else: self.close() else:
self.close()
self.__closed = 1
def close(self): def close(self):
asyncRPC.inheritedAttribute('close')(self) asyncRPC.inheritedAttribute('close')(self)
self.aq_parent.notifyDisconnected(self) self.aq_parent.notifyDisconnected(self)
# causes read call to raise last exception, which should be
# the socket error that caused asyncore to close the socket.
self.__r='E'+dump(sys.exc_info()[:2], 1) self.__r='E'+dump(sys.exc_info()[:2], 1)
self.__closed = 1
try: self.__lr() try: self.__lr()
except: pass except: pass
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment