You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2009/10/26 15:48:58 UTC

svn commit: r829815 - /qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp

Author: aconway
Date: Mon Oct 26 14:48:58 2009
New Revision: 829815

URL: http://svn.apache.org/viewvc?rev=829815&view=rev
Log:
Fix regression introduced in r828108

SessionHandler ignores all but detach/detached controls when awaitingDetached.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp?rev=829815&r1=829814&r2=829815&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp Mon Oct 26 14:48:58 2009
@@ -48,12 +48,7 @@
 
 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 @@
     // 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))



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org