Fossil SCM
Consolidated two related tests in the sync protocol to avoid re-testing a flag twice and to bring related code closer together.
Commit
6293b282097d2ca1c47205ddef19740f176faee9654334b6f0b9e75fe78a7f24
Parent
1b1887cb69da77e…
1 file changed
+2
-2
+2
-2
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -2807,20 +2807,20 @@ | ||
| 2807 | 2807 | nFileRecv = xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile; |
| 2808 | 2808 | if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){ |
| 2809 | 2809 | go = 1; |
| 2810 | 2810 | mxPhantomReq = nFileRecv*2; |
| 2811 | 2811 | if( mxPhantomReq<200 ) mxPhantomReq = 200; |
| 2812 | - }else if( (syncFlags & SYNC_CLONE)!=0 && nFileRecv>0 ){ | |
| 2813 | - go = 1; | |
| 2814 | 2812 | }else if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){ |
| 2815 | 2813 | /* Go another round if files are queued to send */ |
| 2816 | 2814 | go = 1; |
| 2817 | 2815 | }else if( xfer.nPrivIGot>0 && nCycle==1 ){ |
| 2818 | 2816 | go = 1; |
| 2819 | 2817 | }else if( (syncFlags & SYNC_CLONE)!=0 ){ |
| 2820 | 2818 | if( nCycle==1 ){ |
| 2821 | 2819 | go = 1; /* go at least two rounds on a clone */ |
| 2820 | + }else if( nFileRecv>0 ){ | |
| 2821 | + go = 1; | |
| 2822 | 2822 | }else if( cloneSeqno>0 && nArtifactRcvd>nPriorArtifact ){ |
| 2823 | 2823 | /* Continue the clone until we see the clone_seqno 0" card or |
| 2824 | 2824 | ** until we stop receiving artifacts */ |
| 2825 | 2825 | go = 1; |
| 2826 | 2826 | } |
| 2827 | 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( (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 |