diff options
| author | Alan Conway <aconway@apache.org> | 2009-11-17 18:09:01 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2009-11-17 18:09:01 +0000 |
| commit | ef7728a725272b88c3cd2f81f81ee60ed00cde90 (patch) | |
| tree | 5083904bb1324c93cf399c6c8b04ee4f0cb03549 /cpp/src/qpid/cluster/Cpg.cpp | |
| parent | 74c1740d54360bb4b091b5486c69f0f945d27abd (diff) | |
| download | qpid-python-ef7728a725272b88c3cd2f81f81ee60ed00cde90.tar.gz | |
cluster::InitialStatusMap and unit tests, support for improved cluster join protocol.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@881420 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cpg.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/Cpg.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cpp/src/qpid/cluster/Cpg.cpp b/cpp/src/qpid/cluster/Cpg.cpp index 316b5386f1..49a814b848 100644 --- a/cpp/src/qpid/cluster/Cpg.cpp +++ b/cpp/src/qpid/cluster/Cpg.cpp @@ -217,12 +217,15 @@ MemberId Cpg::self() const { namespace { int byte(uint32_t value, int i) { return (value >> (i*8)) & 0xff; } } -ostream& operator <<(ostream& out, const MemberId& id) { - out << byte(id.first, 0) << "." - << byte(id.first, 1) << "." - << byte(id.first, 2) << "." - << byte(id.first, 3); - return out << ":" << id.second; +ostream& operator<<(ostream& out, const MemberId& id) { + if (id.first) { + out << byte(id.first, 0) << "." + << byte(id.first, 1) << "." + << byte(id.first, 2) << "." + << byte(id.first, 3) + << ":"; + } + return out << id.second; } ostream& operator<<(ostream& o, const ConnectionId& c) { |
