Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support splice in http blind tunnel #11890

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,21 @@ list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
check_symbol_exists(pthread_getname_np pthread.h HAVE_PTHREAD_GETNAME_NP)
check_symbol_exists(pthread_get_name_np pthread.h HAVE_PTHREAD_GET_NAME_NP)

option(USE_SPLICE "Enable the use of splice(2) for zero copy (default OFF) (linux only)" OFF)

# Check for the splice function
include(CheckFunctionExists)
check_function_exists(splice HAVE_SPLICE)

# Configure USE_SPLICE based on both availability and user option
if(HAVE_SPLICE AND USE_SPLICE)
message(STATUS "splice is available and enabled.")
set(TS_USE_LINUX_SPLICE 1) # Use ON for true
else()
message(STATUS "splice is either not available or disabled by the user.")
set(TS_USE_LINUX_SPLICE 0) # Use OFF for false
endif()

check_source_compiles(
C "#include <pthread.h>
void main() { pthread_setname_np(\"name\"); }" HAVE_PTHREAD_SETNAME_NP_1
Expand Down
13 changes: 13 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON"
}
},
{
"name": "default-splice",
"displayName": "Default build with splice",
"description": "Default build using Ninja generator with splice",
"inherits": ["default"],
"binaryDir": "${sourceDir}/build-${presetName}",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_COLOR_DIAGNOSTICS": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"USE_SPLICE": "ON"
}
},
{
"name": "layout-defaults",
"displayName": "Default install layout paths template",
Expand Down
Loading