qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1537985 - in /qpid/trunk/qpid/cpp/src/qpid/messaging: Receiver.cpp amqp/ConnectionContext.cpp
Date Fri, 01 Nov 2013 16:55:59 GMT
Author: gsim
Date: Fri Nov  1 16:55:59 2013
New Revision: 1537985

URL: http://svn.apache.org/r1537985
Log:
QPID-5286: replenish credit when using get

Modified:
    qpid/trunk/qpid/cpp/src/qpid/messaging/Receiver.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/Receiver.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/Receiver.cpp?rev=1537985&r1=1537984&r2=1537985&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/Receiver.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/Receiver.cpp Fri Nov  1 16:55:59 2013
@@ -38,7 +38,11 @@ Receiver::Receiver(ReceiverImpl* impl) {
 Receiver::Receiver(const Receiver& s) : Handle<ReceiverImpl>() { PI::copy(*this,
s); }
 Receiver::~Receiver() { PI::dtor(*this); }
 Receiver& Receiver::operator=(const Receiver& s) { return PI::assign(*this, s); }
-bool Receiver::get(Message& message, Duration timeout) { return impl->get(message,
timeout); }
+bool Receiver::get(Message& message, Duration timeout)
+{
+    MessageImplAccess::get(message).clear();
+    return impl->get(message, timeout);
+}
 Message Receiver::get(Duration timeout) { return impl->get(timeout); }
 bool Receiver::fetch(Message& message, Duration timeout)
 {

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp?rev=1537985&r1=1537984&r2=1537985&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp Fri Nov  1 16:55:59
2013
@@ -149,11 +149,6 @@ bool ConnectionContext::fetch(boost::sha
         }
     }
     if (get(ssn, lnk, message, timeout)) {
-        qpid::sys::ScopedLock<qpid::sys::Monitor> l(lock);
-        if (lnk->capacity) {
-            pn_link_flow(lnk->receiver, 1);//TODO: is this the right approach?
-            wakeupDriver();
-        }
         return true;
     } else {
         {
@@ -212,6 +207,10 @@ bool ConnectionContext::get(boost::share
             impl.setEncoded(encoded);
             impl.setInternalId(ssn->record(current));
             pn_link_advance(lnk->receiver);
+            if (lnk->capacity) {
+                pn_link_flow(lnk->receiver, 1);
+                wakeupDriver();//TODO: wakeup less frequently
+            }
             return true;
         } else if (until > qpid::sys::now()) {
             waitUntil(ssn, lnk, until);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message