Author: aconway
Date: Wed Jan 6 17:01:12 2010
New Revision: 896537
URL: http://svn.apache.org/viewvc?rev=896537&view=rev
Log:
Exception handling for URL parsing in cluster.
Modified:
qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterMap.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=896537&r1=896536&r2=896537&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Wed Jan 6 17:01:12 2010
@@ -687,11 +687,15 @@
}
void Cluster::ready(const MemberId& id, const std::string& url, Lock& l) {
- if (map.ready(id, Url(url)))
- memberUpdate(l);
- if (state == CATCHUP && id == self) {
- setReady(l);
- QPID_LOG(notice, *this << " caught up.");
+ try {
+ if (map.ready(id, Url(url)))
+ memberUpdate(l);
+ if (state == CATCHUP && id == self) {
+ setReady(l);
+ QPID_LOG(notice, *this << " caught up.");
+ }
+ } catch (const Url::Invalid& e) {
+ QPID_LOG(error, "Invalid URL in cluster ready command: " << url);
}
}
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterMap.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterMap.cpp?rev=896537&r1=896536&r2=896537&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterMap.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterMap.cpp Wed Jan 6 17:01:12 2010
@@ -137,9 +137,13 @@
}
bool ClusterMap::updateRequest(const MemberId& id, const string& url) {
- if (isAlive(id)) {
- joiners[id] = Url(url);
- return true;
+ try {
+ if (isAlive(id)) {
+ joiners[id] = Url(url);
+ return true;
+ }
+ } catch (const Url::Invalid&) {
+ QPID_LOG(error, "Invalid URL in cluster update request: " << url);
}
return false;
}
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]