Make the automatic splice() mode's heuristics a service option

-s[N]:MIN,STREAK,SMALL sets where the automatic mode splices, as -g
does for grace delay: a direction is spliced after STREAK reads in a
row of MIN bytes or more (SMALL from a TLS socket), copied again after
more than STREAK splices in a row of less than SMALL, and a body of
known length is spliced if MIN or more of it is left. The defaults,
16384,2,4096, are what was built in; a value left out or 0 keeps its
default.

The man page describes it, and its HTML copy, which still said splice()
was not built by default, now has the current text. A test case relays
answers of every size, chunked ones and a 3 MB upload through every
mode, two of them with heuristics set, and compares them byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-14 19:02:23 +03:00
1 parent cfe52878d0
commit 61041ebe7d
7 files changed
+207 -32

No files matched your search

+2
View File
@@ -653,6 +653,8 @@ struct srvparam {
unsigned char fakeip6[16];
#ifdef WITHSPLICE
int usesplice;
/* the automatic mode's heuristics, -s[N]:MIN,STREAK,SMALL */
int splicemin, splicestreak, splicesmall;
#endif
int halfclose;
int udpauth;