Skip to content
Merged
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
3 changes: 2 additions & 1 deletion include/iocore/net/ConnectionTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <mutex>
#include <sstream>
#include <tuple>
#include <utility>
#include "records/RecCore.h"
#include "tscore/ink_platform.h"
#include "tscore/ink_config.h"
Expand Down Expand Up @@ -429,7 +430,7 @@ ConnectionTracker::Group::metric_name(const Key &key, std::string_view fqdn, std
default:
Warning("Invalid matching type to add to per_server.connections metrics");
}
return metric_prefix.empty() ? metric_name : metric_prefix + "." + metric_name;
return metric_prefix.empty() ? std::move(metric_name) : metric_prefix + "." + metric_name;
}

inline bool
Expand Down
5 changes: 3 additions & 2 deletions include/mgmt/config/ConfigReloadTrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@

#include <atomic>
#include <chrono>
#include <iostream>
#include <string_view>
#include <string>
#include <mutex>
#include <shared_mutex>
#include <iostream>
#include <utility>

#include <swoc/Errata.h>
#include <tscore/ink_platform.h>
Expand Down Expand Up @@ -207,7 +208,7 @@ class ConfigReloadTask : public std::enable_shared_from_this<ConfigReloadTask>
using self_type = ConfigReloadTask;
ConfigReloadTask() = default;
ConfigReloadTask(std::string_view token, std::string_view description, bool main_task, ConfigReloadTaskPtr parent)
: _info(State::CREATED, token, description, main_task), _parent{parent}
: _info(State::CREATED, token, description, main_task), _parent{std::move(parent)}
{
Comment thread
JosiahWI marked this conversation as resolved.
if (_info.main_task) {
_info.state = State::IN_PROGRESS;
Expand Down
5 changes: 3 additions & 2 deletions plugins/experimental/filter_body/filter_body.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <cstring>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>
#include <cctype>
Expand Down Expand Up @@ -901,7 +902,7 @@ parse_config(const char *filename)
AddHeader add_hdr;
add_hdr.name = hdr.first.as<std::string>();
add_hdr.value = hdr.second.as<std::string>();
rule.add_headers.push_back(add_hdr);
rule.add_headers.push_back(std::move(add_hdr));
}
}
}
Expand Down Expand Up @@ -953,7 +954,7 @@ parse_config(const char *filename)
cond.patterns.push_back(pattern_node.as<std::string>());
}
}
rule.headers.push_back(cond);
rule.headers.push_back(std::move(cond));
}
}

Expand Down
3 changes: 2 additions & 1 deletion plugins/experimental/jax_fingerprint/ja4/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <string>
#include <string_view>
#include <unordered_map>
#include <utility>
#include <vector>

namespace
Expand Down Expand Up @@ -127,7 +128,7 @@ class MockDatasource : public ja4::Datasource
void
set_first_alpn(std::string first_alpn)
{
this->_first_alpn = first_alpn;
this->_first_alpn = std::move(first_alpn);
}
void
add_cipher(std::uint16_t cipher)
Expand Down
5 changes: 3 additions & 2 deletions plugins/experimental/jax_fingerprint/ja4h/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <string>
#include <map>
#include <utility>

namespace
{
Expand Down Expand Up @@ -89,7 +90,7 @@ class MockDatasource : public Datasource
void
set_method(std::string method)
{
this->_method = method;
this->_method = std::move(method);
}
void
set_version(int version)
Expand All @@ -99,7 +100,7 @@ class MockDatasource : public Datasource
void
set_fields(std::map<std::string, std::string> fields)
{
this->_fields = fields;
this->_fields = std::move(fields);
}

private:
Expand Down
3 changes: 2 additions & 1 deletion plugins/experimental/txn_box/plugin/src/Comparison.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

#include <string>
#include <utility>
#include <algorithm>

#include <swoc/bwf_base.h>
Expand Down Expand Up @@ -1391,7 +1392,7 @@ ComboComparison::load(Config &cfg, YAML::Node const &cmp_node, TextView const &k
} else if (value_node.IsSequence()) {
cmps.reserve(cmp_node.size());
for (auto child : value_node) {
auto errata = self_type::load_case(cfg, cmps, child);
auto errata = self_type::load_case(cfg, cmps, std::move(child));
if (!errata.is_ok()) {
errata.note("While parsing {} comparison at {}.", key, cmp_node.Mark());
return errata;
Expand Down
3 changes: 2 additions & 1 deletion plugins/experimental/txn_box/plugin/src/Config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <string>
#include <map>
#include <numeric>
#include <utility>
#include <glob.h>

#include <swoc/TextView.h>
Expand Down Expand Up @@ -649,7 +650,7 @@ Config::parse_yaml(YAML::Node root, TextView path)

if (root.IsSequence()) {
for (auto child : root) {
errata.note((this->*drtv_loader)(child));
errata.note((this->*drtv_loader)(std::move(child)));
}
if (!errata.is_ok()) {
errata.note(R"(While loading list of top level directives for "{}" at {}.)", path, root.Mark());
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/txn_box/plugin/src/ip_space.cc
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ Do_ip_space_define::load(Config &cfg, CfgStaticData const *, YAML::Node drtv_nod
}
} else if (cols_node.IsSequence()) {
for (auto child : cols_node) {
auto errata = self->define_column(cfg, child);
auto errata = self->define_column(cfg, std::move(child));
if (!errata.is_ok()) {
errata.note(R"(While parsing "{}" key at {}.)", COLUMNS_TAG, cols_node.Mark());
return errata;
Expand Down
3 changes: 2 additions & 1 deletion plugins/prefetch/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "path.h"

#include <cctype>
#include <utility>

namespace
{
Expand Down Expand Up @@ -181,7 +182,7 @@ makeSafeRelativeFetchPath(const String &currentPath, const String &relativePath,
return false;
}

fetchPath.path = normalizedCandidatePath;
fetchPath.path = std::move(normalizedCandidatePath);
if (String::npos != queryStart) {
fetchPath.hasQuery = true;
fetchPath.query = relativePath.substr(queryStart + 1);
Expand Down
3 changes: 2 additions & 1 deletion plugins/stats_over_http/stats_over_http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <sys/stat.h>
#include <ts/ts.h>
#include <unordered_map>
#include <utility>
#include <vector>
#include <unistd.h>
#include <zlib.h>
Expand Down Expand Up @@ -744,7 +745,7 @@ parse_metric_v2(std::string_view name)
}
}

return {base_name, labels};
return {std::move(base_name), std::move(labels)};
}

static bool
Expand Down
4 changes: 2 additions & 2 deletions plugins/webp_transform/ImageTransform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,13 @@ class GlobalHookPlugin : public GlobalPlugin
if (!content_length_usable) {
TSHttpTxnServerRespNoStoreSet(static_cast<TSHttpTxn>(transaction.getAtsHandle()), 1);
}
transaction.addPlugin(new ImageTransform(transaction, ctype, input_image_type, ImageEncoding::webp));
transaction.addPlugin(new ImageTransform(transaction, std::move(ctype), input_image_type, ImageEncoding::webp));
} else if (webp_supported == false && transaction_convert_to_jpeg == true) {
Dbg(webp_dbg_ctl, "Content type is webp. Converting to jpeg");
if (!content_length_usable) {
TSHttpTxnServerRespNoStoreSet(static_cast<TSHttpTxn>(transaction.getAtsHandle()), 1);
}
transaction.addPlugin(new ImageTransform(transaction, ctype, input_image_type, ImageEncoding::jpeg));
transaction.addPlugin(new ImageTransform(transaction, std::move(ctype), input_image_type, ImageEncoding::jpeg));
} else {
Dbg(webp_dbg_ctl, "Nothing to convert");
}
Expand Down
6 changes: 4 additions & 2 deletions src/api/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
*/

#include <atomic>
#include <charconv>
#include <tuple>
#include <unordered_map>
#include <string_view>
#include <string>
#include <charconv>
#include <utility>

#include "iocore/net/NetVConnection.h"
#include "iocore/net/NetHandler.h"
Expand Down Expand Up @@ -9079,7 +9080,8 @@ TSLogFieldRegister(std::string_view name, std::string_view symbol, TSLogType typ

LogField *field = new LogField(
name.data(), symbol.data(), static_cast<LogField::Type>(type),
[marshal_cb](void *sm, char *buf) -> int { return marshal_cb(reinterpret_cast<TSHttpTxn>(sm), buf); }, unmarshal_cb);
[marshal_cb = std::move(marshal_cb)](void *sm, char *buf) -> int { return marshal_cb(reinterpret_cast<TSHttpTxn>(sm), buf); },
unmarshal_cb);
Log::global_field_list.add(field, false);
Log::field_symbol_hash.emplace(symbol.data(), field);

Expand Down
5 changes: 3 additions & 2 deletions src/config/ssl_multicert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <cctype>
#include <exception>
#include <set>
#include <utility>

#include <yaml-cpp/yaml.h>

Expand Down Expand Up @@ -281,7 +282,7 @@ SSLMultiCertParser::parse_yaml(std::string_view content)
return {result, swoc::Errata("YAML parse error: {}", ex.what())};
}

return {result, std::move(errata)};
return {std::move(result), std::move(errata)};
Comment thread
JosiahWI marked this conversation as resolved.
}

ConfigResult<SSLMultiCertConfig>
Expand Down Expand Up @@ -337,7 +338,7 @@ SSLMultiCertParser::parse_legacy(std::string_view content)
result.push_back(std::move(entry));
}

return {result, std::move(errata)};
return {std::move(result), std::move(errata)};
}

std::string
Expand Down
11 changes: 6 additions & 5 deletions src/config/unit_tests/test_ssl_multicert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <filesystem>
#include <fstream>
#include <utility>

#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
Expand Down Expand Up @@ -239,13 +240,13 @@ TEST_CASE("SSLMultiCertMarshaller produces valid YAML", "[ssl_multicert][marshal
entry1.ssl_cert_name = "server.pem";
entry1.dest_ip = "*";
entry1.ssl_key_name = "server.key";
config.push_back(entry1);
config.push_back(std::move(entry1));

SSLMultiCertEntry entry2;
entry2.ssl_cert_name = "another.pem";
entry2.dest_ip = "[::1]:8443";
entry2.ssl_ticket_enabled = 1;
config.push_back(entry2);
config.push_back(std::move(entry2));

SSLMultiCertMarshaller marshaller;
std::string yaml = marshaller.to_yaml(config);
Expand Down Expand Up @@ -276,14 +277,14 @@ TEST_CASE("SSLMultiCertMarshaller produces valid JSON", "[ssl_multicert][marshal
SSLMultiCertEntry entry1;
entry1.ssl_cert_name = "server.pem";
entry1.dest_ip = "*";
config.push_back(entry1);
config.push_back(std::move(entry1));

SSLMultiCertEntry entry2;
entry2.ssl_cert_name = "another.pem";
entry2.dest_ip = "[::1]:8443";
entry2.ssl_ticket_enabled = 1;
entry2.ssl_ticket_number = 5;
config.push_back(entry2);
config.push_back(std::move(entry2));

SSLMultiCertMarshaller marshaller;
std::string json = marshaller.to_json(config);
Expand All @@ -305,7 +306,7 @@ TEST_CASE("SSLMultiCertMarshaller handles special characters", "[ssl_multicert][
entry.ssl_cert_name = "server.pem";
entry.dest_ip = "*";
entry.ssl_key_dialog = "exec:/path/to/script \"with quotes\"";
config.push_back(entry);
config.push_back(std::move(entry));

SSLMultiCertMarshaller marshaller;

Expand Down
3 changes: 2 additions & 1 deletion src/iocore/cache/CacheDir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include <thread>
#include <unordered_map>
#include <utility>

#ifdef LOOP_CHECK_MODE
#define DIR_LOOP_THRESHOLD 1000
Expand Down Expand Up @@ -932,7 +933,7 @@ sync_cache_dir_on_shutdown()
for (auto &[disk, indices] : drive_stripe_map) {
Dbg(dbg_ctl_cache_dir_sync, "Disk %s: syncing %zu stripe(s)", disk->path, indices.size());
auto stripe_indices = indices;
threads.emplace_back([stripe_indices]() {
threads.emplace_back([stripe_indices = std::move(stripe_indices)]() {
// Use a thread_local variable to give each OS thread a unique EThread* sentinel instead of 0xdeadbeef.
thread_local char thread_sentinel;
EThread *t = reinterpret_cast<EThread *>(&thread_sentinel);
Expand Down
3 changes: 2 additions & 1 deletion src/iocore/net/unit_tests/test_SSLSNIConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <catch2/catch_test_macros.hpp>

#include <cstring>
#include <utility>
#include "tscore/ink_inet.h"

TEST_CASE("Test SSLSNIConfig")
Expand Down Expand Up @@ -266,7 +267,7 @@ TEST_CASE("SNIConfig handles high-bit bytes while normalizing server names")
item.inbound_port_ranges.emplace_back(1, ts::MAX_PORT_VALUE);

SNIConfigParams params;
params.yaml_sni.items.push_back(item);
params.yaml_sni.items.push_back(std::move(item));
REQUIRE(params.load_sni_config());

std::string servername{"hIGH"};
Expand Down
5 changes: 3 additions & 2 deletions src/mgmt/config/ConfigReloadTrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "tsutil/ts_diag_levels.h"

#include <algorithm>
#include <utility>
#include "tsutil/Metrics.h"
#include "tsutil/ts_time_parser.h"

Expand Down Expand Up @@ -85,7 +86,7 @@ ConfigReloadTask::add_child(std::string_view description, std::string_view filen
// Read token directly - can't call get_token() as it would deadlock (tries to acquire shared_lock on same mutex)
auto trace = std::make_shared<ConfigReloadTask>(_info.token, description, false, shared_from_this());
_info.sub_tasks.push_back(trace);
return ConfigContext{trace, description, filename};
return ConfigContext{std::move(trace), description, filename};
}

ConfigReloadTask &
Expand Down Expand Up @@ -469,7 +470,7 @@ ConfigReloadProgress::check_progress(int /* etype */, void * /* data */)
}

ConfigReloadProgress::ConfigReloadProgress(ConfigReloadTaskPtr reload)
: Continuation(new_ProxyMutex()), _reload{reload}, _every{get_configured_check_interval()}
: Continuation(new_ProxyMutex()), _reload{std::move(reload)}, _every{get_configured_check_interval()}
{
SET_HANDLER(&ConfigReloadProgress::check_progress);
}
6 changes: 3 additions & 3 deletions src/mgmt/config/ReloadCoordinator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ReloadCoordinator::reserve_subtask(std::string_view config_key)

auto task = std::make_shared<ConfigReloadTask>(_current_task->get_token(), config_key, false, _current_task);
task->set_config_key(config_key);
_current_task->add_sub_task(task);
_current_task->add_sub_task(std::move(task));

Dbg(dbg_ctl, "Reserved subtask for config '%.*s'", static_cast<int>(config_key.size()), config_key.data());
}
Expand All @@ -153,7 +153,7 @@ ReloadCoordinator::create_config_context(std::string_view config_key, std::strin
if (existing->get_state() == ConfigReloadTask::State::CREATED) {
// Activate the reserved subtask
Dbg(dbg_ctl, "Activating reserved subtask for config '%.*s'", static_cast<int>(config_key.size()), config_key.data());
return ConfigContext{existing, description, filename};
return ConfigContext{std::move(existing), description, filename};
}
// Already handled — true duplicate
Dbg(dbg_ctl, "Duplicate reload for config '%.*s' — subtask already exists, skipping", static_cast<int>(config_key.size()),
Expand All @@ -168,7 +168,7 @@ ReloadCoordinator::create_config_context(std::string_view config_key, std::strin
task->set_config_key(config_key);
_current_task->add_sub_task(task);

ConfigContext ctx{task, description, filename};
ConfigContext ctx{std::move(task), description, filename};
return ctx;
}

Expand Down
Loading