From 4012928a4b695dde4d1355b3b78a4ae1b4737b35 Mon Sep 17 00:00:00 2001 From: kpl Date: Mon, 16 Jun 2014 11:39:10 -0700 Subject: [PATCH] cmRtNet.c : _cmRtNetCreateNode() now reuses a node record if a new node with the same name as an existing node attempts to synchronize. --- cmRtNet.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmRtNet.c b/cmRtNet.c index d7b9110..a6f0060 100644 --- a/cmRtNet.c +++ b/cmRtNet.c @@ -191,16 +191,18 @@ cmRtNetRC_t _cmRtNetCreateNode( cmRtNet_t* p, const cmChar_t* label, unsigned rt return cmErrMsg(&p->err,kInvalidLabelNetRC,"A null or blank node label was encountered."); if((np = _cmRtNetFindNode(p,label)) != NULL ) - return cmErrMsg(&p->err,kDuplLabelNetRC,"The node label '%s' is already in use.",cmStringNullGuard(label)); - - np = cmMemAllocZ(cmRtNetNode_t,1); - np->label = cmMemAllocStr(label); + cmErrWarnMsg(&p->err,kDuplLabelNetRC,"The node label '%s' is already in use.",cmStringNullGuard(label)); + else + { + np = cmMemAllocZ(cmRtNetNode_t,1); + np->label = cmMemAllocStr(label); + } if( saddr != NULL ) np->sockaddr = *saddr; np->rtSubIdx = rtSubIdx; - np->addr = addr==NULL ? NULL : cmMemAllocStr(addr); + np->addr = addr==NULL ? NULL : cmMemResizeStr(np->addr,addr); np->port = port; np->flags = flags; np->endPtCnt = endPtCnt;