Fossil

Check-in [cb42278d84]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | xfer-login-card
Files: files | file ages | folders
SHA3-256: cb42278d84dc871e3ef92b09baef75195dce230cac8b7403ca3bc8d4247c9740
User & Date: stephan 2025-07-22 02:32:01.988
Context
2025-07-22
15:12
Get sync working from both login card forms and add a temporary --login-card-header CLI flag to force it to emit the HTTP header form of the card in output requests. If all is well, this checkin should be able to push to the canonical repo, despite their differences. check-in: 042560df54 user: stephan tags: xfer-login-card
02:32
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. check-in: cb42278d84 user: stephan tags: xfer-login-card
02:16
For testing purposes only, unconditionally use the X-Fossil-Xfer-Login HTTP header for sync requests, rather than add it to the payload (which seems to work okay). This is primarily so that apples-to-apples comparisons can be made in libfossil's testing, and will be reverted (or applied conditionally) once the libfossil side is working. check-in: ff942066d5 user: stephan tags: xfer-login-card
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/http.c.
461
462
463
464
465
466
467
468
469

470
471
472
473

474
475
476
477
478
479
480
481
482
483
484
485
486

487

488
489
490
491
492
493
494
495
496
497
498
499



500
501
502

503
504
505
506
507
508
509

  if( transport_open(&g.url) ){
    fossil_warning("%s", transport_errmsg(&g.url));
    return 1;
  }

  /* Construct the login card and prepare the complete payload */
  if( blob_size(pSend)==0 ){
    blob_zero(&login);

    blob_zero(&payload);
  }else{
    blob_zero(&login);
    if( mHttpFlags & HTTP_USE_LOGIN ) http_build_login_card(pSend, &login);

#if RELEASE_VERSION_NUMBER >= 22701
    if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
      /*blob_append(&payload, blob_buffer(pSend), blob_size(pSend));*/
      blob_zero(&payload);
      blob_swap(pSend, &payload);
    }else{
      blob_compress(pSend, &payload);
    }
#else
    if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
      if( blob_size(&login) ){
        blob_append_char(&login, '\n');
      }

      payload = login;

      blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
    }else{
      if( blob_size(&login) ){
        blob_append_char(&login, '\n');
      }
      blob_compress2(&login, pSend, &payload);
      blob_reset(&login);
    }
#endif
  }

  /* Construct the HTTP request header */



  http_build_header(blob_size(&login) ? &login : 0,
                    &payload, &hdr, zAltMimetype);
  blob_reset(&login);


  /* When tracing, write the transmitted HTTP message both to standard
  ** output and into a file.  The file can then be used to drive the
  ** server-side like this:
  **
  **      ./fossil test-http <http-request-1.txt
  */







<
|
>


<

>
|








<
|
|
|
>

>


<
<
<







>
>
>



>







461
462
463
464
465
466
467

468
469
470
471

472
473
474
475
476
477
478
479
480
481
482

483
484
485
486
487
488
489
490



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511

  if( transport_open(&g.url) ){
    fossil_warning("%s", transport_errmsg(&g.url));
    return 1;
  }

  /* Construct the login card and prepare the complete payload */

  blob_zero(&login);
  if( blob_size(pSend)==0 ){
    blob_zero(&payload);
  }else{

    if( mHttpFlags & HTTP_USE_LOGIN ) http_build_login_card(pSend, &login);
#define TEST_LOGIN_HEADER 0 /* temporary dev/test/debug crutch */
#if TEST_LOGIN_HEADER
    if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
      /*blob_append(&payload, blob_buffer(pSend), blob_size(pSend));*/
      blob_zero(&payload);
      blob_swap(pSend, &payload);
    }else{
      blob_compress(pSend, &payload);
    }
#else

    if( blob_size(&login) ){
      blob_append_char(&login, '\n');
    }
    if( g.fHttpTrace || (mHttpFlags & HTTP_NOCOMPRESS)!=0 ){
      payload = login;
      login = empty_blob/*transfer ownership*/;
      blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
    }else{



      blob_compress2(&login, pSend, &payload);
      blob_reset(&login);
    }
#endif
  }

  /* Construct the HTTP request header */
#if !TEST_LOGIN_HEADER
  http_build_header(0, &payload, &hdr, zAltMimetype);
#else
  http_build_header(blob_size(&login) ? &login : 0,
                    &payload, &hdr, zAltMimetype);
  blob_reset(&login);
#endif

  /* When tracing, write the transmitted HTTP message both to standard
  ** output and into a file.  The file can then be used to drive the
  ** server-side like this:
  **
  **      ./fossil test-http <http-request-1.txt
  */