Fossil SCM

The previous checkin left me unable to push because (of course) the remote trunk doesn't know how to use the login card header. This checkin disables, via a macro toggle, the use of that header on outbound sync requests.

stephan 2025-07-22 02:32 xfer-login-card
Commit cb42278d84dc871e3ef92b09baef75195dce230cac8b7403ca3bc8d4247c9740
1 file changed +11 -9
+11 -9
--- src/http.c
+++ src/http.c
@@ -463,45 +463,47 @@
463463
fossil_warning("%s", transport_errmsg(&g.url));
464464
return 1;
465465
}
466466
467467
/* Construct the login card and prepare the complete payload */
468
+ blob_zero(&login);
468469
if( blob_size(pSend)==0 ){
469
- blob_zero(&login);
470470
blob_zero(&payload);
471471
}else{
472
- blob_zero(&login);
473472
if( mHttpFlags & HTTP_USE_LOGIN ) http_build_login_card(pSend, &login);
474
-#if RELEASE_VERSION_NUMBER >= 22701
473
+#define TEST_LOGIN_HEADER 0 /* temporary dev/test/debug crutch */
474
+#if TEST_LOGIN_HEADER
475475
if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
476476
/*blob_append(&payload, blob_buffer(pSend), blob_size(pSend));*/
477477
blob_zero(&payload);
478478
blob_swap(pSend, &payload);
479479
}else{
480480
blob_compress(pSend, &payload);
481481
}
482482
#else
483
+ if( blob_size(&login) ){
484
+ blob_append_char(&login, '\n');
485
+ }
483486
if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
484
- if( blob_size(&login) ){
485
- blob_append_char(&login, '\n');
486
- }
487487
payload = login;
488
+ login = empty_blob/*transfer ownership*/;
488489
blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
489490
}else{
490
- if( blob_size(&login) ){
491
- blob_append_char(&login, '\n');
492
- }
493491
blob_compress2(&login, pSend, &payload);
494492
blob_reset(&login);
495493
}
496494
#endif
497495
}
498496
499497
/* Construct the HTTP request header */
498
+#if !TEST_LOGIN_HEADER
499
+ http_build_header(0, &payload, &hdr, zAltMimetype);
500
+#else
500501
http_build_header(blob_size(&login) ? &login : 0,
501502
&payload, &hdr, zAltMimetype);
502503
blob_reset(&login);
504
+#endif
503505
504506
/* When tracing, write the transmitted HTTP message both to standard
505507
** output and into a file. The file can then be used to drive the
506508
** server-side like this:
507509
**
508510
--- src/http.c
+++ src/http.c
@@ -463,45 +463,47 @@
463 fossil_warning("%s", transport_errmsg(&g.url));
464 return 1;
465 }
466
467 /* Construct the login card and prepare the complete payload */
 
468 if( blob_size(pSend)==0 ){
469 blob_zero(&login);
470 blob_zero(&payload);
471 }else{
472 blob_zero(&login);
473 if( mHttpFlags & HTTP_USE_LOGIN ) http_build_login_card(pSend, &login);
474 #if RELEASE_VERSION_NUMBER >= 22701
 
475 if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
476 /*blob_append(&payload, blob_buffer(pSend), blob_size(pSend));*/
477 blob_zero(&payload);
478 blob_swap(pSend, &payload);
479 }else{
480 blob_compress(pSend, &payload);
481 }
482 #else
 
 
 
483 if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
484 if( blob_size(&login) ){
485 blob_append_char(&login, '\n');
486 }
487 payload = login;
 
488 blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
489 }else{
490 if( blob_size(&login) ){
491 blob_append_char(&login, '\n');
492 }
493 blob_compress2(&login, pSend, &payload);
494 blob_reset(&login);
495 }
496 #endif
497 }
498
499 /* Construct the HTTP request header */
 
 
 
500 http_build_header(blob_size(&login) ? &login : 0,
501 &payload, &hdr, zAltMimetype);
502 blob_reset(&login);
 
503
504 /* When tracing, write the transmitted HTTP message both to standard
505 ** output and into a file. The file can then be used to drive the
506 ** server-side like this:
507 **
508
--- src/http.c
+++ src/http.c
@@ -463,45 +463,47 @@
463 fossil_warning("%s", transport_errmsg(&g.url));
464 return 1;
465 }
466
467 /* Construct the login card and prepare the complete payload */
468 blob_zero(&login);
469 if( blob_size(pSend)==0 ){
 
470 blob_zero(&payload);
471 }else{
 
472 if( mHttpFlags & HTTP_USE_LOGIN ) http_build_login_card(pSend, &login);
473 #define TEST_LOGIN_HEADER 0 /* temporary dev/test/debug crutch */
474 #if TEST_LOGIN_HEADER
475 if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
476 /*blob_append(&payload, blob_buffer(pSend), blob_size(pSend));*/
477 blob_zero(&payload);
478 blob_swap(pSend, &payload);
479 }else{
480 blob_compress(pSend, &payload);
481 }
482 #else
483 if( blob_size(&login) ){
484 blob_append_char(&login, '\n');
485 }
486 if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
 
 
 
487 payload = login;
488 login = empty_blob/*transfer ownership*/;
489 blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
490 }else{
 
 
 
491 blob_compress2(&login, pSend, &payload);
492 blob_reset(&login);
493 }
494 #endif
495 }
496
497 /* Construct the HTTP request header */
498 #if !TEST_LOGIN_HEADER
499 http_build_header(0, &payload, &hdr, zAltMimetype);
500 #else
501 http_build_header(blob_size(&login) ? &login : 0,
502 &payload, &hdr, zAltMimetype);
503 blob_reset(&login);
504 #endif
505
506 /* When tracing, write the transmitted HTTP message both to standard
507 ** output and into a file. The file can then be used to drive the
508 ** server-side like this:
509 **
510

Keyboard Shortcuts

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