qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1671100 - in /qpid/trunk/qpid/python/qpid: client.py testlib.py
Date Fri, 03 Apr 2015 16:57:34 GMT
Author: kwall
Date: Fri Apr  3 16:57:34 2015
New Revision: 1671100

URL: http://svn.apache.org/r1671100
Log:
QPID-6475: [Python Client] 08..09 Send connection.close before closing socket

Modified:
    qpid/trunk/qpid/python/qpid/client.py
    qpid/trunk/qpid/python/qpid/testlib.py

Modified: qpid/trunk/qpid/python/qpid/client.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/client.py?rev=1671100&r1=1671099&r2=1671100&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/client.py (original)
+++ qpid/trunk/qpid/python/qpid/client.py Fri Apr  3 16:57:34 2015
@@ -127,7 +127,17 @@ class Client:
 
   def close(self):
     if self.peer:
-      self.peer.stop()
+      try:
+        if not self.closed:
+          channel = self.channel(0);
+          if channel and not channel._closed:
+             try:
+               channel.connection_close(reply_code=200)
+             except:
+               pass
+          self.closed = True
+      finally:
+        self.peer.stop()
 
 class ClientDelegate(Delegate):
 

Modified: qpid/trunk/qpid/python/qpid/testlib.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/testlib.py?rev=1671100&r1=1671099&r2=1671100&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/testlib.py (original)
+++ qpid/trunk/qpid/python/qpid/testlib.py Fri Apr  3 16:57:34 2015
@@ -71,10 +71,7 @@ class TestBase(unittest.TestCase):
             print "Error on tearDown:"
             print traceback.print_exc()
 
-        if not self.client.closed:
-            self.client.channel(0).connection_close(reply_code=200)
-        else:
-            self.client.close()
+        self.client.close()
 
     def connect(self, host=None, port=None, user=None, password=None, tune_params=None, client_properties=None):
         """Create a new connction, return the Client object"""



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message