From d862001d16a4ab7ba9490e99d563fb3d86eb2b3c Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Tue, 12 Oct 2010 16:04:56 +0000 Subject: Account for seemingly getting reject messages after already getting established event. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1021820 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/RdmaConnector.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/client/RdmaConnector.cpp') diff --git a/cpp/src/qpid/client/RdmaConnector.cpp b/cpp/src/qpid/client/RdmaConnector.cpp index 026952bd99..5558e27752 100644 --- a/cpp/src/qpid/client/RdmaConnector.cpp +++ b/cpp/src/qpid/client/RdmaConnector.cpp @@ -247,6 +247,8 @@ void RdmaConnector::disconnected() { aio->requestCallback(boost::bind(&RdmaConnector::drained, this)); } +// Bizarrely we seem to get rejected events *after* we've already got a connected event for some peer disconnects +// so we need to check whether the data connection is started or not in here void RdmaConnector::rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams& cp) { QPID_LOG(debug, "Connection Rejected " << identifier << ": " << cp.maxRecvBufferSize); { @@ -255,7 +257,11 @@ void RdmaConnector::rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusiv if (!polling) return; polling = false; } - connectionStopped(acon); + if (dataConnected) { + disconnected(); + } else { + connectionStopped(acon); + } } void RdmaConnector::dataError(Rdma::AsynchIO&) { -- cgit v1.2.1