Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
The goals of this branch are:
Reduce memory cost of outbound payloads which have a login card by eliminating one of the copies of the payload.
Keep downstream clients (read as "libfossil") from having to perform the same memory-hungry juggling to generate their sync payloads.
It achieves those by enabling the sync layer's login card to be stored in the HTTP headers instead of in the sync body payload. Specifically, it writes the login card to a transient Cookie header (as distinct from a Set-Cookie header) which compatible remotes will recognize.
The sync workflow typically runs like this:
Send a message to the server stating our intent, e.g. a push. At this point the client does not know whether the server supports this feature, so it must use the "legacy" login card format. The initial message is typically quite small, so this isn't usually a huge memory cost.
When the server responds, the client inspects the traffic to see if the remote it supports the new-style login cards. If so, it makes a note of that so that subsequent posts for this same sync will send login cards as a cookie. (The server side of a sync never sends login cards - only the client side does.)
Make any number of subsequent round-trips. At this point we know whether to use the cookie or not. Using it costs fossil less memory by eliminating an extra copy of the request body which otherwise needed to place the login card properly.
Many sync messages are quite small but posting of new files, or large changes, can cost considerable amounts of RAM (e.g. sqlite3.c requires something like 3MB to pack into the sync protocol), and those large packets now cost slightly less than half as much RAM to generate.
Design note: this change initially aimed to use a custom HTTP header, but that was incompatible with CGI-hosted fossils, which do not have access to the raw HTTP headers. Switching to a cookie was suggested in the forum and it turned out to be much simpler to implement that way.
|
2025-07-27
| ||
| 11:07 | Teach the sync protocol how to work with an out-of-band login card, saving an extra server-side copy of the sync content which is required only to account for an inlined login card. i.e. it saves RAM, potentially lots of it. The new login card mechanism is instead transported via an HTTP header. This also, not coincidentally, simplifies implementation of the login card in non-fossil(1) clients which are currently learning to speak the sync protocol. ... (check-in: 18628904c3 user: stephan tags: trunk) | |
|
2025-07-25
| ||
| 18:47 | Do not add the sync login cookie unless we know the remote supports it. It's harmless in that case but it doesn't need to be there. Rename the login cookie from the unweildy x-f-x-l (X-Fossil-Xfer-Login) to x-f-l-c (X-Fossil-Login-Card) because the former is unsightly. ... (Closed-Leaf check-in: 9789e1dce7 user: stephan tags: xfer-login-card) | |
| 15:08 | 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. ... (check-in: 86cc923de4 user: stephan tags: xfer-login-card) | |
|
2025-07-24
| ||
| 05:26 | Remove the now-obsolete parsing of the X-Fossil-Xfer-Login HTTP header. ... (check-in: 8dbcf2acba user: stephan tags: xfer-login-card) | |
| 05:10 | Use a Cookie, instead of a custom HTTP header and/or URL param, to send the sync login header, as suggested in [forum:9959d2d9d9be22d2 | forum post 9959d2d9d9be22d2]. This is simpler. ... (check-in: 756ad2f23c user: stephan tags: xfer-login-card) | |
| 03:16 | Previous checkin should not have compiled - clean rebuild uncovered a stale dep. Re-map the fLoginCardMode to a bitmask so that it's possible to tell when multiple paths toggle that on, and which paths they were. ... (check-in: 780d3b2fe3 user: stephan tags: xfer-login-card) | |
| 03:03 | Doc touchups. ... (check-in: aa36afc52c user: stephan tags: xfer-login-card) | |
| 02:41 | Update the change log and sync.wiki for the login card additions. ... (check-in: edfa01d9d2 user: stephan tags: xfer-login-card) | |
| 02:20 | Doc improvements and internal API renaming for clarity. No functional changes. ... (check-in: 286110dec0 user: stephan tags: xfer-login-card) | |
| 01:12 | Remove some debug output. ... (check-in: d1b7be2ff8 user: stephan tags: xfer-login-card) | |
|
2025-07-23
| ||
| 23:31 | Remove some xfer login process debug output. ... (check-in: 815a84cbcc user: stephan tags: xfer-login-card) | |
| 20:56 | Account for CGI-hosted fossil instances by sending the xfer login card as a URL argument. This is somewhat inelegant but works around their inability to read HTTP headers. This version is still more verbose than it needs to be, and requires more testing for compatibility with trunk fossil versions. ... (check-in: 439af9348b user: stephan tags: xfer-login-card) | |
| 17:39 | Add the x-fossil-xfer-login header check in one additional place. With the help of the included debug output, the login problem seems to be caused by CGI (only) instances not reading the inbound HTTP headers. My attempts to make it do have, so far, only triggered HTTP 500 responses. (Edit: i'd forgotten that CGIs don't get headers. The headers are necessarily consumed by the web server to find the CGI script and populate its environment.) ... (check-in: 6c900645ea user: stephan tags: xfer-login-card) | |
|
2025-07-22
| ||
| 22:53 | Add some debugging 'message' cards to help trace how the remote is handling the login. ... (check-in: 21be2978af user: stephan tags: xfer-login-card) | |
| 18:11 | Remove some dead code. Add some internal docs. Add a couple of const qualifiers to help me reason through the xfer payload buffer's lifetime. ... (check-in: 459d0cbbc7 user: stephan tags: xfer-login-card) | |
| 17:52 | Remove lots of debug output. Replace a couple of mprintf() with fossil_strdup() and a couple free() with fossil_free(). Milestone: libfossil has successfully logged in to this version of fossil. ... (check-in: 1078a123c1 user: stephan tags: xfer-login-card) | |
| 15:53 | Doc typo fixes. ... (check-in: 2250a684cc user: stephan tags: xfer-login-card) | |
| 15:51 | Set g.syncInfo.bLoginCardHeader=1 if that inbound header is detected, rather than delaying it until the /xfer handling. Internal doc additions. ... (check-in: 4fc13c5c88 user: stephan tags: xfer-login-card) | |
| 15:41 | Enable the HTTP login header if the xfer server-version is high enough, analog to the same check for the client-version. ... (check-in: bc3ad94411 user: stephan tags: xfer-login-card) | |
| 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) | |
|
2025-07-21
| ||
| 23:45 | Move the X-Fossil-Xfer-Login header check to the correct end of the connection. It is receiving these from libfossil tests but is failing to validate them, but that may well be a bug in that brand new downstream code. ... (check-in: b49c9b3685 user: stephan tags: xfer-login-card) | |
| 19:47 | Update sync.wiki for [12cc5bbf227e3]. ... (check-in: a4c5a2a961 user: stephan tags: xfer-login-card) | |
| 19:39 | Do not allow more than one login card in the sync protocol. ... (check-in: 12cc5bbf22 user: drh tags: xfer-login-card) | |
| 18:42 | Replace an mprintf() with fossil_strdup(). ... (check-in: 73a2bd06b1 user: stephan tags: xfer-login-card) | |
| 18:40 | And this time compile before committing. ... (check-in: a62ffc1922 user: stephan tags: xfer-login-card) | |
| 18:38 | Enable an /xfer login card to be delivered via the X-Fossil-Xfer-Login HTTP header, which is expected to be in the same format as the sync protocol's login card. The purpose of this is to simplify generation of the login card from non-fossil(1) clients, namely libfossil. This is untested until libfossil can generate such cards (it's just missing a bit of glue for that). ... (check-in: cfddded40e user: stephan tags: xfer-login-card) | |
| 17:16 | Account for [638b7e094b899a] when building with --json, as reported in [forum:9acc3d0022407bfe | forum post 9acc3d0022]. ... (check-in: c6f0d7aecd user: stephan tags: trunk) | |