From ef7728a725272b88c3cd2f81f81ee60ed00cde90 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 17 Nov 2009 18:09:01 +0000 Subject: 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 --- cpp/src/qpid/cluster/Cpg.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'cpp/src/qpid/cluster/Cpg.cpp') 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) { -- cgit v1.2.1