Author: astitcher
Date: Tue Oct 16 04:58:00 2007
New Revision: 585127

URL: http://svn.apache.org/viewvc?rev=585127&view=rev
Log:
Log a warning if we close a connection with unsent data

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h?rev=585127&r1=585126&r2=585127&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h Tue Oct 16 04:58:00 
2007
@@ -106,9 +106,10 @@
 
     void start(Poller::shared_ptr poller);
     void queueReadBuffer(BufferBase* buff);
-    void queueWrite(BufferBase* buff = 0);
     void unread(BufferBase* buff);
+    void queueWrite(BufferBase* buff = 0);
     void queueWriteClose();
+    bool writeQueueEmpty() { return writeQueue.empty(); }
     BufferBase* getQueuedBuffer();
     const Socket& getSocket() const { return DispatchHandle::getSocket(); }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp?rev=585127&r1=585126&r2=585127&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp Tue Oct 16 
04:58:00 2007
@@ -246,6 +246,10 @@
 }
 
 void AsynchIOHandler::closedSocket(AsynchIO&, const Socket& s) {
+    // If we closed with data still to send log a warning 
+    if (!aio->writeQueueEmpty()) {
+        QPID_LOG(warning, "CLOSING [" << aio->getSocket().getPeerAddress() << 
"] unsent data (probably due to client disconnect)");
+    }
        delete &s;
        aio->queueForDeletion();
        delete this;


Reply via email to