diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2007-10-16 11:58:00 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2007-10-16 11:58:00 +0000 |
| commit | 63a32405599b580edf82ae49c632c3dd5955ce8d (patch) | |
| tree | c747c1a43e5d1ee9c9322bf70fe092907f7e89ff /cpp/src/qpid/sys | |
| parent | 0446a5ab23584549ffe8bf78603e7659cf2d8046 (diff) | |
| download | qpid-python-63a32405599b580edf82ae49c632c3dd5955ce8d.tar.gz | |
Log a warning if we close a connection with unsent data
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585127 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys')
| -rw-r--r-- | cpp/src/qpid/sys/AsynchIO.h | 3 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/AsynchIOAcceptor.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/AsynchIO.h b/cpp/src/qpid/sys/AsynchIO.h index ea2badf456..7cb56b30aa 100644 --- a/cpp/src/qpid/sys/AsynchIO.h +++ b/cpp/src/qpid/sys/AsynchIO.h @@ -106,9 +106,10 @@ public: 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(); } diff --git a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp index 78b156877a..6f5c85cfc2 100644 --- a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp +++ b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp @@ -246,6 +246,10 @@ void AsynchIOHandler::eof(AsynchIO&) { } 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; |
