Browse Source

cmRtNet.c : _cmRtNetCreateNode() now reuses a node record if a new node with

the same name as an existing node attempts to synchronize.
master
kpl 10 years ago
parent
commit
4012928a4b
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      cmRtNet.c

+ 7
- 5
cmRtNet.c View File

191
     return cmErrMsg(&p->err,kInvalidLabelNetRC,"A null or blank node label was encountered.");
191
     return cmErrMsg(&p->err,kInvalidLabelNetRC,"A null or blank node label was encountered.");
192
 
192
 
193
   if((np = _cmRtNetFindNode(p,label)) != NULL )
193
   if((np = _cmRtNetFindNode(p,label)) != NULL )
194
-    return cmErrMsg(&p->err,kDuplLabelNetRC,"The node label '%s' is already in use.",cmStringNullGuard(label));
195
-  
196
-  np           = cmMemAllocZ(cmRtNetNode_t,1);
197
-  np->label    = cmMemAllocStr(label);
194
+    cmErrWarnMsg(&p->err,kDuplLabelNetRC,"The node label '%s' is already in use.",cmStringNullGuard(label));
195
+  else
196
+  {
197
+    np           = cmMemAllocZ(cmRtNetNode_t,1);
198
+    np->label    = cmMemAllocStr(label);
199
+  }
198
 
200
 
199
   if( saddr != NULL )
201
   if( saddr != NULL )
200
     np->sockaddr = *saddr;
202
     np->sockaddr = *saddr;
201
 
203
 
202
   np->rtSubIdx = rtSubIdx;
204
   np->rtSubIdx = rtSubIdx;
203
-  np->addr     = addr==NULL ? NULL : cmMemAllocStr(addr);
205
+  np->addr     = addr==NULL ? NULL : cmMemResizeStr(np->addr,addr);
204
   np->port     = port;
206
   np->port     = port;
205
   np->flags    = flags;
207
   np->flags    = flags;
206
   np->endPtCnt = endPtCnt;
208
   np->endPtCnt = endPtCnt;

Loading…
Cancel
Save