summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SessionHandlerImpl.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-11-17 11:03:22 +0000
committerGordon Sim <gsim@apache.org>2006-11-17 11:03:22 +0000
commitbf74286e6a5eba055fd8bf9410c325205b8595d5 (patch)
tree46fafd1086d95b543e5b8c4927ba28daa50e7da9 /cpp/src/qpid/broker/SessionHandlerImpl.cpp
parentd965a29414762f0b3bbc840485f6327c3d523946 (diff)
downloadqpid-python-bf74286e6a5eba055fd8bf9410c325205b8595d5.tar.gz
Some fixes and tests for bugs uncovered during testing of persistence.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@476108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionHandlerImpl.cpp')
-rw-r--r--cpp/src/qpid/broker/SessionHandlerImpl.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/SessionHandlerImpl.cpp b/cpp/src/qpid/broker/SessionHandlerImpl.cpp
index b1ac30d493..bbb5d22c8d 100644
--- a/cpp/src/qpid/broker/SessionHandlerImpl.cpp
+++ b/cpp/src/qpid/broker/SessionHandlerImpl.cpp
@@ -97,6 +97,9 @@ 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());
+ }catch(std::exception& e){
+ string error(e.what());
+ client.getConnection().close(0, 541/*internal error*/, error, method->amqpClassId(), method->amqpMethodId());
}
break;
@@ -132,16 +135,20 @@ void SessionHandlerImpl::idleIn(){
}
void SessionHandlerImpl::closed(){
- for(channel_iterator i = channels.begin(); i != channels.end(); i = channels.begin()){
- Channel* c = i->second;
- channels.erase(i);
- c->close();
- delete c;
- }
- for(queue_iterator i = exclusiveQueues.begin(); i < exclusiveQueues.end(); i = exclusiveQueues.begin()){
- string name = (*i)->getName();
- queues->destroy(name);
- exclusiveQueues.erase(i);
+ try {
+ for(channel_iterator i = channels.begin(); i != channels.end(); i = channels.begin()){
+ Channel* c = i->second;
+ channels.erase(i);
+ c->close();
+ delete c;
+ }
+ for(queue_iterator i = exclusiveQueues.begin(); i < exclusiveQueues.end(); i = exclusiveQueues.begin()){
+ string name = (*i)->getName();
+ queues->destroy(name);
+ exclusiveQueues.erase(i);
+ }
+ } catch(std::exception& e) {
+ std::cout << "Caught unhandled exception while closing session: " << e.what() << std::endl;
}
}