소스 검색

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 년 전
부모
커밋
4012928a4b
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 7
    5
      cmRtNet.c

+ 7
- 5
cmRtNet.c 파일 보기

@@ -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;

Loading…
취소
저장