Fossil SCM
Extend the login card mode version check to include the date and time. It is currently still set to 2.27.1, but if/when merged then the version would need to be reverted to 2.27.0 and the version/date/time check will need to be set to compare against the trunk version from immediately before the merge. This needs more testing but looks like it will resolve the "post-2.26 trunk" incompatibility.
Commit
86cc923de4d85af54e9e9ae49fbf5f5859b162783df2661715559727925460bd
Parent
8dbcf2acba6f00b…
1 file changed
+19
-6
+19
-6
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1241,10 +1241,25 @@ | ||
| 1241 | 1241 | /* |
| 1242 | 1242 | ** If this variable is set, disable login checks. Used for debugging |
| 1243 | 1243 | ** only. |
| 1244 | 1244 | */ |
| 1245 | 1245 | static int disableLogin = 0; |
| 1246 | + | |
| 1247 | +/* | |
| 1248 | +** Must be passed the version info from pragmas | |
| 1249 | +** client-version/server-version cards. If the version info is "new | |
| 1250 | +** enough" then the loginCardMode is ORd into the X-Fossil-Xfer-Login | |
| 1251 | +** card flag, else this is a no-op. | |
| 1252 | +*/ | |
| 1253 | +static void xfer_xfxl_check(int iRemoteVersion, int iDate, int iTime, | |
| 1254 | + int fLoginCardMode){ | |
| 1255 | + if( iRemoteVersion>=22701/*needs to change back to 22700 if merged*/ | |
| 1256 | + && (iDate > 20250724 | |
| 1257 | + || (iDate == 20250724 && iTime >= 51006)) ){ | |
| 1258 | + g.syncInfo.fLoginCardMode |= fLoginCardMode; | |
| 1259 | + } | |
| 1260 | +} | |
| 1246 | 1261 | |
| 1247 | 1262 | /* |
| 1248 | 1263 | ** The CGI/HTTP preprocessor always redirects requests with a content-type |
| 1249 | 1264 | ** of application/x-fossil or application/x-fossil-debug to this page, |
| 1250 | 1265 | ** regardless of what path was specified in the HTTP header. This allows |
| @@ -1721,19 +1736,18 @@ | ||
| 1721 | 1736 | ** for the specific check-in of the client. |
| 1722 | 1737 | */ |
| 1723 | 1738 | if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "client-version") ){ |
| 1724 | 1739 | xfer.remoteVersion = g.syncInfo.remoteVersion = |
| 1725 | 1740 | atoi(blob_str(&xfer.aToken[2])); |
| 1726 | - if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){ | |
| 1727 | - g.syncInfo.fLoginCardMode |= 0x04; | |
| 1728 | - } | |
| 1729 | 1741 | if( xfer.nToken>=5 ){ |
| 1730 | 1742 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 1731 | 1743 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 1732 | 1744 | @ pragma server-version %d(RELEASE_VERSION_NUMBER) \ |
| 1733 | 1745 | @ %d(MANIFEST_NUMERIC_DATE) %d(MANIFEST_NUMERIC_TIME) |
| 1734 | 1746 | } |
| 1747 | + xfer_xfxl_check( xfer.remoteVersion, xfer.remoteDate, | |
| 1748 | + xfer.remoteTime, 0x04 ); | |
| 1735 | 1749 | }else |
| 1736 | 1750 | |
| 1737 | 1751 | /* pragma uv-hash HASH |
| 1738 | 1752 | ** |
| 1739 | 1753 | ** The client wants to make sure that unversioned files are all synced. |
| @@ -2784,17 +2798,16 @@ | ||
| 2784 | 2798 | ** for the specific check-in of the client. |
| 2785 | 2799 | */ |
| 2786 | 2800 | if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "server-version") ){ |
| 2787 | 2801 | xfer.remoteVersion = g.syncInfo.remoteVersion = |
| 2788 | 2802 | atoi(blob_str(&xfer.aToken[2])); |
| 2789 | - if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){ | |
| 2790 | - g.syncInfo.fLoginCardMode |= 0x08; | |
| 2791 | - } | |
| 2792 | 2803 | if( xfer.nToken>=5 ){ |
| 2793 | 2804 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 2794 | 2805 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 2795 | 2806 | } |
| 2807 | + xfer_xfxl_check( xfer.remoteVersion, xfer.remoteDate, | |
| 2808 | + xfer.remoteTime, 0x08 ); | |
| 2796 | 2809 | } |
| 2797 | 2810 | |
| 2798 | 2811 | /* pragma uv-pull-only |
| 2799 | 2812 | ** pragma uv-push-ok |
| 2800 | 2813 | ** |
| 2801 | 2814 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1241,10 +1241,25 @@ | |
| 1241 | /* |
| 1242 | ** If this variable is set, disable login checks. Used for debugging |
| 1243 | ** only. |
| 1244 | */ |
| 1245 | static int disableLogin = 0; |
| 1246 | |
| 1247 | /* |
| 1248 | ** The CGI/HTTP preprocessor always redirects requests with a content-type |
| 1249 | ** of application/x-fossil or application/x-fossil-debug to this page, |
| 1250 | ** regardless of what path was specified in the HTTP header. This allows |
| @@ -1721,19 +1736,18 @@ | |
| 1721 | ** for the specific check-in of the client. |
| 1722 | */ |
| 1723 | if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "client-version") ){ |
| 1724 | xfer.remoteVersion = g.syncInfo.remoteVersion = |
| 1725 | atoi(blob_str(&xfer.aToken[2])); |
| 1726 | if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){ |
| 1727 | g.syncInfo.fLoginCardMode |= 0x04; |
| 1728 | } |
| 1729 | if( xfer.nToken>=5 ){ |
| 1730 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 1731 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 1732 | @ pragma server-version %d(RELEASE_VERSION_NUMBER) \ |
| 1733 | @ %d(MANIFEST_NUMERIC_DATE) %d(MANIFEST_NUMERIC_TIME) |
| 1734 | } |
| 1735 | }else |
| 1736 | |
| 1737 | /* pragma uv-hash HASH |
| 1738 | ** |
| 1739 | ** The client wants to make sure that unversioned files are all synced. |
| @@ -2784,17 +2798,16 @@ | |
| 2784 | ** for the specific check-in of the client. |
| 2785 | */ |
| 2786 | if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "server-version") ){ |
| 2787 | xfer.remoteVersion = g.syncInfo.remoteVersion = |
| 2788 | atoi(blob_str(&xfer.aToken[2])); |
| 2789 | if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){ |
| 2790 | g.syncInfo.fLoginCardMode |= 0x08; |
| 2791 | } |
| 2792 | if( xfer.nToken>=5 ){ |
| 2793 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 2794 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 2795 | } |
| 2796 | } |
| 2797 | |
| 2798 | /* pragma uv-pull-only |
| 2799 | ** pragma uv-push-ok |
| 2800 | ** |
| 2801 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1241,10 +1241,25 @@ | |
| 1241 | /* |
| 1242 | ** If this variable is set, disable login checks. Used for debugging |
| 1243 | ** only. |
| 1244 | */ |
| 1245 | static int disableLogin = 0; |
| 1246 | |
| 1247 | /* |
| 1248 | ** Must be passed the version info from pragmas |
| 1249 | ** client-version/server-version cards. If the version info is "new |
| 1250 | ** enough" then the loginCardMode is ORd into the X-Fossil-Xfer-Login |
| 1251 | ** card flag, else this is a no-op. |
| 1252 | */ |
| 1253 | static void xfer_xfxl_check(int iRemoteVersion, int iDate, int iTime, |
| 1254 | int fLoginCardMode){ |
| 1255 | if( iRemoteVersion>=22701/*needs to change back to 22700 if merged*/ |
| 1256 | && (iDate > 20250724 |
| 1257 | || (iDate == 20250724 && iTime >= 51006)) ){ |
| 1258 | g.syncInfo.fLoginCardMode |= fLoginCardMode; |
| 1259 | } |
| 1260 | } |
| 1261 | |
| 1262 | /* |
| 1263 | ** The CGI/HTTP preprocessor always redirects requests with a content-type |
| 1264 | ** of application/x-fossil or application/x-fossil-debug to this page, |
| 1265 | ** regardless of what path was specified in the HTTP header. This allows |
| @@ -1721,19 +1736,18 @@ | |
| 1736 | ** for the specific check-in of the client. |
| 1737 | */ |
| 1738 | if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "client-version") ){ |
| 1739 | xfer.remoteVersion = g.syncInfo.remoteVersion = |
| 1740 | atoi(blob_str(&xfer.aToken[2])); |
| 1741 | if( xfer.nToken>=5 ){ |
| 1742 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 1743 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 1744 | @ pragma server-version %d(RELEASE_VERSION_NUMBER) \ |
| 1745 | @ %d(MANIFEST_NUMERIC_DATE) %d(MANIFEST_NUMERIC_TIME) |
| 1746 | } |
| 1747 | xfer_xfxl_check( xfer.remoteVersion, xfer.remoteDate, |
| 1748 | xfer.remoteTime, 0x04 ); |
| 1749 | }else |
| 1750 | |
| 1751 | /* pragma uv-hash HASH |
| 1752 | ** |
| 1753 | ** The client wants to make sure that unversioned files are all synced. |
| @@ -2784,17 +2798,16 @@ | |
| 2798 | ** for the specific check-in of the client. |
| 2799 | */ |
| 2800 | if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "server-version") ){ |
| 2801 | xfer.remoteVersion = g.syncInfo.remoteVersion = |
| 2802 | atoi(blob_str(&xfer.aToken[2])); |
| 2803 | if( xfer.nToken>=5 ){ |
| 2804 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 2805 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 2806 | } |
| 2807 | xfer_xfxl_check( xfer.remoteVersion, xfer.remoteDate, |
| 2808 | xfer.remoteTime, 0x08 ); |
| 2809 | } |
| 2810 | |
| 2811 | /* pragma uv-pull-only |
| 2812 | ** pragma uv-push-ok |
| 2813 | ** |
| 2814 |