qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r817711 - in /qpid/trunk/qpid/cpp/src/qpid/sys: AsynchIO.h AsynchIOHandler.cpp AsynchIOHandler.h posix/AsynchIO.cpp windows/AsynchIO.cpp
Date Tue, 22 Sep 2009 15:59:53 GMT
Author: astitcher
Date: Tue Sep 22 15:59:53 2009
New Revision: 817711

URL: http://svn.apache.org/viewvc?rev=817711&view=rev
Log:
Make the AsynchIO API more consistent

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h
    qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.h
    qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h?rev=817711&r1=817710&r2=817711&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h Tue Sep 22 15:59:53 2009
@@ -108,7 +108,7 @@
 public:
     typedef AsynchIOBufferBase BufferBase;
 
-    typedef boost::function2<bool, AsynchIO&, BufferBase*> ReadCallback;
+    typedef boost::function2<void, AsynchIO&, BufferBase*> ReadCallback;
     typedef boost::function1<void, AsynchIO&> EofCallback;
     typedef boost::function1<void, AsynchIO&> DisconnectCallback;
     typedef boost::function2<void, AsynchIO&, const Socket&> ClosedCallback;

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp?rev=817711&r1=817710&r2=817711&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp Tue Sep 22 15:59:53 2009
@@ -103,13 +103,11 @@
         aio->startReading();
 }
 
-bool AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) {
+void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) {
     if (readError) {
-        return false;
+        return;
     }
 
-    bool ret = true;
-
     // Check here for read credit
     if (readCredit.get() != InfiniteCredit) {
         // TODO In theory should be able to use an atomic operation before taking the lock
@@ -119,7 +117,6 @@
             assert(readCredit.get() >= 0);
             if (readCredit.get() == 0) {
                 aio->stopReading();
-                ret = false;
             }
         }
     }
@@ -166,7 +163,6 @@
         // Give whole buffer back to aio subsystem
         aio->queueReadBuffer(buff);
     }
-    return ret;
 }
 
 void AsynchIOHandler::eof(AsynchIO&) {

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.h?rev=817711&r1=817710&r2=817711&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.h Tue Sep 22 15:59:53 2009
@@ -65,7 +65,7 @@
     QPID_COMMON_EXTERN void giveReadCredit(int32_t credit);
 
     // Input side
-    QPID_COMMON_EXTERN bool readbuff(AsynchIO& aio, AsynchIOBufferBase* buff);
+    QPID_COMMON_EXTERN void readbuff(AsynchIO& aio, AsynchIOBufferBase* buff);
     QPID_COMMON_EXTERN void eof(AsynchIO& aio);
     QPID_COMMON_EXTERN void disconnect(AsynchIO& aio);
 

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp?rev=817711&r1=817710&r2=817711&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp Tue Sep 22 15:59:53 2009
@@ -467,7 +467,8 @@
                 threadReadTotal += rc;
                 readTotal += rc;
 
-                if (!readCallback(*this, buff)) {
+                readCallback(*this, buff);
+                if (readingStopped) {
                     // We have been flow controlled.
                     break;
                 }

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp?rev=817711&r1=817710&r2=817711&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp Tue Sep 22 15:59:53 2009
@@ -634,7 +634,7 @@
     if (status == 0 && bytes > 0) {
         bool restartRead = true;     // May not if receiver doesn't want more
         if (readCallback)
-            restartRead = readCallback(*this, result->getBuff());
+            readCallback(*this, result->getBuff());
         if (restartRead)
             startReading();
     }



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


Mime
View raw message