summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-12-03 16:12:11 +0000
committerTed Ross <tross@apache.org>2008-12-03 16:12:11 +0000
commit778f7637bea8a154cc05579e80b5ac14ed4bd2da (patch)
tree255cb8172578cc3c7ea5884cbe5e0dbd6025f344
parentbc880dbccf6c82d1e709a03536bda7bcdee52590 (diff)
downloadqpid-python-778f7637bea8a154cc05579e80b5ac14ed4bd2da.tar.gz
QPID-1513 - Fix corner case where incompleted schema records are
not completed if the agent disconnects mid-startup. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@722953 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/management/ManagementBroker.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/management/ManagementBroker.cpp b/qpid/cpp/src/qpid/management/ManagementBroker.cpp
index 7a092bbb1b..7082859948 100644
--- a/qpid/cpp/src/qpid/management/ManagementBroker.cpp
+++ b/qpid/cpp/src/qpid/management/ManagementBroker.cpp
@@ -612,7 +612,7 @@ void ManagementBroker::handleClassIndLH (Buffer& inBuffer, string replyToKey, ui
PackageMap::iterator pIter = findOrAddPackageLH(packageName);
ClassMap::iterator cIter = pIter->second.find(key);
- if (cIter == pIter->second.end()) {
+ if (cIter == pIter->second.end() || !cIter->second.hasSchema()) {
Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
uint32_t outLen;
uint32_t sequence = nextRequestSequence++;
@@ -625,6 +625,9 @@ void ManagementBroker::handleClassIndLH (Buffer& inBuffer, string replyToKey, ui
outBuffer.reset ();
sendBuffer (outBuffer, outLen, dExchange, replyToKey);
+ if (cIter != pIter->second.end())
+ pIter->second.erase(key);
+
pIter->second.insert(pair<SchemaClassKey, SchemaClass>(key, SchemaClass(kind, sequence)));
}
}
@@ -697,8 +700,7 @@ void ManagementBroker::handleSchemaResponseLH(Buffer& inBuffer, string /*replyTo
if (length == 0) {
QPID_LOG(warning, "Management Broker received invalid schema response: " << packageName << "." << key.name);
cMap.erase(key);
- }
- else {
+ } else {
cIter->second.buffer = (uint8_t*) malloc(length);
cIter->second.bufferLen = length;
inBuffer.getRawData(cIter->second.buffer, cIter->second.bufferLen);