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.

stephan 2025-07-25 15:08 xfer-login-card
Commit 86cc923de4d85af54e9e9ae49fbf5f5859b162783df2661715559727925460bd
1 file changed +19 -6
+19 -6
--- src/xfer.c
+++ src/xfer.c
@@ -1241,10 +1241,25 @@
12411241
/*
12421242
** If this variable is set, disable login checks. Used for debugging
12431243
** only.
12441244
*/
12451245
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
+}
12461261
12471262
/*
12481263
** The CGI/HTTP preprocessor always redirects requests with a content-type
12491264
** of application/x-fossil or application/x-fossil-debug to this page,
12501265
** regardless of what path was specified in the HTTP header. This allows
@@ -1721,19 +1736,18 @@
17211736
** for the specific check-in of the client.
17221737
*/
17231738
if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "client-version") ){
17241739
xfer.remoteVersion = g.syncInfo.remoteVersion =
17251740
atoi(blob_str(&xfer.aToken[2]));
1726
- if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){
1727
- g.syncInfo.fLoginCardMode |= 0x04;
1728
- }
17291741
if( xfer.nToken>=5 ){
17301742
xfer.remoteDate = atoi(blob_str(&xfer.aToken[3]));
17311743
xfer.remoteTime = atoi(blob_str(&xfer.aToken[4]));
17321744
@ pragma server-version %d(RELEASE_VERSION_NUMBER) \
17331745
@ %d(MANIFEST_NUMERIC_DATE) %d(MANIFEST_NUMERIC_TIME)
17341746
}
1747
+ xfer_xfxl_check( xfer.remoteVersion, xfer.remoteDate,
1748
+ xfer.remoteTime, 0x04 );
17351749
}else
17361750
17371751
/* pragma uv-hash HASH
17381752
**
17391753
** The client wants to make sure that unversioned files are all synced.
@@ -2784,17 +2798,16 @@
27842798
** for the specific check-in of the client.
27852799
*/
27862800
if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "server-version") ){
27872801
xfer.remoteVersion = g.syncInfo.remoteVersion =
27882802
atoi(blob_str(&xfer.aToken[2]));
2789
- if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){
2790
- g.syncInfo.fLoginCardMode |= 0x08;
2791
- }
27922803
if( xfer.nToken>=5 ){
27932804
xfer.remoteDate = atoi(blob_str(&xfer.aToken[3]));
27942805
xfer.remoteTime = atoi(blob_str(&xfer.aToken[4]));
27952806
}
2807
+ xfer_xfxl_check( xfer.remoteVersion, xfer.remoteDate,
2808
+ xfer.remoteTime, 0x08 );
27962809
}
27972810
27982811
/* pragma uv-pull-only
27992812
** pragma uv-push-ok
28002813
**
28012814
--- 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

Keyboard Shortcuts

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