From b83efc69f6c51ae4cf388b78830e4d853b662a7a Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 18 Jan 2007 08:11:12 +0000 Subject: Close connection when connection.close is sent to client. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@497341 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/lib/broker/SessionHandlerImpl.cpp | 2 ++ qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/lib') diff --git a/qpid/cpp/lib/broker/SessionHandlerImpl.cpp b/qpid/cpp/lib/broker/SessionHandlerImpl.cpp index 5ebc8c3709..da49a94d68 100644 --- a/qpid/cpp/lib/broker/SessionHandlerImpl.cpp +++ b/qpid/cpp/lib/broker/SessionHandlerImpl.cpp @@ -105,9 +105,11 @@ void SessionHandlerImpl::received(qpid::framing::AMQFrame* frame){ 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; diff --git a/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp b/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp index f0804f6c72..9b12747a97 100644 --- a/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp +++ b/qpid/cpp/lib/common/sys/apr/LFSessionContext.cpp @@ -145,8 +145,8 @@ void LFSessionContext::stopProcessing(){ } 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; -- cgit v1.2.1