Fossil SCM
Always go at least two rounds on a clone since configuration data is not sent until the second round. Ticket [8473eeb9ffb012e1d]
Commit
addf6709812a3b6c0cbf7d90f26ca68577cd9327
Parent
f15943f3399ae79…
1 file changed
+7
-3
+7
-3
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1391,11 +1391,11 @@ | ||
| 1391 | 1391 | } |
| 1392 | 1392 | if( zPCode==0 ){ |
| 1393 | 1393 | zPCode = mprintf("%b", &xfer.aToken[2]); |
| 1394 | 1394 | db_set("project-code", zPCode, 0); |
| 1395 | 1395 | } |
| 1396 | - blob_appendf(&send, "clone 3 %d\n", cloneSeqno); | |
| 1396 | + if( cloneSeqno>0 ) blob_appendf(&send, "clone 3 %d\n", cloneSeqno); | |
| 1397 | 1397 | nCardSent++; |
| 1398 | 1398 | }else |
| 1399 | 1399 | |
| 1400 | 1400 | /* config NAME SIZE \n CONTENT |
| 1401 | 1401 | ** |
| @@ -1563,12 +1563,16 @@ | ||
| 1563 | 1563 | } |
| 1564 | 1564 | |
| 1565 | 1565 | /* If this is a clone, the go at least two rounds */ |
| 1566 | 1566 | if( cloneFlag && nCycle==1 ) go = 1; |
| 1567 | 1567 | |
| 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; | |
| 1570 | 1574 | }; |
| 1571 | 1575 | transport_stats(&nSent, &nRcvd, 1); |
| 1572 | 1576 | fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n", |
| 1573 | 1577 | nSent, nRcvd); |
| 1574 | 1578 | transport_close(); |
| 1575 | 1579 |
| --- 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 |