From 7b85f6a6843ac13e830c75a982ce95eb41412bba Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Sat, 1 Aug 2026 09:38:49 +0300 Subject: [PATCH] Disable splice support --- CMakeLists.txt | 2 +- Makefile.Linux | 6 +++++- doc/html/highload.html | 34 ++-------------------------------- man/3proxy.cfg.5 | 7 +++++++ src/dnspr.c | 2 -- src/proxymain.c | 14 ++++---------- 6 files changed, 19 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc6e9f6..1b324a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ option(3PROXY_USE_OPENSSL "Enable TLS/SSL support via OpenSSL (fallback when wol option(3PROXY_USE_PCRE2 "Enable PCRE2 regex filtering" ON) option(3PROXY_USE_PAM "Enable PAM/PamAuth" ON) option(3PROXY_USE_ODBC "Enable ODBC support (Unix only, always ON on Windows)" OFF) -option(3PROXY_USE_SPLICE "Use Linux splice() for zero-copy (Linux only)" ON) +option(3PROXY_USE_SPLICE "Build Linux splice() support, slower than read/write for most traffic (Linux only)" OFF) option(3PROXY_USE_POLL "Use poll() instead of select() (Unix only)" ON) option(3PROXY_USE_WSAPOLL "Use WSAPoll instead of select() (Windows only)" ON) option(3PROXY_USE_NETFILTER "Enable Linux netfilter support (Linux only)" ON) diff --git a/Makefile.Linux b/Makefile.Linux index 6bbaa2e..bd8982a 100644 --- a/Makefile.Linux +++ b/Makefile.Linux @@ -3,6 +3,10 @@ # # add -DWITH_ODBC to CFLAGS and -lodbc to LIBS to compile with ODBC # library support. Add -DSAFESQL for poorely written ODBC library / drivers. +# +# Linux splice() support is not built by default, it is slower than the +# read/write path for most traffic. Add -DWITHSPLICE to CFLAGS to build it, +# it must additionally be enabled per service with the -s option. BUILDDIR = ../bin/ PREFIX ?= 3proxy_ @@ -10,7 +14,7 @@ CRYPT_PREFIX ?= $(PREFIX) CC ?= gcc CFLAGS ?= -O3 -flto -CFLAGS += -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER -D WITH_UN +CFLAGS += -fno-strict-aliasing -c -pthread -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER -D WITH_UN COUT = -o LN ?= ${CC} DCFLAGS ?= -fPIC diff --git a/doc/html/highload.html b/doc/html/highload.html index a91f829..dea64a5 100644 --- a/doc/html/highload.html +++ b/doc/html/highload.html @@ -30,10 +30,7 @@ Each connected client requires: