summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-02-14 16:07:25 +0000
committerAlan Conway <aconway@apache.org>2012-02-14 16:07:25 +0000
commit1693fee9a3a229a6859d5eecccbee13350f68cde (patch)
treeed6a7b5959e7521c668b729b0b8b55f80950b461
parent5e6f453bde641e2c666e762e7383c8672d87980b (diff)
downloadqpid-python-1693fee9a3a229a6859d5eecccbee13350f68cde.tar.gz
QPID-3603: Do case-insensitive string comparison for replication levels.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3603-6@1244073 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/ha/BrokerReplicator.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp
index 7fd224d753..a496ab7583 100644
--- a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp
+++ b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp
@@ -35,6 +35,7 @@
#include "qmf/org/apache/qpid/broker/EventQueueDeclare.h"
#include "qmf/org/apache/qpid/broker/EventQueueDelete.h"
#include "qmf/org/apache/qpid/broker/EventSubscribe.h"
+#include <algorithm>
namespace qpid {
namespace ha {
@@ -115,9 +116,11 @@ const string S_WIRING="wiring";
const string S_ALL="all";
ReplicateLevel replicateLevel(const string& str) {
+ string value(str.size(), '\0');
+ transform(str.begin(), str.end(), value.begin(), &tolower);
ReplicateLevel rl = RL_NONE;
- if (str == S_WIRING) rl = RL_WIRING;
- else if (str == S_ALL) rl = RL_ALL;
+ if (value == S_WIRING) rl = RL_WIRING;
+ else if (value == S_ALL) rl = RL_ALL;
return rl;
}