diff options
author | Alan Conway <aconway@apache.org> | 2007-02-21 20:09:23 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-02-21 20:09:23 +0000 |
commit | 1c203bb498cbcbd8d36cb87e7703579a0679f1c6 (patch) | |
tree | 5fcd713f308d6eac052c825d615a7d94a5869fe1 /cpp | |
parent | 876d0b94c37f252b08c81656386100fad18a8a46 (diff) | |
download | qpid-python-1c203bb498cbcbd8d36cb87e7703579a0679f1c6.tar.gz |
Fix spurious error message printed by client when broker closes connection.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@510180 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/lib/client/Connector.cpp | 8 | ||||
-rw-r--r-- | cpp/lib/common/sys/apr/Socket.cpp | 7 |
2 files changed, 10 insertions, 5 deletions
diff --git a/cpp/lib/client/Connector.cpp b/cpp/lib/client/Connector.cpp index 657ee77f1a..ee90e6cd4c 100644 --- a/cpp/lib/client/Connector.cpp +++ b/cpp/lib/client/Connector.cpp @@ -113,14 +113,16 @@ void Connector::handleClosed(){ void Connector::checkIdle(ssize_t status){ if(timeoutHandler){ - Time t = now() * TIME_MSEC; + Time t = now() * TIME_MSEC; if(status == Socket::SOCKET_TIMEOUT) { if(idleIn && (t - lastIn > idleIn)){ timeoutHandler->idleIn(); } - }else if(status == Socket::SOCKET_EOF){ + } + else if(status == 0 || status == Socket::SOCKET_EOF) { handleClosed(); - }else{ + } + else { lastIn = t; } if(idleOut && (t - lastOut > idleOut)){ diff --git a/cpp/lib/common/sys/apr/Socket.cpp b/cpp/lib/common/sys/apr/Socket.cpp index 336eb4996a..bca4da6c96 100644 --- a/cpp/lib/common/sys/apr/Socket.cpp +++ b/cpp/lib/common/sys/apr/Socket.cpp @@ -75,9 +75,12 @@ ssize_t Socket::recv(void* data, size_t size) apr_size_t received = size; apr_status_t status = apr_socket_recv(socket, reinterpret_cast<char*>(data), &received); - if (APR_STATUS_IS_TIMEUP(status)) return SOCKET_TIMEOUT; + if (APR_STATUS_IS_TIMEUP(status)) + return SOCKET_TIMEOUT; + if (APR_STATUS_IS_EOF(status)) + return SOCKET_EOF; CHECK_APR_SUCCESS(status); - return received; + return received; } |