Skip to content

Commit

Permalink
Merge latest ASF master into 11-Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bneradt committed Jan 27, 2025
2 parents 1936cbe + d543c8a commit ee97be4
Show file tree
Hide file tree
Showing 37 changed files with 820 additions and 492 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install libmagick++-dev libncurses-dev libpcre2-dev libbrotli-dev libluajit-5.1-dev luajit libjansson-dev libcjose-dev libmaxminddb-dev libgeoip-dev ninja-build
sudo apt install libmagick++-dev libncurses-dev libpcre2-dev libbrotli-dev libluajit-5.1-dev luajit libjansson-dev libcjose-dev libmaxminddb-dev libgeoip-dev ninja-build cmake libpcre3-dev
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -70,6 +70,6 @@ jobs:
cmake -B build --preset ci
cmake --build build -v
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
6 changes: 5 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@
"name": "ci-ubuntu",
"displayName": "CI Ubuntu Hardened Build",
"description": "CI Pipeline config for Ubuntu with hardening flags",
"inherits": ["ci", "hardened"]
"inherits": ["ci", "hardened"],
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "ci-clang-analyzer",
Expand Down
1 change: 1 addition & 0 deletions include/proxy/http/remap/RemapConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct BUILD_TABLE_INFO {
};

const char *remap_parse_directive(BUILD_TABLE_INFO *bti, char *errbuf, size_t errbufsize);
bool remap_parse_config_bti(const char *path, BUILD_TABLE_INFO *bti);

const char *remap_validate_filter_args(acl_filter_rule **rule_pp, const char *const *argv, int argc, char *errStrBuf,
size_t errStrBufSize, ACLBehaviorPolicy behavior_policy);
Expand Down
4 changes: 1 addition & 3 deletions include/proxy/http/remap/UrlRewrite.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#pragma once

#include "iocore/eventsystem/Freer.h"
#include "tscore/ink_config.h"
#include "proxy/http/remap/UrlMapping.h"
#include "proxy/http/remap/UrlMappingPathIndex.h"
#include "proxy/http/HttpTransact.h"
Expand All @@ -40,9 +39,8 @@
#define URL_REMAP_FILTER_REFERER 0x00000001 /* enable "referer" header validation */
#define URL_REMAP_FILTER_REDIRECT_FMT 0x00010000 /* enable redirect URL formatting */

struct BUILD_TABLE_INFO;

/**
* used for redirection, mapping, and reverse mapping
**/
enum mapping_type {
Expand Down
10 changes: 5 additions & 5 deletions lib/swoc/include/swoc/bwf_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ template <typename T> class ContextNames : public NameMap<BufferWriter &(BufferW
* This nameset is used if no other is provided. Therefore bindings added to this nameset will be
* available in the default formatting use.
*/
extern ExternalNames Global_Names;
extern ExternalNames& Global_Names();

// --------------- Implementation --------------------
/// --- Spec ---
Expand Down Expand Up @@ -919,25 +919,25 @@ BufferWriter::print_nfv(Binding &&names, Extractor &&ex, bwf::ArgPack const &arg
template <typename... Args>
BufferWriter &
BufferWriter::print(const TextView &fmt, Args &&...args) {
return this->print_nfv(bwf::Global_Names.bind(), bwf::Format::bind(fmt), bwf::ArgTuple{std::forward_as_tuple(args...)});
return this->print_nfv(bwf::Global_Names().bind(), bwf::Format::bind(fmt), bwf::ArgTuple{std::forward_as_tuple(args...)});
}

template <typename... Args>
BufferWriter &
BufferWriter::print(bwf::Format const &fmt, Args &&...args) {
return this->print_nfv(bwf::Global_Names.bind(), fmt.bind(), bwf::ArgTuple{std::forward_as_tuple(args...)});
return this->print_nfv(bwf::Global_Names().bind(), fmt.bind(), bwf::ArgTuple{std::forward_as_tuple(args...)});
}

template <typename... Args>
BufferWriter &
BufferWriter::print_v(TextView const &fmt, std::tuple<Args...> const &args) {
return this->print_nfv(bwf::Global_Names.bind(), bwf::Format::bind(fmt), bwf::ArgTuple{args});
return this->print_nfv(bwf::Global_Names().bind(), bwf::Format::bind(fmt), bwf::ArgTuple{args});
}

template <typename... Args>
BufferWriter &
BufferWriter::print_v(const bwf::Format &fmt, const std::tuple<Args...> &args) {
return this->print_nfv(bwf::Global_Names.bind(), fmt.bind(), bwf::ArgTuple{args});
return this->print_nfv(bwf::Global_Names().bind(), fmt.bind(), bwf::ArgTuple{args});
}

template <typename Binding, typename Extractor>
Expand Down
4 changes: 2 additions & 2 deletions lib/swoc/include/swoc/swoc_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#pragma once

#if !defined(SWOC_VERSION_NS)
#define SWOC_VERSION_NS _1_5_12
#define SWOC_VERSION_NS _1_5_13
#endif

namespace swoc { inline namespace SWOC_VERSION_NS {
static constexpr unsigned MAJOR_VERSION = 1;
static constexpr unsigned MINOR_VERSION = 5;
static constexpr unsigned POINT_VERSION = 12;
static constexpr unsigned POINT_VERSION = 13;
}} // namespace swoc::SWOC_VERSION_NS
6 changes: 5 additions & 1 deletion lib/swoc/src/bw_format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
using namespace std::literals;
using namespace swoc::literals;

swoc::bwf::ExternalNames swoc::bwf::Global_Names;

using swoc::svto_radix;

namespace swoc { inline namespace SWOC_VERSION_NS {

namespace bwf {
ExternalNames& Global_Names() {
static swoc::bwf::ExternalNames Global_Names;
return Global_Names;
}

const Spec Spec::DEFAULT;

Expand Down
8 changes: 4 additions & 4 deletions lib/swoc/unit_tests/ex_bw_format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ struct Context {

void
EX_BWF_Format_Init() {
swoc::bwf::Global_Names.assign("timestamp", &BWF_Timestamp);
swoc::bwf::Global_Names.assign("now", &BWF_Now);
swoc::bwf::Global_Names.assign("version", &BWF_Version);
swoc::bwf::Global_Names.assign("dave", &BWF_EvilDave);
swoc::bwf::Global_Names().assign("timestamp", &BWF_Timestamp);
swoc::bwf::Global_Names().assign("now", &BWF_Now);
swoc::bwf::Global_Names().assign("version", &BWF_Version);
swoc::bwf::Global_Names().assign("dave", &BWF_EvilDave);
}

// Work with external / global names.
Expand Down
5 changes: 5 additions & 0 deletions plugins/compress/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ Configuration::Parse(const char *path)
// Update the defaults for the last host configuration too, if needed.
current_host_configuration->update_defaults();

// Check combination of configs
if (!current_host_configuration->cache() && current_host_configuration->range_request()) {
warning("Combination of 'cache false' and 'range-request true' might deliver corrupted content");
}

if (state != kParseStart) {
warning("the parser state indicates that data was expected when it reached the end of the file (%d)", state);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/ja4_fingerprint/ja4.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TLSClientHelloSummary
using difference_type = std::iterator_traits<std::vector<std::uint16_t>::iterator>::difference_type;

Protocol protocol;
std::uint16_t TLS_version;
std::uint16_t TLS_version{0}; // 0 is not the default, this is only to not have it un-initialized.
std::string ALPN;

std::vector<std::uint16_t> const &get_ciphers() const;
Expand Down
4 changes: 2 additions & 2 deletions plugins/experimental/ja4_fingerprint/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ get_log_handle()
static constexpr TSPluginRegistrationInfo
get_registration_info()
{
TSPluginRegistrationInfo info;
TSPluginRegistrationInfo info{};
info.plugin_name = PLUGIN_NAME;
info.vendor_name = PLUGIN_VENDOR;
info.support_email = PLUGIN_SUPPORT_EMAIL;
Expand Down Expand Up @@ -179,7 +179,7 @@ handle_client_hello(TSCont /* cont ATS_UNUSED */, TSEvent event, void *edata)
std::string
get_fingerprint(SSL *ssl)
{
JA4::TLSClientHelloSummary summary;
JA4::TLSClientHelloSummary summary{};
summary.protocol = JA4::Protocol::TLS;
summary.TLS_version = get_version(ssl);
summary.ALPN = get_first_ALPN(ssl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ Context::render_transient(F const &f)
// create the writer and clean it up. Also, the outer is responsible for finalizing the
// transient buffer used.
if (!_transient_writer.has_value()) {
_transient_writer.template emplace(this->transient_buffer());
_transient_writer.emplace(this->transient_buffer());
outer_p = true;
} else {
base = _transient_writer->extent();
Expand Down
6 changes: 3 additions & 3 deletions plugins/experimental/txn_box/plugin/include/txn_box/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ constexpr std::array<ValueType, FeatureTypeList::size> FeatureIndexToValue{
namespace detail
{
template <typename GENERATOR, size_t... IDX>
constexpr std::initializer_list<std::result_of_t<GENERATOR(size_t)>>
constexpr std::initializer_list<std::invoke_result_t<GENERATOR, size_t>>
indexed_init_list(GENERATOR &&g, std::index_sequence<IDX...> &&)
{
return {g(IDX)...};
}
template <size_t N, typename GENERATOR>
constexpr std::initializer_list<std::result_of_t<GENERATOR(size_t)>>
constexpr std::initializer_list<std::invoke_result_t<GENERATOR, size_t>>
indexed_init_list(GENERATOR &&g)
{
return indexed_init_list(std::forward<GENERATOR>(g), std::make_index_sequence<N>());
Expand All @@ -204,7 +204,7 @@ indexed_array(GENERATOR &&g, std::index_sequence<IDX...> &&)
return std::array<std::invoke_result_t<GENERATOR, size_t>, sizeof...(IDX)>{g(IDX)...};
}
template <size_t N, typename GENERATOR>
constexpr std::array<std::result_of_t<GENERATOR(size_t)>, N>
constexpr std::array<std::invoke_result_t<GENERATOR, size_t>, N>
indexed_array(GENERATOR &&g)
{
return indexed_array(std::forward<GENERATOR>(g), std::make_index_sequence<N>());
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/txn_box/plugin/src/Machinery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ class FieldDirective : public Directive
auto
operator()(T &&t) -> EnableForFeatureTypes<T, void>
{
this->assign(_ctx.template render_transient([&t](BufferWriter &w) { bwformat(w, bwf::Spec::DEFAULT, t); }));
this->assign(_ctx.render_transient([&t](BufferWriter &w) { bwformat(w, bwf::Spec::DEFAULT, t); }));
this->clear_dups();
}
};
Expand Down
Loading

0 comments on commit ee97be4

Please sign in to comment.