Author: gsim
Date: Thu Jun 11 01:59:16 2009
New Revision: 783599

URL: http://svn.apache.org/viewvc?rev=783599&view=rev
Log:
If frameset being sent in cluster update is incomplete (i.e. content has been 
released) then send frames as is (will just be header).


Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp?rev=783599&r1=783598&r2=783599&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp Thu Jun 11 01:59:16 2009
@@ -289,6 +289,16 @@
 }
 
 namespace {
+// Functor for FrameSet::map to send header + content frames but, not method 
frames.
+struct SendContentFn {
+    FrameHandler& handler;
+    void operator()(const AMQFrame& f) {
+        if (!f.getMethod()) 
+            handler(const_cast<AMQFrame&>(f));
+    }
+    SendContentFn(FrameHandler& h) : handler(h) {}
+};
+
 // Adaptor to make FrameSet look like MethodContent; used in cluster update 
client
 struct MethodContentAdaptor : MethodContent
 {
@@ -327,8 +337,13 @@
     frame.setEof(false);
     handleOut(frame);
 
-    MethodContentAdaptor c(content);
-    sendContent(c);
+    if (content.isComplete()) {
+        MethodContentAdaptor c(content);
+        sendContent(c);
+    } else {
+        SendContentFn send(out);
+        content.map(send);
+    }
     return f;
 }
 



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

Reply via email to