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 | b0c7de4902c6126001293f1625e31356cc8ba524 (patch) | |
tree | 6299724af8ccb6a2ed45f09c37b0a2866dd75831 | |
parent | ea565655ad5ca79a94f5863a4d76506f49ca8956 (diff) | |
download | qpid-python-b0c7de4902c6126001293f1625e31356cc8ba524.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/qpid@829815 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/amqp_0_10/SessionHandler.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp b/cpp/src/qpid/amqp_0_10/SessionHandler.cpp index 014e057968..5f97d292bc 100644 --- a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp +++ b/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)) |