Fossil SCM

Consolidated two related tests in the sync protocol to avoid re-testing a flag twice and to bring related code closer together.

wyoung 2022-10-27 16:01 trunk
Commit 6293b282097d2ca1c47205ddef19740f176faee9654334b6f0b9e75fe78a7f24
1 file changed +2 -2
+2 -2
--- src/xfer.c
+++ src/xfer.c
@@ -2807,20 +2807,20 @@
28072807
nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile;
28082808
if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
28092809
go = 1;
28102810
mxPhantomReq = nFileRecv*2;
28112811
if( mxPhantomReq<200 ) mxPhantomReq = 200;
2812
- }else if( (syncFlags & SYNC_CLONE)!=0 && nFileRecv>0 ){
2813
- go = 1;
28142812
}else if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){
28152813
/* Go another round if files are queued to send */
28162814
go = 1;
28172815
}else if( xfer.nPrivIGot>0 && nCycle==1 ){
28182816
go = 1;
28192817
}else if( (syncFlags & SYNC_CLONE)!=0 ){
28202818
if( nCycle==1 ){
28212819
go = 1; /* go at least two rounds on a clone */
2820
+ }else if( nFileRecv>0 ){
2821
+ go = 1;
28222822
}else if( cloneSeqno>0 && nArtifactRcvd>nPriorArtifact ){
28232823
/* Continue the clone until we see the clone_seqno 0" card or
28242824
** until we stop receiving artifacts */
28252825
go = 1;
28262826
}
28272827
--- src/xfer.c
+++ src/xfer.c
@@ -2807,20 +2807,20 @@
2807 nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile;
2808 if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
2809 go = 1;
2810 mxPhantomReq = nFileRecv*2;
2811 if( mxPhantomReq<200 ) mxPhantomReq = 200;
2812 }else if( (syncFlags & SYNC_CLONE)!=0 && nFileRecv>0 ){
2813 go = 1;
2814 }else if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){
2815 /* Go another round if files are queued to send */
2816 go = 1;
2817 }else if( xfer.nPrivIGot>0 && nCycle==1 ){
2818 go = 1;
2819 }else if( (syncFlags & SYNC_CLONE)!=0 ){
2820 if( nCycle==1 ){
2821 go = 1; /* go at least two rounds on a clone */
 
 
2822 }else if( cloneSeqno>0 && nArtifactRcvd>nPriorArtifact ){
2823 /* Continue the clone until we see the clone_seqno 0" card or
2824 ** until we stop receiving artifacts */
2825 go = 1;
2826 }
2827
--- src/xfer.c
+++ src/xfer.c
@@ -2807,20 +2807,20 @@
2807 nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile;
2808 if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
2809 go = 1;
2810 mxPhantomReq = nFileRecv*2;
2811 if( mxPhantomReq<200 ) mxPhantomReq = 200;
 
 
2812 }else if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){
2813 /* Go another round if files are queued to send */
2814 go = 1;
2815 }else if( xfer.nPrivIGot>0 && nCycle==1 ){
2816 go = 1;
2817 }else if( (syncFlags & SYNC_CLONE)!=0 ){
2818 if( nCycle==1 ){
2819 go = 1; /* go at least two rounds on a clone */
2820 }else if( nFileRecv>0 ){
2821 go = 1;
2822 }else if( cloneSeqno>0 && nArtifactRcvd>nPriorArtifact ){
2823 /* Continue the clone until we see the clone_seqno 0" card or
2824 ** until we stop receiving artifacts */
2825 go = 1;
2826 }
2827

Keyboard Shortcuts

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