You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2007/01/18 09:11:13 UTC

svn commit: r497341 - in /incubator/qpid/trunk/qpid/cpp/lib: broker/SessionHandlerImpl.cpp common/sys/apr/LFSessionContext.cpp

Author: gsim
Date: Thu Jan 18 00:11:12 2007
New Revision: 497341

URL: http://svn.apache.org/viewvc?view=rev&rev=497341
Log:
Close connection when connection.close is sent to client.


Modified:
    incubator/qpid/trunk/qpid/cpp/lib/broker/SessionHandlerImpl.cpp
    incubator/qpid/trunk/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp

Modified: incubator/qpid/trunk/qpid/cpp/lib/broker/SessionHandlerImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/lib/broker/SessionHandlerImpl.cpp?view=diff&rev=497341&r1=497340&r2=497341
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/lib/broker/SessionHandlerImpl.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/lib/broker/SessionHandlerImpl.cpp Thu Jan 18 00:11:12 2007
@@ -105,9 +105,11 @@
             client->getChannel().close(channel, e.code, e.text, method->amqpClassId(), method->amqpMethodId());
         }catch(ConnectionException& e){
             client->getConnection().close(0, e.code, e.text, method->amqpClassId(), method->amqpMethodId());
+            context->close();
         }catch(std::exception& e){
             string error(e.what());
             client->getConnection().close(0, 541/*internal error*/, error, method->amqpClassId(), method->amqpMethodId());
+            context->close();
         }
 	break;
 

Modified: incubator/qpid/trunk/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp?view=diff&rev=497341&r1=497340&r2=497341
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp Thu Jan 18 00:11:12 2007
@@ -145,8 +145,8 @@
 }
 
 void LFSessionContext::close(){
-    closing = true;
     Mutex::ScopedLock l(writeLock);
+    closing = true;
     if(!processing){
         //allow pending frames to be written to socket
         fd.reqevents = APR_POLLOUT;