Skip to content

Commit 3caa876

Browse files
author
bneradt
committed
Merge latest master into 11-Dev
There were no conflicts.
2 parents 95c9c77 + b7a2edc commit 3caa876

File tree

222 files changed

+5298
-1808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+5298
-1808
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ rc/trafficserver.service
170170
.libs/
171171

172172
.svn/
173-
.vscode/
173+
.vscode/*
174+
!.vscode/settings.json
174175
target
175176

176177
tsxs

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"files.associations": {
3+
"*.cript": "cpp",
4+
"*.test.py": "python",
35
"*.test.ext": "python"
46
}
57
}
6-

CMakeLists.txt

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ if(LibLZMA_FOUND)
274274
set(HAVE_LZMA_H TRUE)
275275
endif()
276276

277-
find_package(PCRE REQUIRED)
278277
pkg_check_modules(PCRE2 REQUIRED IMPORTED_TARGET libpcre2-8)
279278

280279
include(CheckOpenSSLIsBoringSSL)
@@ -360,6 +359,33 @@ set(TS_USE_MALLOC_ALLOCATOR ${ENABLE_MALLOC_ALLOCATOR})
360359
set(TS_USE_ALLOCATOR_METRICS ${ENABLE_ALLOCATOR_METRICS})
361360
find_package(ZLIB REQUIRED)
362361

362+
find_package(zstd CONFIG QUIET)
363+
if(zstd_FOUND)
364+
365+
# Provide a compatibility target name if the upstream package does not export it
366+
# Our code links against `zstd::zstd`; upstream zstd usually exports
367+
# `zstd::libzstd_shared`/`zstd::libzstd_static`. Create an alias if needed.
368+
if(NOT TARGET zstd::zstd)
369+
if(TARGET zstd::libzstd_shared)
370+
set(_zstd_target zstd::libzstd_shared)
371+
elseif(TARGET zstd::libzstd_static)
372+
set(_zstd_target zstd::libzstd_static)
373+
elseif(TARGET zstd::libzstd)
374+
set(_zstd_target zstd::libzstd)
375+
endif()
376+
if(DEFINED _zstd_target)
377+
add_library(zstd_zstd INTERFACE)
378+
target_link_libraries(zstd_zstd INTERFACE ${_zstd_target})
379+
add_library(zstd::zstd ALIAS zstd_zstd)
380+
set(HAVE_ZSTD_H TRUE)
381+
else()
382+
set(HAVE_ZSTD_H FALSE)
383+
endif()
384+
endif()
385+
else()
386+
set(HAVE_ZSTD_H FALSE)
387+
endif()
388+
363389
# ncurses is used in traffic_top
364390
find_package(Curses)
365391
set(HAVE_CURSES_H ${CURSES_HAVE_CURSES_H})

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $ ccmake build
4747
To specify the location of a dependency (like `--with-*` for autotools builds), you generally set a variable with the `ROOT`. The big exception to this is for openssl. This variable is called `OPENSSL_ROOT_DIR`
4848

4949
```
50-
$ cmake -B build -Djemalloc_ROOT=/opt/jemalloc -DPCRE_ROOT=/opt/edge -DOPENSSL_ROOT_DIR=/opt/boringssl
50+
$ cmake -B build -Djemalloc_ROOT=/opt/jemalloc -DOPENSSL_ROOT_DIR=/opt/boringssl
5151
```
5252

5353
#### Using presets to configure the build

ci/coverity-model.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,15 @@
1616
limitations under the License.
1717
*/
1818

19-
// This is for PCRE, where the offsets vector is considered uninitialized, but it's an
19+
// This is for PCRE2, where the offsets vector is considered uninitialized, but it's an
2020
// output vector only (input doesn't matter).
2121
extern "C" {
22-
#define PCRE_SPTR const char *
23-
24-
struct real_pcre; /* declaration; the definition is private */
25-
typedef struct real_pcre pcre;
26-
27-
typedef struct pcre_extra {
28-
} pcre_extra;
22+
#define PCRE2_CODE_UNIT_WIDTH 8
23+
#include <pcre2.h>
2924

3025
int
31-
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data,
32-
PCRE_SPTR subject, int length, int start_offset, int options, int *offsets,
33-
int offsetcount)
26+
pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, PCRE2_SIZE startoffset, uint32_t options,
27+
pcre2_match_data *match_data, pcre2_match_context *mcontext)
3428
{
3529
__coverity_panic__();
3630
}

ci/docker/deb/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ RUN apt-get update; apt-get -y dist-upgrade; \
5555
apt-get -y install libssl-dev libexpat1-dev libpcre3-dev libcap-dev \
5656
libhwloc-dev libunwind8 libunwind-dev zlib1g-dev \
5757
tcl-dev tcl8.6-dev libjemalloc-dev libluajit-5.1-dev liblzma-dev \
58-
libhiredis-dev libbrotli-dev libncurses-dev libgeoip-dev libmagick++-dev; \
58+
libhiredis-dev libbrotli-dev libncurses-dev libgeoip-dev libmagick++-dev \
59+
libzstd-dev; \
5960
# Optional: This is for the OpenSSH server, and Jenkins account + access (comment out if not needed)
6061
apt-get -y install openssh-server openjdk-8-jre && mkdir /run/sshd; \
6162
groupadd -g 665 jenkins && \

ci/docker/yum/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ RUN yum -y update; \
5252
# Devel packages that ATS needs
5353
yum -y install openssl-devel expat-devel pcre-devel libcap-devel hwloc-devel libunwind-devel \
5454
xz-devel libcurl-devel ncurses-devel jemalloc-devel GeoIP-devel luajit-devel brotli-devel \
55-
ImageMagick-devel ImageMagick-c++-devel hiredis-devel zlib-devel \
55+
ImageMagick-devel ImageMagick-c++-devel hiredis-devel zlib-devel zstd-devel \
5656
perl-ExtUtils-MakeMaker perl-Digest-SHA perl-URI; \
5757
# This is for autest stuff
5858
yum -y install python3 httpd-tools procps-ng nmap-ncat pipenv \

cmake/ExperimentalPlugins.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ auto_option(ACCESS_CONTROL FEATURE_VAR BUILD_ACCESS_CONTROL DEFAULT ${_DEFAULT})
3131
auto_option(BLOCK_ERRORS FEATURE_VAR BUILD_BLOCK_ERRORS DEFAULT ${_DEFAULT})
3232
auto_option(CACHE_FILL FEATURE_VAR BUILD_CACHE_FILL DEFAULT ${_DEFAULT})
3333
auto_option(CERT_REPORTING_TOOL FEATURE_VAR BUILD_CERT_REPORTING_TOOL DEFAULT ${_DEFAULT})
34+
auto_option(CONNECTION_EXEMPT_LIST FEATURE_VAR BUILD_CONNECTION_EXEMPT_LIST DEFAULT ${_DEFAULT})
3435
auto_option(COOKIE_REMAP FEATURE_VAR BUILD_COOKIE_REMAP DEFAULT ${_DEFAULT})
3536
auto_option(CUSTOM_REDIRECT FEATURE_VAR BUILD_CUSTOM_REDIRECT DEFAULT ${_DEFAULT})
3637
auto_option(FQ_PACING FEATURE_VAR BUILD_FQ_PACING DEFAULT ${_DEFAULT})
Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,21 @@
1515
#
1616
#######################
1717

18-
# FindPCRE.cmake
19-
#
20-
# This will define the following variables
21-
#
22-
# PCRE_FOUND
23-
# PCRE_LIBRARIES
24-
# PCRE_INCLUDE_DIRS
25-
#
26-
# and the following imported targets
27-
#
28-
# PCRE::PCRE
29-
#
30-
31-
find_path(PCRE_INCLUDE_DIR NAMES pcre.h) # PATH_SUFFIXES pcre)
32-
find_library(PCRE_LIBRARY NAMES pcre)
33-
34-
mark_as_advanced(PCRE_FOUND PCRE_LIBRARY PCRE_INCLUDE_DIR)
18+
# Function to build pre-compiled cript scripts
19+
function(add_cript name source_file)
20+
# Check if ENABLE_CRIPTS is ON, if not, skip
21+
if(NOT ENABLE_CRIPTS)
22+
message(STATUS "Skipping cript ${name} - ENABLE_CRIPTS is OFF")
23+
return()
24+
endif()
3525

36-
include(FindPackageHandleStandardArgs)
37-
find_package_handle_standard_args(PCRE REQUIRED_VARS PCRE_INCLUDE_DIR PCRE_LIBRARY)
26+
# Use the standard ATS plugin macro and link with cripts
27+
add_atsplugin(${name} ${source_file})
28+
target_link_libraries(${name} PRIVATE ts::cripts)
3829

39-
if(PCRE_FOUND)
40-
set(PCRE_INCLUDE_DIRS "${PCRE_INCLUDE_DIR}")
41-
set(PCRE_LIBRARIES "${PCRE_LIBRARY}")
42-
endif()
30+
# Tell CMake that .cript files are C++ files
31+
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)
32+
set_source_files_properties(${source_file} PROPERTIES LANGUAGE CXX)
4333

44-
if(PCRE_FOUND AND NOT TARGET PCRE::PCRE)
45-
add_library(PCRE::PCRE INTERFACE IMPORTED)
46-
target_include_directories(PCRE::PCRE INTERFACE ${PCRE_INCLUDE_DIRS})
47-
target_link_libraries(PCRE::PCRE INTERFACE "${PCRE_LIBRARY}")
48-
endif()
34+
verify_remap_plugin(${name})
35+
endfunction()

contrib/docker/ubuntu/noble/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ RUN apt update \
4848
libpcre3-dev \
4949
hwloc \
5050
libbrotli-dev \
51+
libzstd-dev \
52+
luajit \
5153
libluajit-5.1-dev \
5254
libcap-dev \
5355
libmagick++-dev \

0 commit comments

Comments
 (0)