12
13
14
15
16
17
18
19
|
12
13
14
15
16
17
18
19
|
-
+
|
- 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 [forum:9959d2d9d9be22d2 | suggested in the forum] and it turned out to be much simpler to implement that way.
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](forum:9959d2d9d9be22d2) and it turned out to be much simpler to implement that way.
|