summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-02-11 17:29:42 +0000
committerAlan Conway <aconway@apache.org>2009-02-11 17:29:42 +0000
commit86d5aa7ccc3fb6e9cf23a52e8b2d69aae53692f7 (patch)
treec9474aaa4a191b8ac5aba63a03f45a5c227cf067 /cpp/src/qpid/cluster
parent67460e0818bd5617cb84a6ae44c33ef8a11ac0a0 (diff)
downloadqpid-python-86d5aa7ccc3fb6e9cf23a52e8b2d69aae53692f7.tar.gz
Fix race condition with read-credit.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@743416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster')
-rw-r--r--cpp/src/qpid/cluster/Connection.cpp1
-rw-r--r--cpp/src/qpid/cluster/ConnectionMap.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp
index d97a1b6c68..4a13d24499 100644
--- a/cpp/src/qpid/cluster/Connection.cpp
+++ b/cpp/src/qpid/cluster/Connection.cpp
@@ -210,6 +210,7 @@ size_t Connection::decode(const char* buffer, size_t size) {
remainingSize = size - pi.encodedSize();
} else {
QPID_LOG(debug, "Not enough data for protocol header on outgoing clustered link");
+ giveReadCredit(1); // We're not going to mcast so give read credit now.
return 0;
}
}
diff --git a/cpp/src/qpid/cluster/ConnectionMap.cpp b/cpp/src/qpid/cluster/ConnectionMap.cpp
index 064e3cd252..b412bb13cc 100644
--- a/cpp/src/qpid/cluster/ConnectionMap.cpp
+++ b/cpp/src/qpid/cluster/ConnectionMap.cpp
@@ -66,6 +66,7 @@ ConnectionMap::ConnectionPtr ConnectionMap::get(const ConnectionId& id) {
ConnectionMap::ConnectionPtr ConnectionMap::getLocal(const ConnectionId& id) {
if (id.getMember() != cluster.getId()) return 0;
Map::const_iterator i = map.find(id);
+ assert(i != map.end()); // FIXME aconway 2009-02-11: remove or exception.
return i == map.end() ? 0 : i->second;
}