qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r757807 - in /qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster: Decoder.cpp EventFrame.cpp
Date Tue, 24 Mar 2009 14:06:03 GMT
Author: gsim
Date: Tue Mar 24 14:06:01 2009
New Revision: 757807

URL: http://svn.apache.org/viewvc?rev=757807&view=rev
Log:
QPID-1771: fix for the codepath where an empty frame is sent to trigger read credit


Modified:
    qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/Decoder.cpp
    qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/EventFrame.cpp

Modified: qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/Decoder.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/Decoder.cpp?rev=757807&r1=757806&r2=757807&view=diff
==============================================================================
--- qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/Decoder.cpp (original)
+++ qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/Decoder.cpp Tue Mar 24 14:06:01 2009
@@ -47,12 +47,13 @@
         // We must give 1 unit read credit per event.
         // This event does not complete any frames so 
         // send an empty frame with the read credit.
-        process(EventFrame(EventHeader(), framing::AMQFrame(), 1));
+        process(EventFrame(eh, framing::AMQFrame(), 1));
     }    
 }
 
 void Decoder::process(const EventFrame& ef) {
-    if (ef.frame.getMethod() && ef.frame.getMethod()->isA<framing::ClusterConnectionDeliverCloseBody>())
+    //need to check that this is not the empty frame mentioned above
+    if (ef.frame.getBody() && ef.frame.getMethod() && ef.frame.getMethod()->isA<framing::ClusterConnectionDeliverCloseBody>())
         map.erase(ef.connectionId);
     callback(ef);
 }

Modified: qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/EventFrame.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/EventFrame.cpp?rev=757807&r1=757806&r2=757807&view=diff
==============================================================================
--- qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/EventFrame.cpp (original)
+++ qpid/branches/0.5-release/qpid/cpp/src/qpid/cluster/EventFrame.cpp Tue Mar 24 14:06:01
2009
@@ -33,7 +33,9 @@
 }
 
 std::ostream& operator<<(std::ostream& o, const EventFrame& e) {
-    return o << e.frame  << " " << e.type << " " << e.connectionId;
+    if (e.frame.getBody()) o << e.frame;
+    else o << "null-frame";
+    o << " " << e.type << " " << e.connectionId;
     if (e.readCredit) o << " read-credit=" << e.readCredit;
     return o;
 }



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


Mime
View raw message