From 7538e43e49fabc542c88f16c2a3765961fea71a6 Mon Sep 17 00:00:00 2001 From: Randall Meyer Date: Mon, 27 Jul 2020 10:51:43 -0700 Subject: [PATCH] Fixes spelling/license formatting in traffic_dump plugin --- .../traffic_dump/global_variables.h | 7 ++++++- .../experimental/traffic_dump/json_utils.cc | 7 ++++++- .../experimental/traffic_dump/json_utils.h | 7 ++++++- .../traffic_dump/sensitive_fields.h | 9 ++++++-- .../experimental/traffic_dump/session_data.cc | 11 +++++++--- .../experimental/traffic_dump/session_data.h | 9 ++++++-- .../experimental/traffic_dump/traffic_dump.cc | 7 ++++++- .../traffic_dump/transaction_data.cc | 21 ++++++++++++------- .../traffic_dump/transaction_data.h | 9 ++++++-- 9 files changed, 66 insertions(+), 21 deletions(-) diff --git a/plugins/experimental/traffic_dump/global_variables.h b/plugins/experimental/traffic_dump/global_variables.h index 18a9555926f..7d465088ca7 100644 --- a/plugins/experimental/traffic_dump/global_variables.h +++ b/plugins/experimental/traffic_dump/global_variables.h @@ -1,6 +1,9 @@ -/** @sensitive_fields.h +/** @file + The set of fields considered user-sensitive. + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -8,7 +11,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/plugins/experimental/traffic_dump/json_utils.cc b/plugins/experimental/traffic_dump/json_utils.cc index eb2ff37796b..3b5fbbdc690 100644 --- a/plugins/experimental/traffic_dump/json_utils.cc +++ b/plugins/experimental/traffic_dump/json_utils.cc @@ -1,6 +1,9 @@ -/** @json_utils.cc +/** @file + Implementation of JSON formatting functions. + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -8,7 +11,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/plugins/experimental/traffic_dump/json_utils.h b/plugins/experimental/traffic_dump/json_utils.h index 7d26012e96c..e91829cb45a 100644 --- a/plugins/experimental/traffic_dump/json_utils.h +++ b/plugins/experimental/traffic_dump/json_utils.h @@ -1,6 +1,9 @@ -/** @json_utils.h +/** @file + JSON formatting functions. + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -8,7 +11,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/plugins/experimental/traffic_dump/sensitive_fields.h b/plugins/experimental/traffic_dump/sensitive_fields.h index 8e0db2d0002..f69d9c7fd0a 100644 --- a/plugins/experimental/traffic_dump/sensitive_fields.h +++ b/plugins/experimental/traffic_dump/sensitive_fields.h @@ -1,6 +1,9 @@ -/** @sensitive_fields.h +/** @file + Define the type used to store user-sensitive HTTP fields (such as cookies). + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -8,7 +11,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,7 +31,7 @@ namespace traffic_dump { -// A case-insensitive comparitor used for comparing HTTP field names. +// A case-insensitive comparator used for comparing HTTP field names. struct InsensitiveCompare { bool operator()(std::string_view a, std::string_view b) const diff --git a/plugins/experimental/traffic_dump/session_data.cc b/plugins/experimental/traffic_dump/session_data.cc index 281b78df818..e496c59981c 100644 --- a/plugins/experimental/traffic_dump/session_data.cc +++ b/plugins/experimental/traffic_dump/session_data.cc @@ -1,14 +1,19 @@ -/** @session_handler.h +/** @file + Traffic Dump session handling implementation + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file + regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -287,7 +292,7 @@ SessionData::~SessionData() /* * Note this assumes that the caller holds the disk_io_mutex lock. This is a - * private member function. The two publically accessible functions hold the + * private member function. The two publicly accessible functions hold the * lock before calling this. */ int diff --git a/plugins/experimental/traffic_dump/session_data.h b/plugins/experimental/traffic_dump/session_data.h index 31bc9d3bdd5..b25a42f57bb 100644 --- a/plugins/experimental/traffic_dump/session_data.h +++ b/plugins/experimental/traffic_dump/session_data.h @@ -1,14 +1,19 @@ -/** @session_handler.h +/** @file + Traffic Dump session handling encapsulation. + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file + regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/plugins/experimental/traffic_dump/traffic_dump.cc b/plugins/experimental/traffic_dump/traffic_dump.cc index 271b3b8c58f..38ae1f17ba5 100644 --- a/plugins/experimental/traffic_dump/traffic_dump.cc +++ b/plugins/experimental/traffic_dump/traffic_dump.cc @@ -1,8 +1,11 @@ -/** @traffic_dump.cc +/** @file + Plugin Traffic Dump captures traffic on a per session basis. A sampling ratio can be set via plugin.config or traffic_ctl to dump one out of n sessions. The dump file schema can be found https://github.com/apache/trafficserver/tree/master/tests/tools/lib/replay_schema.json + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -10,7 +13,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/plugins/experimental/traffic_dump/transaction_data.cc b/plugins/experimental/traffic_dump/transaction_data.cc index 5e952294306..20c5f126512 100644 --- a/plugins/experimental/traffic_dump/transaction_data.cc +++ b/plugins/experimental/traffic_dump/transaction_data.cc @@ -1,6 +1,9 @@ -/** @txn_data.cc +/** @file + Implementation of Traffic Dump transaction data. + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -8,7 +11,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,7 +31,7 @@ namespace traffic_dump int TransactionData::transaction_arg_index = 0; sensitive_fields_t TransactionData::sensitive_fields; -std::string defaut_sensitive_field_value; +std::string default_sensitive_field_value; /// Fields considered sensitive because they may contain user-private /// information. These fields are replaced with auto-generated generic content by @@ -45,9 +50,9 @@ TransactionData::initialize_default_sensitive_field() // 128 KB is the maximum size supported for all headers, so this size should // be plenty large for our needs. constexpr size_t default_field_size = 128 * 1024; - defaut_sensitive_field_value.resize(default_field_size); + default_sensitive_field_value.resize(default_field_size); - char *field_buffer = defaut_sensitive_field_value.data(); + char *field_buffer = default_sensitive_field_value.data(); for (auto i = 0u; i < default_field_size; i += 8) { sprintf(field_buffer, "%07x ", i / 8); field_buffer += 8; @@ -95,13 +100,13 @@ TransactionData::replace_sensitive_fields(std::string_view name, std::string_vie return original_value; } auto new_value_size = original_value.size(); - if (original_value.size() > defaut_sensitive_field_value.size()) { - new_value_size = defaut_sensitive_field_value.size(); + if (original_value.size() > default_sensitive_field_value.size()) { + new_value_size = default_sensitive_field_value.size(); TSError("[%s] Encountered a sensitive field value larger than our default " "field size. Default size: %zu, incoming field size: %zu", - debug_tag, defaut_sensitive_field_value.size(), original_value.size()); + debug_tag, default_sensitive_field_value.size(), original_value.size()); } - return std::string_view{defaut_sensitive_field_value.data(), new_value_size}; + return std::string_view{default_sensitive_field_value.data(), new_value_size}; } std::string diff --git a/plugins/experimental/traffic_dump/transaction_data.h b/plugins/experimental/traffic_dump/transaction_data.h index 3541d7a275a..b3a13561ae7 100644 --- a/plugins/experimental/traffic_dump/transaction_data.h +++ b/plugins/experimental/traffic_dump/transaction_data.h @@ -1,6 +1,9 @@ -/** @txn_data.h +/** @file + Traffic Dump data specific to transactions. + @section license License + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -8,7 +11,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -37,7 +42,7 @@ class TransactionData /** The string for the JSON content of this transaction. */ std::string txn_json; - /** The '"protocol" node for this transaction's server-side conection. */ + /** The '"protocol" node for this transaction's server-side connection. */ std::string server_protocol_description; // The index to be used for the TS API for storing this TransactionData on a