[Zodb-checkins] CVS: Packages/ZEO - zrpc.py:1.18

jeremy@digicool.com jeremy@digicool.com
Wed, 30 May 2001 17:51:46 -0400 (EDT)


Update of /cvs-repository/Packages/ZEO
In directory korak.digicool.com:/tmp/cvs-serv16035

Modified Files:
	zrpc.py 
Log Message:
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.



--- Updated File zrpc.py in package Packages/ZEO --
--- zrpc.py	2001/05/22 18:05:43	1.17
+++ zrpc.py	2001/05/30 21:51:46	1.18
@@ -287,12 +287,15 @@
             # We aren't willing to close until told to by the main loop.
             # So we'll tell the main loop to tell us. :)
             self.__Wakeup(lambda self=self: self.close()) 
-        else: self.close()
+        else:
+            self.close()
+            self.__closed = 1
         
     def close(self):
         asyncRPC.inheritedAttribute('close')(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.__closed = 1
         try: self.__lr()
         except: pass