Skip to content
Draft
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
2 changes: 1 addition & 1 deletion plugins/cachekey/cachekey.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ captureWholeHeaders(const ConfigHeaders &config, const String &name, const Strin
if (config.toBeAdded(name)) {
String header;
header.append(name).append(":").append(value);
captures.insert(header);
captures.insert(std::move(header));
CacheKeyDebug("adding header '%s: %s'", name.c_str(), value.c_str());
} else {
CacheKeyDebug("failed to find header '%s'", name.c_str());
Expand Down
2 changes: 1 addition & 1 deletion plugins/cachekey/configs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ Configs::setKeyType(const char *arg)
StringVector types;
::commaSeparateString<StringVector>(types, arg);

for (auto type : types) {
for (const auto &type : types) {
if (9 == type.length() && 0 == strncasecmp(type.c_str(), "cache_key", 9)) {
_keyTypes.insert(CacheKeyKeyType::CACHE_KEY);
CacheKeyDebug("setting cache key");
Expand Down
7 changes: 4 additions & 3 deletions plugins/esi/lib/EsiParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <ts/ts.h>

#include <cctype>
#include <utility>

using std::string;
using namespace EsiLib;
Expand Down Expand Up @@ -256,7 +257,7 @@ EsiParser::_processSimpleContentTag(DocNode::TYPE node_type, const char *data, i
TSError("[%s] Could not parse simple content of [%s] node", __FUNCTION__, DocNode::type_names_[node_type]);
return false;
}
node_list.push_back(new_node);
node_list.push_back(std::move(new_node));
return true;
}

Expand Down Expand Up @@ -541,7 +542,7 @@ EsiParser::_processTryTag(const string &data, size_t curr_pos, size_t end_pos, D
TSError("[%s] try block must contain one each of attempt and except nodes", __FUNCTION__);
return false;
}
node_list.push_back(try_node);
node_list.push_back(std::move(try_node));
Dbg(dbg_ctl, "[%s] Added try node successfully", __FUNCTION__);
return true;
}
Expand Down Expand Up @@ -586,7 +587,7 @@ EsiParser::_processChooseTag(const string &data, size_t curr_pos, size_t end_pos
}
++iter;
}
node_list.push_back(choose_node);
node_list.push_back(std::move(choose_node));
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions plugins/experimental/access_control/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ loadLine<StringMap>(StringMap &map, const String &line)
std::getline(ss, value, '=');
trim(key);
trim(value);
map[key] = value;
map[key] = std::move(value);

#ifdef ACCESS_CONTROL_LOG_SECRETS
AccessControlDebug("Adding secrets[%s]='%s'", key.c_str(), value.c_str());
AccessControlDebug("Adding secrets[%s]='%s'", key.c_str(), map[key].c_str());
#endif
}

Expand All @@ -116,10 +116,10 @@ loadLine<StringVector>(StringVector &vector, const String &line)
{
String trimmedLine(line);
trim(trimmedLine);
vector.push_back(trimmedLine);
vector.push_back(std::move(trimmedLine));

#ifdef ACCESS_CONTROL_LOG_SECRETS
AccessControlDebug("Adding secrets[%d]='%s'", (int)(vector.size() - 1), trimmedLine.c_str());
AccessControlDebug("Adding secrets[%d]='%s'", (int)(vector.size() - 1), vector.back().c_str());
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/experimental/access_control/pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Pattern::process(const String &subject, StringVector &result)
/* Replacement pattern was provided in the configuration - capture and replace. */
String element;
if (replace(subject, element)) {
result.push_back(element);
result.push_back(std::move(element));
} else {
return false;
}
Expand Down Expand Up @@ -242,7 +242,7 @@ Pattern::capture(const String &subject, StringVector &result)
String dst(match_view.data(), match_view.size());

AccessControlDebug("capturing '%s' %d", dst.c_str(), i);
result.push_back(dst);
result.push_back(std::move(dst));
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/jax_fingerprint/ja4h/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MockDatasource : public Datasource
SHA256_CTX sha256ctx;
SHA256_Init(&sha256ctx);

for (auto ite : this->_fields) {
for (auto const &ite : this->_fields) {
if (this->_should_include_field({ite.first.c_str(), ite.first.size()})) {
SHA256_Update(&sha256ctx, ite.first.c_str(), ite.first.size());
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/rate_limit/sni_selector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ SniSelector::yamlParser(const std::string &yaml_file)
return false;
}
Dbg(dbg_ctl, "Adding alias: %s -> %s", alias.c_str(), name.c_str());
addAlias(alias, limiter_ptr);
addAlias(std::move(alias), limiter_ptr);
}
} else {
TSError("[%s] aliases node is not a sequence", PLUGIN_NAME);
Expand Down
3 changes: 2 additions & 1 deletion plugins/experimental/rate_limit/txn_limiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <unistd.h>
#include <getopt.h>
#include <cstdlib>
#include <utility>

#include "txn_limiter.h"

Expand Down Expand Up @@ -178,7 +179,7 @@ TxnRateLimiter::initialize(int argc, const char *argv[])
_action = TSContScheduleEveryOnPool(_queue_cont, QUEUE_DELAY_TIME.count(), TS_THREAD_POOL_TASK);
}

this->initializeMetrics(RATE_LIMITER_TYPE_REMAP, tag, prefix);
this->initializeMetrics(RATE_LIMITER_TYPE_REMAP, std::move(tag), std::move(prefix));

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions plugins/experimental/stek_share/log_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ STEKShareLogStore::append(nuraft::ptr<nuraft::log_entry> &entry)

std::lock_guard<std::mutex> l(logs_lock_);
size_t idx = start_idx_ + logs_.size() - 1;
logs_[idx] = clone;
logs_[idx] = std::move(clone);
return idx;
}

Expand Down Expand Up @@ -205,7 +205,7 @@ STEKShareLogStore::pack(uint64_t index, int32_t cnt)
assert(le.get());
nuraft::ptr<nuraft::buffer> buf = le->serialize();
size_total += buf->size();
logs.push_back(buf);
logs.push_back(std::move(buf));
}

nuraft::ptr<nuraft::buffer> buf_out = nuraft::buffer::alloc(sizeof(int32_t) + cnt * sizeof(int32_t) + size_total);
Expand Down Expand Up @@ -236,7 +236,7 @@ STEKShareLogStore::apply_pack(uint64_t index, nuraft::buffer &pack)
nuraft::ptr<nuraft::log_entry> le = nuraft::log_entry::deserialize(*buf_local);
{
std::lock_guard<std::mutex> l(logs_lock_);
logs_[cur_idx] = le;
logs_[cur_idx] = std::move(le);
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/stek_share/state_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class STEKShareSM : public nuraft::state_machine

{
std::lock_guard<std::mutex> l(snapshot_lock_);
snapshot_ = ctx;
snapshot_ = std::move(ctx);
}

nuraft::ptr<std::exception> except(nullptr);
Expand Down
4 changes: 3 additions & 1 deletion plugins/experimental/stek_share/state_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ limitations under the License.

#pragma once

#include <utility>

#include <libnuraft/nuraft.hxx>

#include "log_store.h"
Expand All @@ -37,7 +39,7 @@ class STEKShareSMGR : public nuraft::state_mgr
int server_id = s.first;
std::string endpoint = s.second;
nuraft::ptr<nuraft::srv_config> new_server = nuraft::cs_new<nuraft::srv_config>(server_id, endpoint);
saved_config_->get_servers().push_back(new_server);
saved_config_->get_servers().push_back(std::move(new_server));
}
}

Expand Down
6 changes: 3 additions & 3 deletions plugins/experimental/stek_share/stek_share.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ message_handler(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
TSError("[%s] Raft initialization failed with new config, retrying with old config.", PLUGIN_NAME);
auto config_old = get_scoped_config(true);
restore_config(config_old);
if (init_raft(nuraft::cs_new<STEKShareSM>(), config_old) == 0) {
if (init_raft(nuraft::cs_new<STEKShareSM>(), std::move(config_old)) == 0) {
Dbg(dbg_ctl, "Server ID: %d, Endpoint: %s", config->server_id, config->endpoint.c_str());
} else {
TSEmergency("[%s] Raft initialization failed with old config.", PLUGIN_NAME);
Expand Down Expand Up @@ -168,7 +168,7 @@ init_raft(nuraft::ptr<nuraft::state_machine> sm_instance, std::shared_ptr<Plugin
// State machine.
{
std::unique_lock lock(stek_share_server.sm_mutex);
stek_share_server.sm_instance = sm_instance;
stek_share_server.sm_instance = std::move(sm_instance);
}

// ASIO options.
Expand Down Expand Up @@ -349,7 +349,7 @@ load_config_from_file()
}

std::unique_lock lock(plugin_config_mutex);
plugin_config = new_config;
plugin_config = std::move(new_config);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/header_rewrite/operators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,8 @@ OperatorRunPlugin::initialize(Parser &p)
{
Operator::initialize(p);

auto plugin_name = p.get_arg();
auto plugin_args = p.get_value();
const auto &plugin_name = p.get_arg();
const auto &plugin_args = p.get_value();

if (plugin_name.empty()) {
throw std::runtime_error("run-plugin missing plugin name");
Expand Down
2 changes: 1 addition & 1 deletion plugins/origin_server_auth/origin_server_auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ loadRegionMap(StringMap &m, const String &filename)
Dbg(dbg_ctl, "added entry-point:%s, region:%s", entrypoint.c_str(), region.c_str());
}

m[entrypoint] = region;
m[entrypoint] = std::move(region);
}

if (m.at("").empty()) {
Expand Down
3 changes: 2 additions & 1 deletion plugins/traffic_dump/session_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unordered_map>
#include <utility>

#include <tscore/ink_inet.h>

Expand Down Expand Up @@ -552,7 +553,7 @@ SessionData::global_session_handler(TSCont /* contp ATS_UNUSED */, TSEvent event
TSHttpSsnReenable(ssnp, TS_EVENT_HTTP_CONTINUE);
return TS_EVENT_HTTP_CONTINUE;
}
ssnData->log_name = log_f;
ssnData->log_name = std::move(log_f);
// Write log file beginning to disk
ssnData->write_to_disk(beginning);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/traffic_dump/transaction_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ TransactionData::write_client_request_node_no_content(TSMBuffer &buffer, TSMLoc
std::ostringstream client_request_node;
client_request_node << R"(,"client-request":{)";

auto const http_version = _http_version_from_client_stack;
auto const &http_version = _http_version_from_client_stack;
if (http_version == "2") {
client_request_node << R"("http2":{)";

Expand Down
4 changes: 2 additions & 2 deletions src/api/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8335,7 +8335,7 @@ TSSslServerCertUpdate(const char *cert_path, const char *key_path)
return TS_ERROR;
}
// Atomic Swap
cc->setCtx(test_ctx);
cc->setCtx(std::move(test_ctx));
return TS_SUCCESS;
}
}
Expand Down Expand Up @@ -8935,7 +8935,7 @@ TSRPCHandlerDone(TSYaml resp)
{
Dbg(dbg_ctl_rpc_api, ">> Handler seems to be done");
std::lock_guard<std::mutex> lock(::rpc::g_rpcHandlingMutex);
auto data = *reinterpret_cast<YAML::Node *>(resp);
auto const &data = *reinterpret_cast<YAML::Node const *>(resp);
::rpc::g_rpcHandlerResponseData = data;
::rpc::g_rpcHandlerProcessingCompleted = true;
::rpc::g_rpcHandlingCompletion.notify_one();
Expand Down
8 changes: 4 additions & 4 deletions src/config/ssl_multicert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,16 @@ SSLMultiCertParser::parse_yaml(std::string_view content)
try {
YAML::Node config = YAML::Load(std::string(content));
if (config.IsNull()) {
return {result, std::move(errata)};
return {std::move(result), std::move(errata)};
}

if (!config[KEY_SSL_MULTICERT]) {
return {result, swoc::Errata("expected a toplevel 'ssl_multicert' node")};
return {std::move(result), swoc::Errata("expected a toplevel 'ssl_multicert' node")};
}

YAML::Node entries = config[KEY_SSL_MULTICERT];
if (!entries.IsSequence()) {
return {result, swoc::Errata("expected 'ssl_multicert' to be a sequence")};
return {std::move(result), swoc::Errata("expected 'ssl_multicert' to be a sequence")};
}

for (auto const &entry_node : entries) {
Expand All @@ -279,7 +279,7 @@ SSLMultiCertParser::parse_yaml(std::string_view content)
result.push_back(entry_node.as<SSLMultiCertEntry>());
}
} catch (std::exception const &ex) {
return {result, swoc::Errata("YAML parse error: {}", ex.what())};
return {std::move(result), swoc::Errata("YAML parse error: {}", ex.what())};
}

return {std::move(result), std::move(errata)};
Expand Down
2 changes: 1 addition & 1 deletion src/iocore/net/SSLCertLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ SSLCertLookup::getPolicies(const std::string &secret_name, std::set<shared_SSLMu
{
auto iter = cert_secret_registry.find(secret_name);
if (iter != cert_secret_registry.end()) {
for (auto name : iter->second) {
for (auto const &name : iter->second) {
SSLCertContext *cc = this->find(name);
if (cc) {
policies.insert(cc->userconfig);
Expand Down
3 changes: 2 additions & 1 deletion src/iocore/net/SSLNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <netinet/in.h>
#include <string>
#include <cstring>
#include <utility>

#if TS_USE_TLS_ASYNC
#include <openssl/async.h>
Expand Down Expand Up @@ -2398,7 +2399,7 @@ SSLNetVConnection::_ssl_connect()

if (shared_sess && SSL_set_session(ssl, shared_sess.get())) {
// Keep a reference of this shared pointer in the connection
this->client_sess = shared_sess;
this->client_sess = std::move(shared_sess);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/iocore/net/SSLUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ SSLMultiCertConfigLoader::load_certs_and_cross_reference_names(

for (const char *keyname = key_tok.getNext(); keyname; keyname = key_tok.getNext()) {
std::string completeServerKeyPath = Layout::get()->relative_to(params->serverKeyPathOnly, keyname);
data.key_list.push_back(completeServerKeyPath);
data.key_list.push_back(std::move(completeServerKeyPath));
}

for (const char *caname = ca_tok.getNext(); caname; caname = ca_tok.getNext()) {
Expand All @@ -2136,7 +2136,7 @@ SSLMultiCertConfigLoader::load_certs_and_cross_reference_names(
int cert_index = 0;
for (const char *certname = cert_tok.getNext(); certname; certname = cert_tok.getNext()) {
std::string completeServerCertPath = Layout::relative_to(params->serverCertPathOnly, certname);
data.cert_names_list.push_back(completeServerCertPath);
data.cert_names_list.push_back(std::move(completeServerCertPath));
}

for (size_t i = 0; i < data.cert_names_list.size(); i++) {
Expand Down Expand Up @@ -2231,7 +2231,7 @@ SSLMultiCertConfigLoader::load_certs_and_cross_reference_names(

if (first_pass) {
first_pass = false;
common_names = name_set;
common_names = std::move(name_set);
} else {
// Check that all elements in common_names are in name_set
auto common_iter = common_names.begin();
Expand Down
6 changes: 3 additions & 3 deletions src/iocore/net/UnixNetAccept.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ net_accept(NetAccept *na, void *ep, bool blockable)
if (!vc) {
goto Ldone; // note: @a con will clean up the socket when it goes out of scope.
}
vc->enable_inbound_connection_tracking(conn_track_group);
vc->enable_inbound_connection_tracking(std::move(conn_track_group));

count++;
Metrics::Gauge::increment(net_rsb.connections_currently_open);
Expand Down Expand Up @@ -420,7 +420,7 @@ NetAccept::do_blocking_accept(EThread *t)
if (unlikely(!vc)) {
return -1;
}
vc->enable_inbound_connection_tracking(conn_track_group);
vc->enable_inbound_connection_tracking(std::move(conn_track_group));

count++;
Metrics::Gauge::increment(net_rsb.connections_currently_open);
Expand Down Expand Up @@ -588,7 +588,7 @@ NetAccept::acceptFastEvent(int event, void *ep)

vc = static_cast<UnixNetVConnection *>(this->getNetProcessor()->allocate_vc(e->ethread));
ink_release_assert(vc);
vc->enable_inbound_connection_tracking(conn_track_group);
vc->enable_inbound_connection_tracking(std::move(conn_track_group));

count++;
Metrics::Gauge::increment(net_rsb.connections_currently_open);
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/HostStatus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ HostStatus::getAllHostStatuses(std::vector<HostStatuses> &hosts)
h.hostname = hsts.first;
ss << *hsts.second;
h.status = ss.str();
hosts.push_back(h);
hosts.push_back(std::move(h));
}
}
}
Expand Down
Loading