Fossil SCM

fossil-scm / www / crlf-free.md
1
Fossil Does Not Send CRLF
2
=========================
3
4
Fossil uses \\n (NL) line endings, not \\r\\n (CRLF) line endings, even for
5
the HTTP and SMTP protocols where CRLF line endings are required. This is
6
deliberate. The founder of Fossil believes that that CRLF
7
line endings are a harmful anachronism and need to be abolished.
8
9
The HTTP protocol is defined by RFC-2616. Even though RFC-2616 says that CRLF
10
line endings are required, that same spec recommends that all clients
11
also accept bare \\n line endings. Most HTTP clients abide by this
12
recommendation, and so Fossil's refusal to play by the rules is harmless.
13
And omitting those extra \\r bytes reduces bandwidth slightly.
14
The omission of unnecessary \\r characters is a feature of Fossil, not a bug.
15
16
~~~ pikchr
17
sin45 = sin(3.141592653/4)
18
C: circle "CRLF" big big bold thick fit
19
C2: circle thick thick radius C.radius at C.c color red
20
line thick thick from (C.x-sin45*C.radius,C.y-sin45*C.radius) \
21
to (C.x+sin45*C.radius,C.y+sin45*C.radius) color red
22
T1: text "CRLF-free" bold fit with .s at 1mm above C.n
23
T2: text "Zone" bold fit with .n at 1mm below C.s
24
box ht dist(T1.s,T2.n)+lineht*1.2 wid C2.width+lineht*0.5 \
25
fill yellow thick thick radius 3mm at C.c behind C
26
~~~
27
28
## How Does This Affect Me
29
30
It doesn't. You won't notice that Fossil omits unnecessary CRs unless you look
31
at a hex-dump of the HTTP protocol that it generates. This documentation page
32
exists only so that in case somebody does notice, they won't think the omission
33
of CRs is a bug.
34
35
## My Boss Says I Can Only Host Standards-Compliant Software.
36
37
If you recompile Fossil using the "`-DSEND_CR=1`" compile-time option, then it
38
will generate all extra CRs required by HTTP and SMTP.
39
40
## Why Not Just Make Fossil Standards-Compliant By Default?
41
42
Because the standard is wrong. Requiring CRLF as a line-ending is silly.
43
It wastes bandwidth. It is vexation to programmers that have to deal with the
44
extra CRs. It is an anachronism based on hardware constraints in 1950s-era
45
teleprinters. CRLF needs to be abolished. And the only way that will happen
46
is if the users revolt.
47

Keyboard Shortcuts

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