Fossil SCM

Remove the now-obsolete parsing of the X-Fossil-Xfer-Login HTTP header.

stephan 2025-07-24 05:26 xfer-login-card
Commit 8dbcf2acba6f00bd72bf8555274f9a6ed9d52e3d4cce93e285fe695cbfbf411f
+1 -5
--- src/cgi.c
+++ src/cgi.c
@@ -1317,11 +1317,11 @@
13171317
if( !g.syncInfo.zLoginCard && 0!=(z=(char*)P("x-f-x-l")) ){
13181318
/* X-Fossil-Xfer-Login card transmitted via cookie instead of in
13191319
** the sync payload. */
13201320
rc |= 0x04;
13211321
g.syncInfo.zLoginCard = fossil_strdup(z);
1322
- g.syncInfo.fLoginCardMode |= 0x04;
1322
+ g.syncInfo.fLoginCardMode |= 0x02;
13231323
cgi_delete_parameter("x-f-x-l");
13241324
}
13251325
return rc;
13261326
}
13271327
@@ -2234,14 +2234,10 @@
22342234
int x2 = 0;
22352235
if( sscanf(zVal,"bytes=%d-%d",&x1,&x2)==2 && x1>=0 && x1<=x2 ){
22362236
rangeStart = x1;
22372237
rangeEnd = x2+1;
22382238
}
2239
- }else if( fossil_strcmp(zFieldName, "x-fossil-xfer-login:")==0 ){
2240
- fossil_free( g.syncInfo.zLoginCard );
2241
- g.syncInfo.zLoginCard = fossil_strdup(zVal);
2242
- g.syncInfo.fLoginCardMode |= 0x08;
22432239
}
22442240
}
22452241
cgi_setenv("REQUEST_SCHEME",zScheme);
22462242
cgi_init();
22472243
cgi_trace(0);
22482244
--- src/cgi.c
+++ src/cgi.c
@@ -1317,11 +1317,11 @@
1317 if( !g.syncInfo.zLoginCard && 0!=(z=(char*)P("x-f-x-l")) ){
1318 /* X-Fossil-Xfer-Login card transmitted via cookie instead of in
1319 ** the sync payload. */
1320 rc |= 0x04;
1321 g.syncInfo.zLoginCard = fossil_strdup(z);
1322 g.syncInfo.fLoginCardMode |= 0x04;
1323 cgi_delete_parameter("x-f-x-l");
1324 }
1325 return rc;
1326 }
1327
@@ -2234,14 +2234,10 @@
2234 int x2 = 0;
2235 if( sscanf(zVal,"bytes=%d-%d",&x1,&x2)==2 && x1>=0 && x1<=x2 ){
2236 rangeStart = x1;
2237 rangeEnd = x2+1;
2238 }
2239 }else if( fossil_strcmp(zFieldName, "x-fossil-xfer-login:")==0 ){
2240 fossil_free( g.syncInfo.zLoginCard );
2241 g.syncInfo.zLoginCard = fossil_strdup(zVal);
2242 g.syncInfo.fLoginCardMode |= 0x08;
2243 }
2244 }
2245 cgi_setenv("REQUEST_SCHEME",zScheme);
2246 cgi_init();
2247 cgi_trace(0);
2248
--- src/cgi.c
+++ src/cgi.c
@@ -1317,11 +1317,11 @@
1317 if( !g.syncInfo.zLoginCard && 0!=(z=(char*)P("x-f-x-l")) ){
1318 /* X-Fossil-Xfer-Login card transmitted via cookie instead of in
1319 ** the sync payload. */
1320 rc |= 0x04;
1321 g.syncInfo.zLoginCard = fossil_strdup(z);
1322 g.syncInfo.fLoginCardMode |= 0x02;
1323 cgi_delete_parameter("x-f-x-l");
1324 }
1325 return rc;
1326 }
1327
@@ -2234,14 +2234,10 @@
2234 int x2 = 0;
2235 if( sscanf(zVal,"bytes=%d-%d",&x1,&x2)==2 && x1>=0 && x1<=x2 ){
2236 rangeStart = x1;
2237 rangeEnd = x2+1;
2238 }
 
 
 
 
2239 }
2240 }
2241 cgi_setenv("REQUEST_SCHEME",zScheme);
2242 cgi_init();
2243 cgi_trace(0);
2244
-4
--- src/http.c
+++ src/http.c
@@ -662,14 +662,10 @@
662662
if( mHttpFlags & HTTP_NOCOMPRESS ) isCompressed = 0;
663663
}else if( fossil_strnicmp(&zLine[14], "application/x-fossil", -1)!=0 ){
664664
isError = 1;
665665
}
666666
}
667
- }else if( fossil_strnicmp(zLine, "x-fossil-xfer-login: ", 21)==0 ){
668
- fossil_free( g.syncInfo.zLoginCard );
669
- g.syncInfo.zLoginCard = fossil_strdup(&zLine[21]);
670
- g.syncInfo.fLoginCardMode |= 0x02;
671667
}
672668
}
673669
if( iHttpVersion<0 ){
674670
/* We got nothing back from the server. If using the ssh: protocol,
675671
** this might mean we need to add or remove the PATH=... argument
676672
--- src/http.c
+++ src/http.c
@@ -662,14 +662,10 @@
662 if( mHttpFlags & HTTP_NOCOMPRESS ) isCompressed = 0;
663 }else if( fossil_strnicmp(&zLine[14], "application/x-fossil", -1)!=0 ){
664 isError = 1;
665 }
666 }
667 }else if( fossil_strnicmp(zLine, "x-fossil-xfer-login: ", 21)==0 ){
668 fossil_free( g.syncInfo.zLoginCard );
669 g.syncInfo.zLoginCard = fossil_strdup(&zLine[21]);
670 g.syncInfo.fLoginCardMode |= 0x02;
671 }
672 }
673 if( iHttpVersion<0 ){
674 /* We got nothing back from the server. If using the ssh: protocol,
675 ** this might mean we need to add or remove the PATH=... argument
676
--- src/http.c
+++ src/http.c
@@ -662,14 +662,10 @@
662 if( mHttpFlags & HTTP_NOCOMPRESS ) isCompressed = 0;
663 }else if( fossil_strnicmp(&zLine[14], "application/x-fossil", -1)!=0 ){
664 isError = 1;
665 }
666 }
 
 
 
 
667 }
668 }
669 if( iHttpVersion<0 ){
670 /* We got nothing back from the server. If using the ssh: protocol,
671 ** this might mean we need to add or remove the PATH=... argument
672
+4 -7
--- src/main.c
+++ src/main.c
@@ -292,23 +292,20 @@
292292
int bAvoidDeltaManifests; /* Avoid using delta manifests if true */
293293
294294
/* State for communicating specific details between the inbound HTTP
295295
** header parser (cgi.c), xfer.c, and http.c. */
296296
struct {
297
- char *zLoginCard; /* Inbound "X-Fossil-Xfer-Login" request
298
- ** header or "x-f-x-l" URL parameter. */
297
+ char *zLoginCard; /* Inbound "x-f-x-l" Cookie header. */
299298
int fLoginCardMode; /* If non-0, emit login cards in outbound
300299
** requests as a HTTP cookie instead of as
301300
** part of the payload. Gets activated
302301
** on-demand based on xfer traffic
303302
** contents. Values, for
304303
** diagnostic/debugging purposes: 0x01=CLI
305
- ** --flag, 0x02=http_exchange(),
306
- ** 0x04=cgi_setup_query_string(),
307
- ** 0x08=cgi_handle_cgi_request(),
308
- ** 0x20=page_xfer(),
309
- ** 0x40=client_sync(). */
304
+ ** --flag, 0x02=cgi_setup_query_string(),
305
+ ** 0x04=page_xfer(),
306
+ ** 0x08=client_sync(). */
310307
int remoteVersion; /* Remote fossil version. Used for negotiating
311308
** how to handle the login card. */
312309
} syncInfo;
313310
#ifdef FOSSIL_ENABLE_JSON
314311
struct FossilJsonBits {
315312
--- src/main.c
+++ src/main.c
@@ -292,23 +292,20 @@
292 int bAvoidDeltaManifests; /* Avoid using delta manifests if true */
293
294 /* State for communicating specific details between the inbound HTTP
295 ** header parser (cgi.c), xfer.c, and http.c. */
296 struct {
297 char *zLoginCard; /* Inbound "X-Fossil-Xfer-Login" request
298 ** header or "x-f-x-l" URL parameter. */
299 int fLoginCardMode; /* If non-0, emit login cards in outbound
300 ** requests as a HTTP cookie instead of as
301 ** part of the payload. Gets activated
302 ** on-demand based on xfer traffic
303 ** contents. Values, for
304 ** diagnostic/debugging purposes: 0x01=CLI
305 ** --flag, 0x02=http_exchange(),
306 ** 0x04=cgi_setup_query_string(),
307 ** 0x08=cgi_handle_cgi_request(),
308 ** 0x20=page_xfer(),
309 ** 0x40=client_sync(). */
310 int remoteVersion; /* Remote fossil version. Used for negotiating
311 ** how to handle the login card. */
312 } syncInfo;
313 #ifdef FOSSIL_ENABLE_JSON
314 struct FossilJsonBits {
315
--- src/main.c
+++ src/main.c
@@ -292,23 +292,20 @@
292 int bAvoidDeltaManifests; /* Avoid using delta manifests if true */
293
294 /* State for communicating specific details between the inbound HTTP
295 ** header parser (cgi.c), xfer.c, and http.c. */
296 struct {
297 char *zLoginCard; /* Inbound "x-f-x-l" Cookie header. */
 
298 int fLoginCardMode; /* If non-0, emit login cards in outbound
299 ** requests as a HTTP cookie instead of as
300 ** part of the payload. Gets activated
301 ** on-demand based on xfer traffic
302 ** contents. Values, for
303 ** diagnostic/debugging purposes: 0x01=CLI
304 ** --flag, 0x02=cgi_setup_query_string(),
305 ** 0x04=page_xfer(),
306 ** 0x08=client_sync(). */
 
 
307 int remoteVersion; /* Remote fossil version. Used for negotiating
308 ** how to handle the login card. */
309 } syncInfo;
310 #ifdef FOSSIL_ENABLE_JSON
311 struct FossilJsonBits {
312
+4 -5
--- src/xfer.c
+++ src/xfer.c
@@ -1317,13 +1317,12 @@
13171317
if( zScript ){ /* NOTE: Are TH1 transfer hooks enabled? */
13181318
pzUuidList = &zUuidList;
13191319
pnUuidList = &nUuidList;
13201320
}
13211321
if( g.syncInfo.zLoginCard ){
1322
- /* Login card received via HTTP header "X-Fossil-Xfer-Login" or
1323
- ** "x-f-x-l" URL parameter. */
1324
- assert( g.syncInfo.fLoginCardMode && "Set via HTTP header/URL arg" );
1322
+ /* Login card received via HTTP Cookie header "x-f-x-l" */
1323
+ assert( g.syncInfo.fLoginCardMode && "Set via HTTP cookie" );
13251324
blob_zero(&xfer.line);
13261325
blob_append(&xfer.line, g.syncInfo.zLoginCard, -1);
13271326
xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken,
13281327
count(xfer.aToken));
13291328
fossil_free( g.syncInfo.zLoginCard );
@@ -1723,11 +1722,11 @@
17231722
*/
17241723
if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "client-version") ){
17251724
xfer.remoteVersion = g.syncInfo.remoteVersion =
17261725
atoi(blob_str(&xfer.aToken[2]));
17271726
if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){
1728
- g.syncInfo.fLoginCardMode |= 0x20;
1727
+ g.syncInfo.fLoginCardMode |= 0x04;
17291728
}
17301729
if( xfer.nToken>=5 ){
17311730
xfer.remoteDate = atoi(blob_str(&xfer.aToken[3]));
17321731
xfer.remoteTime = atoi(blob_str(&xfer.aToken[4]));
17331732
@ pragma server-version %d(RELEASE_VERSION_NUMBER) \
@@ -2786,11 +2785,11 @@
27862785
*/
27872786
if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "server-version") ){
27882787
xfer.remoteVersion = g.syncInfo.remoteVersion =
27892788
atoi(blob_str(&xfer.aToken[2]));
27902789
if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){
2791
- g.syncInfo.fLoginCardMode |= 0x40;
2790
+ g.syncInfo.fLoginCardMode |= 0x08;
27922791
}
27932792
if( xfer.nToken>=5 ){
27942793
xfer.remoteDate = atoi(blob_str(&xfer.aToken[3]));
27952794
xfer.remoteTime = atoi(blob_str(&xfer.aToken[4]));
27962795
}
27972796
--- src/xfer.c
+++ src/xfer.c
@@ -1317,13 +1317,12 @@
1317 if( zScript ){ /* NOTE: Are TH1 transfer hooks enabled? */
1318 pzUuidList = &zUuidList;
1319 pnUuidList = &nUuidList;
1320 }
1321 if( g.syncInfo.zLoginCard ){
1322 /* Login card received via HTTP header "X-Fossil-Xfer-Login" or
1323 ** "x-f-x-l" URL parameter. */
1324 assert( g.syncInfo.fLoginCardMode && "Set via HTTP header/URL arg" );
1325 blob_zero(&xfer.line);
1326 blob_append(&xfer.line, g.syncInfo.zLoginCard, -1);
1327 xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken,
1328 count(xfer.aToken));
1329 fossil_free( g.syncInfo.zLoginCard );
@@ -1723,11 +1722,11 @@
1723 */
1724 if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "client-version") ){
1725 xfer.remoteVersion = g.syncInfo.remoteVersion =
1726 atoi(blob_str(&xfer.aToken[2]));
1727 if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){
1728 g.syncInfo.fLoginCardMode |= 0x20;
1729 }
1730 if( xfer.nToken>=5 ){
1731 xfer.remoteDate = atoi(blob_str(&xfer.aToken[3]));
1732 xfer.remoteTime = atoi(blob_str(&xfer.aToken[4]));
1733 @ pragma server-version %d(RELEASE_VERSION_NUMBER) \
@@ -2786,11 +2785,11 @@
2786 */
2787 if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "server-version") ){
2788 xfer.remoteVersion = g.syncInfo.remoteVersion =
2789 atoi(blob_str(&xfer.aToken[2]));
2790 if( xfer.remoteVersion>=RELEASE_VERSION_NUMBER ){
2791 g.syncInfo.fLoginCardMode |= 0x40;
2792 }
2793 if( xfer.nToken>=5 ){
2794 xfer.remoteDate = atoi(blob_str(&xfer.aToken[3]));
2795 xfer.remoteTime = atoi(blob_str(&xfer.aToken[4]));
2796 }
2797
--- src/xfer.c
+++ src/xfer.c
@@ -1317,13 +1317,12 @@
1317 if( zScript ){ /* NOTE: Are TH1 transfer hooks enabled? */
1318 pzUuidList = &zUuidList;
1319 pnUuidList = &nUuidList;
1320 }
1321 if( g.syncInfo.zLoginCard ){
1322 /* Login card received via HTTP Cookie header "x-f-x-l" */
1323 assert( g.syncInfo.fLoginCardMode && "Set via HTTP cookie" );
 
1324 blob_zero(&xfer.line);
1325 blob_append(&xfer.line, g.syncInfo.zLoginCard, -1);
1326 xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken,
1327 count(xfer.aToken));
1328 fossil_free( g.syncInfo.zLoginCard );
@@ -1723,11 +1722,11 @@
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) \
@@ -2786,11 +2785,11 @@
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

Keyboard Shortcuts

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