summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-08-11 05:34:59 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-08-11 05:34:59 +0000
commit02fe01cef62e75e71053e30815cfd45976804ce1 (patch)
treeb8d8cb33cf212d789b7532ceca075f469ecce071
parentf1ce462da088bba87d891014c5d8b5c9eeaca238 (diff)
downloadqpid-python-02fe01cef62e75e71053e30815cfd45976804ce1.tar.gz
Fix for re-entering DispatchHandle::processEvent more than once on disconnection
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@802990 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/sys/DispatchHandle.cpp5
-rw-r--r--qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp2
2 files changed, 3 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/sys/DispatchHandle.cpp b/qpid/cpp/src/qpid/sys/DispatchHandle.cpp
index d65cd8a427..605edabc64 100644
--- a/qpid/cpp/src/qpid/sys/DispatchHandle.cpp
+++ b/qpid/cpp/src/qpid/sys/DispatchHandle.cpp
@@ -284,10 +284,7 @@ void DispatchHandle::processEvent(Poller::EventType type) {
readableCallback(*this);
writableCallback(*this);
break;
- case Poller::DISCONNECTED: {
- ScopedLock<Mutex> lock(stateLock);
- poller->unmonitorHandle(*this, Poller::INOUT);
- }
+ case Poller::DISCONNECTED:
if (disconnectedCallback) {
disconnectedCallback(*this);
}
diff --git a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
index 5a6b8987ec..09f3f8edc7 100644
--- a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
+++ b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
@@ -575,6 +575,8 @@ Poller::Event Poller::wait(Duration timeout) {
// (just not writable), allow us to readable until we get here again
if (epe.events & ::EPOLLHUP) {
if (eh.isHungup()) {
+ // Don't set up last Handle so that we don't reset this handle
+ // when we get back in here
return Event(handle, DISCONNECTED);
}
eh.setHungup();