Ver código fonte

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 anos atrás
pai
commit
4012928a4b
1 arquivos alterados com 7 adições e 5 exclusões
  1. 7
    5
      cmRtNet.c

+ 7
- 5
cmRtNet.c Ver arquivo

@@ -191,16 +191,18 @@ cmRtNetRC_t _cmRtNetCreateNode( cmRtNet_t* p, const cmChar_t* label, unsigned rt
191 191
     return cmErrMsg(&p->err,kInvalidLabelNetRC,"A null or blank node label was encountered.");
192 192
 
193 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 201
   if( saddr != NULL )
200 202
     np->sockaddr = *saddr;
201 203
 
202 204
   np->rtSubIdx = rtSubIdx;
203
-  np->addr     = addr==NULL ? NULL : cmMemAllocStr(addr);
205
+  np->addr     = addr==NULL ? NULL : cmMemResizeStr(np->addr,addr);
204 206
   np->port     = port;
205 207
   np->flags    = flags;
206 208
   np->endPtCnt = endPtCnt;

Carregando…
Cancelar
Salvar