diff options
author | Alan Conway <aconway@apache.org> | 2009-10-26 14:48:58 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-10-26 14:48:58 +0000 |
commit | 08cd6299501a07c343e52cdcdaf55db12fc3ab7f (patch) | |
tree | c6030e3891a9f8083870e12833e88dc2d250580b /qpid/cpp/src | |
parent | a7738b93c4cf9ac08bafcb7d25dfb939c8644b5a (diff) | |
download | qpid-python-08cd6299501a07c343e52cdcdaf55db12fc3ab7f.tar.gz |
Fix regression introduced in r828108
SessionHandler ignores all but detach/detached controls when awaitingDetached.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@829815 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r-- | qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp b/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp index 014e057968..5f97d292bc 100644 --- a/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp +++ b/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp @@ -48,12 +48,7 @@ SessionHandler::~SessionHandler() {} namespace { bool isSessionControl(AMQMethodBody* m) { - return m && - m->amqpClassId() == SESSION_CLASS_ID; - } -bool isSessionDetachedControl(AMQMethodBody* m) { - return isSessionControl(m) && - m->amqpMethodId() == SESSION_DETACHED_METHOD_ID; + return m && m->amqpClassId() == SESSION_CLASS_ID; } session::DetachCode convert(uint8_t code) { @@ -76,13 +71,19 @@ void SessionHandler::handleIn(AMQFrame& f) { // Note on channel states: a channel is attached if session != 0 AMQMethodBody* m = f.getBody()->getMethod(); try { + // Ignore all but detach controls while awaiting detach + if (awaitingDetached) { + if (!isSessionControl(m)) return; + if (m->amqpMethodId() != SESSION_DETACH_METHOD_ID && + m->amqpMethodId() != SESSION_DETACHED_METHOD_ID) + return; + } if (isSessionControl(m)) { invoke(*m); } else { - // Drop frames if we are awaiting a detached control or - // if we are currently detached. - if (awaitingDetached || !getState()) return; + // Drop frames if we are detached. + if (!getState()) return; if (!receiveReady) throw IllegalStateException(QPID_MSG(getState()->getId() << ": Not ready to receive data")); if (!getState()->receiverRecord(f)) |