Fossil SCM

Always go at least two rounds on a clone since configuration data is not sent until the second round. Ticket [8473eeb9ffb012e1d]

drh 2011-02-09 03:33 trunk
Commit addf6709812a3b6c0cbf7d90f26ca68577cd9327
1 file changed +7 -3
+7 -3
--- src/xfer.c
+++ src/xfer.c
@@ -1391,11 +1391,11 @@
13911391
}
13921392
if( zPCode==0 ){
13931393
zPCode = mprintf("%b", &xfer.aToken[2]);
13941394
db_set("project-code", zPCode, 0);
13951395
}
1396
- blob_appendf(&send, "clone 3 %d\n", cloneSeqno);
1396
+ if( cloneSeqno>0 ) blob_appendf(&send, "clone 3 %d\n", cloneSeqno);
13971397
nCardSent++;
13981398
}else
13991399
14001400
/* config NAME SIZE \n CONTENT
14011401
**
@@ -1563,12 +1563,16 @@
15631563
}
15641564
15651565
/* If this is a clone, the go at least two rounds */
15661566
if( cloneFlag && nCycle==1 ) go = 1;
15671567
1568
- /* Stop the cycle if the server sends a "clone_seqno 0" card */
1569
- if( cloneSeqno<=0 ) go = 0;
1568
+ /* Stop the cycle if the server sends a "clone_seqno 0" card and
1569
+ ** we have gone at least two rounds. Always go at least two rounds
1570
+ ** on a clone in order to be sure to retrieve the configuration
1571
+ ** information which is only sent on the second round.
1572
+ */
1573
+ if( cloneSeqno<=0 && nCycle>1 ) go = 0;
15701574
};
15711575
transport_stats(&nSent, &nRcvd, 1);
15721576
fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n",
15731577
nSent, nRcvd);
15741578
transport_close();
15751579
--- src/xfer.c
+++ src/xfer.c
@@ -1391,11 +1391,11 @@
1391 }
1392 if( zPCode==0 ){
1393 zPCode = mprintf("%b", &xfer.aToken[2]);
1394 db_set("project-code", zPCode, 0);
1395 }
1396 blob_appendf(&send, "clone 3 %d\n", cloneSeqno);
1397 nCardSent++;
1398 }else
1399
1400 /* config NAME SIZE \n CONTENT
1401 **
@@ -1563,12 +1563,16 @@
1563 }
1564
1565 /* If this is a clone, the go at least two rounds */
1566 if( cloneFlag && nCycle==1 ) go = 1;
1567
1568 /* Stop the cycle if the server sends a "clone_seqno 0" card */
1569 if( cloneSeqno<=0 ) go = 0;
 
 
 
 
1570 };
1571 transport_stats(&nSent, &nRcvd, 1);
1572 fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n",
1573 nSent, nRcvd);
1574 transport_close();
1575
--- src/xfer.c
+++ src/xfer.c
@@ -1391,11 +1391,11 @@
1391 }
1392 if( zPCode==0 ){
1393 zPCode = mprintf("%b", &xfer.aToken[2]);
1394 db_set("project-code", zPCode, 0);
1395 }
1396 if( cloneSeqno>0 ) blob_appendf(&send, "clone 3 %d\n", cloneSeqno);
1397 nCardSent++;
1398 }else
1399
1400 /* config NAME SIZE \n CONTENT
1401 **
@@ -1563,12 +1563,16 @@
1563 }
1564
1565 /* If this is a clone, the go at least two rounds */
1566 if( cloneFlag && nCycle==1 ) go = 1;
1567
1568 /* Stop the cycle if the server sends a "clone_seqno 0" card and
1569 ** we have gone at least two rounds. Always go at least two rounds
1570 ** on a clone in order to be sure to retrieve the configuration
1571 ** information which is only sent on the second round.
1572 */
1573 if( cloneSeqno<=0 && nCycle>1 ) go = 0;
1574 };
1575 transport_stats(&nSent, &nRcvd, 1);
1576 fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n",
1577 nSent, nRcvd);
1578 transport_close();
1579

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button