From 5c78d1a342c6f295b7b6fdb8ac9b1a4f8644dc33 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Sun, 11 Oct 2026 20:48:49 +0300 Subject: [PATCH] Return splice support in default builds --- CMakeLists.txt | 2 +- Makefile.Linux | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09c205a..435e043 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,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 "Build Linux splice() support, slower than read/write for most traffic (Linux only)" OFF) +option(3PROXY_USE_SPLICE "Build Linux splice() support, used by services given -s (Linux only)" ON) 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 59079c7..ba7cb12 100644 --- a/Makefile.Linux +++ b/Makefile.Linux @@ -4,9 +4,9 @@ # 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. +# Linux splice() support is built, but used only by services given the -s +# option: it is faster for large transfers and slower for small requests. +# Remove -DWITHSPLICE from CFLAGS to build without it. BUILDDIR = ../bin/ PREFIX ?= 3proxy_ @@ -14,7 +14,7 @@ CRYPT_PREFIX ?= $(PREFIX) CC ?= gcc CFLAGS ?= -O3 -flto -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 +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 COUT = -o LN ?= ${CC} DCFLAGS ?= -fPIC