Originally in httpterm we used to allocate 5/4 of the size of a pipe to
permit to use vmsplice because there's some fragmentation or overhead
internally that requires to use a bit of margin. While this was initially
applied to haterm as well, it was accidentally lost with commit
fb82dece47
("BUG/MEDIUM: haterm: Properly initialize the splicing support for haterm"),
resulting in errors about vmsplice() whenever tune.pipesize is set. Let's
enforce the ratio again.
No backport is needed.
int total, ret;
#ifdef F_SETPIPE_SZ
- fcntl(master_pipe->cons, F_SETPIPE_SZ, pipesize);
+ fcntl(master_pipe->cons, F_SETPIPE_SZ, pipesize * 5 / 4);
#endif
total = ret = 0;
do {
if (master_pipesize < pipesize) {
if (master_pipesize < 60*1024) {
/* Older kernels were limited to around 60-61 kB */
- ha_warning("Failed to vmsplice haterm mastre pipe after %lu bytes, splicing disabled for haterm\n", master_pipesize);
+ ha_warning("Failed to vmsplice haterm master pipe after %lu bytes, splicing disabled for haterm\n", master_pipesize);
put_pipe(master_pipe);
master_pipe = NULL;
master_pipesize = 0;