Skip to content
zit Artifact [d28c9f8c6e]
Login

Artifact [d28c9f8c6e]

Artifact d28c9f8c6eb5853022d265312e286bb0f9405dc1d69ea0f0568d44293e7c722a:


Erratum — draft-fossil-sync-protocol-00 §5.2 / §10.1

Document draft-fossil-sync-protocol-00
Section 5.2 — Card Syntax (file, cfile and uvfile handler failures); 10.1 — Error Card
Type Technical (compatibility note — the reference server URL-encodes one family of error texts; the draft's encoding is kept)
Status Applied in draft-fossil-sync-protocol-01 (2026-10-12)
Reported 2026-10-11
Submitter Dan Mestas
Found via go-libfossil's conformance suite against Fossil 2.28; confirmed by reading Fossil's source and by sending it a malformed card

1. Summary

§5.2 says a validation failure in the file, cfile or uvfile handler "emits the handler's fossilized error", and §10.1 says an error card's TEXT is fossilized. Fossil does not fossilize these three: it URL-encodes them, so spaces arrive as + and other unsafe bytes as %XX. Every other error card Fossil sends is fossilized.

Both encodings yield a single token, so a receiver never misreads the card's framing. The difference is in the text a person sees: a Fossil client defossilizes what it receives, and shows a Fossil server's malformed+file+line with the plus signs in it.

2. Location

§5.2, the paragraph beginning "After dispatch enters the file, cfile, or uvfile handler" (~line 1013):

…a validation failure reported by that handler instead resets accumulated response output, emits the handler's fossilized error, increments the request error count, and stops request-card parsing.

3. The divergence

Verified against Fossil 2.28 by source reading and by running it.

page_xfer() (src/xfer.c) sends the handler's accumulated error with %T in all three places, at lines 1370 (file), 1391 (cfile) and 1405 (uvfile):

@ error %T(blob_str(&xfer.err))

In Fossil's printf, %T is etURLIZE (src/printf.c:162, "Make text safe for HTTP"), while %F is etFOSSILIZE. The other error cards in the same function use %F or are written pre-escaped, for example @ error bad\scommand:\s%F(...) at line 1893.

A raw request through fossil http, as nobody with push permission, gives:

Request card Fossil 2.28 reply card
file notahash 5 error malformed+file+line
uvfile x/y 0 0 0 error malformed+uvfile+line

The fossilized forms the draft describes would be error malformed\sfile\sline and error malformed\suvfile\sline.

4. Impact

Cosmetic on the wire, visible to people.

5. Correction

Keep the draft's rule. Fossilized TEXT is what §10.1 requires of every error card, it is what Fossil does everywhere else, and it is what a receiver decodes. Record Fossil's divergence where the handler path is described.

In §5.2, after "emits the handler's fossilized error,":

    accumulated response output, emits the handler's fossilized error,
    increments the request error count, and stops request-card parsing.
+   (Fossil instead URL-encodes the text of these three handler errors,
+   so spaces arrive as "+"; the card remains a single TEXT token, and a
+   receiver that defossilizes it, as Section 10.1 requires, shows the
+   "+" characters.  Senders SHOULD fossilize, as for every other error
+   card.)

Alternative, which needs the operator's decision: propose that Fossil change %T to %F at the three lines. That is a three-character patch to src/xfer.c, and it would let the parenthetical be dropped. Filing it is a separate decision from this erratum.

6. Rationale

7. Verification


Prepared against draft-fossil-sync-protocol-00. The RFC remains the oracle; the reference implementation is used only to confirm the observable behavior.