mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 04:57:52 +00:00
[#3256] fix common warnings across compilers
``` io_service_thread_pool_unittests.cc:24:12: warning: unused variable 'TEST_TIMEOUT' [-Wunused-const-variable] mysql_connection_unittest.cc:217:75: warning: declaration of ‘out_bindings’ shadows a previous local [-Wshadow] mysql_host_data_source.cc:171:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:202:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:220:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:254:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:422:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:554:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:579:30: warning: useless cast to type ‘isc::dhcp::SubnetID’ {aka ‘unsigned int’} [-Wuseless-cast] mysql_host_data_source.cc:586:30: warning: useless cast to type ‘isc::dhcp::SubnetID’ {aka ‘unsigned int’} [-Wuseless-cast] mysql_host_data_source.cc:674:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:714:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:1313:18: warning: 'processFetchedData' overrides a member function but is not marked 'override' [-Wsuggest-override] mysql_host_data_source.cc:1353:37: warning: 'createBindForReceive' overrides a member function but is not marked 'override' [-Wsuggest-override] mysql_host_data_source.cc:1371:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:1456:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:1487:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:1508:18: warning: 'processFetchedData' overrides a member function but is not marked 'override' [-Wsuggest-override] mysql_host_data_source.cc:1542:37: warning: 'createBindForReceive' overrides a member function but is not marked 'override' [-Wsuggest-override] mysql_host_data_source.cc:1583:6: warning: extra ';' after member function definition [-Wextra-semi] mysql_host_data_source.cc:1803:25: warning: unused variable 'OPTION_ID_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1804:25: warning: unused variable 'CODE_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1805:25: warning: unused variable 'VALUE_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1806:25: warning: unused variable 'FORMATTED_VALUE_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1807:25: warning: unused variable 'SPACE_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1808:25: warning: unused variable 'PERSISTENT_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1809:25: warning: unused variable 'CANCELLED_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1810:25: warning: unused variable 'USER_CONTEXT_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1811:25: warning: unused variable 'DHCP_SUBNET_ID_COL' [-Wunused-const-variable] mysql_host_data_source.cc:1812:25: warning: unused variable 'HOST_ID_COL' [-Wunused-const-variable] mysql_host_data_source.cc:3222:24: warning: useless cast to type ‘char*’ [-Wuseless-cast] mysql_host_data_source.cc:3385:24: warning: useless cast to type ‘char*’ [-Wuseless-cast] mysql_host_data_source.cc:3426:24: warning: useless cast to type ‘char*’ [-Wuseless-cast] mysql_lease_mgr.cc:89:14: warning: unused variable 'HOSTNAME_MAX_LEN' [-Wunused-const-variable] mysql_lease_mgr.cc:95:14: warning: unused variable 'ADDRESS6_TEXT_MAX_LEN' [-Wunused-const-variable] mysql_lease_mgr.cc:98:14: warning: unused variable 'USER_CONTEXT_MAX_LEN' [-Wunused-const-variable] mysql_lease_mgr.cc:544:29: warning: useless cast to type ‘isc::db::my_bool*’ {aka ‘bool*’} [-Wuseless-cast] mysql_lease_mgr.cc:1929:10: warning: 'start' overrides a member function but is not marked 'override' [-Wsuggest-override] mysql_lease_mgr.cc:2010:30: warning: useless cast to type ‘isc::dhcp::SubnetID’ {aka ‘unsigned int’} [-Wuseless-cast] mysql_lease_mgr.cc:2020:10: warning: 'getNextRow' overrides a member function but is not marked 'override' [-Wsuggest-override] mysql_lease_mgr.cc:3427:13: warning: useless cast to type ‘uint64_t’ {aka ‘long unsigned int’} [-Wuseless-cast] mysql_lease_mgr.cc:4114:23: warning: variable length arrays are a C99 feature [-Wvla-extension] mysql_lease_mgr.cc:4226:23: warning: variable length arrays are a C99 feature [-Wvla-extension] option_opaque_data_tuples_unittest.cc:533:32: warning: zero size arrays are an extension [-Wzero-length-array] option_opaque_data_tuples_unittest.cc:552:32: warning: zero size arrays are an extension [-Wzero-length-array] option_opaque_data_tuples_unittest.cc:572:32: warning: zero size arrays are an extension [-Wzero-length-array] tcp_connection.cc:28:14: warning: unused variable 'MAX_LOGGED_MESSAGE_SIZE' [-Wunused-const-variable] test_control.cc:1826:23: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast] test_control.cc:1830:24: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast] test_control.cc:1871:34: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast] test_control.cc:1873:30: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast] ../../../src/lib/http/http_message_parser_base.h:26:45: warning: extra ‘;’ after in-class function definition [-Wextra-semi] ../../../src/lib/http/http_message_parser_base.h:174:18: warning: ‘virtual void isc::http::HttpMessageParserBase::defineEvents()’ can be marked override [-Wsuggest-override] ../../../src/lib/http/http_message_parser_base.h:177:18: warning: ‘virtual void isc::http::HttpMessageParserBase::verifyEvents()’ can be marked override [-Wsuggest-override] ../../../src/lib/http/http_message_parser_base.h:180:18: warning: ‘virtual void isc::http::HttpMessageParserBase::defineStates()’ can be marked override [-Wsuggest-override] ../../../src/lib/http/http_message_parser_base.h:233:18: warning: ‘virtual void isc::http::HttpMessageParserBase::onModelFailure(const string&)’ can be marked override [-Wsuggest-override] ```
This commit is contained in:
parent
bceff40010
commit
3e4deddd5f
@ -1823,11 +1823,11 @@ TestControl::setDefaults4(const Pkt4Ptr& pkt) {
|
||||
// The remote server's name or IP.
|
||||
pkt->setRemoteAddr(IOAddress(options_.getServerName()));
|
||||
// Set local address.
|
||||
pkt->setLocalAddr(IOAddress(socket_.addr_));
|
||||
pkt->setLocalAddr(socket_.addr_);
|
||||
// Set relay (GIADDR) address to local address if multiple
|
||||
// subnet mode is not enabled
|
||||
if (!options_.checkMultiSubnet()) {
|
||||
pkt->setGiaddr(IOAddress(socket_.addr_));
|
||||
pkt->setGiaddr(socket_.addr_);
|
||||
} else {
|
||||
pkt->setGiaddr(IOAddress(options_.getRandRelayAddr()));
|
||||
}
|
||||
@ -1868,9 +1868,9 @@ TestControl::setDefaults6(const Pkt6Ptr& pkt) {
|
||||
if (options_.checkMultiSubnet()) {
|
||||
relay_info.linkaddr_ = IOAddress(options_.getRandRelayAddr());
|
||||
} else {
|
||||
relay_info.linkaddr_ = IOAddress(socket_.addr_);
|
||||
relay_info.linkaddr_ = socket_.addr_;
|
||||
}
|
||||
relay_info.peeraddr_ = IOAddress(socket_.addr_);
|
||||
relay_info.peeraddr_ = socket_.addr_;
|
||||
relay_info.options_.insert(options_.getRelayOpts().begin(), options_.getRelayOpts().end());
|
||||
pkt->addRelayInfo(relay_info);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2021-2022 Internet Systems Consortium, Inc. ("ISC")
|
||||
// Copyright (C) 2021-2024 Internet Systems Consortium, Inc. ("ISC")
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@ -20,9 +20,6 @@ using namespace isc::asiolink;
|
||||
|
||||
namespace {
|
||||
|
||||
/// @brief Test timeout (ms).
|
||||
const long TEST_TIMEOUT = 10000;
|
||||
|
||||
/// @brief Simple test fixture for testing IoServiceThreadPool.
|
||||
class IoServiceThreadPoolTest : public ::testing::Test {
|
||||
public:
|
||||
|
@ -530,9 +530,9 @@ TEST(OptionOpaqueDataTuples, unpack6Truncated) {
|
||||
// data is parsed correctly.
|
||||
TEST(OptionOpaqueDataTuples, unpack4NoTuple) {
|
||||
// Prepare data to decode.
|
||||
const uint8_t buf_data[] = {
|
||||
};
|
||||
OptionBuffer buf(buf_data, buf_data + sizeof(buf_data));
|
||||
std::vector<uint8_t> buf_vector;
|
||||
const uint8_t* buf_data = buf_vector.data();
|
||||
OptionBuffer buf(buf_data, buf_data + buf_vector.size());
|
||||
|
||||
OptionOpaqueDataTuplesPtr data_tuple;
|
||||
ASSERT_NO_THROW(
|
||||
@ -549,9 +549,9 @@ TEST(OptionOpaqueDataTuples, unpack4NoTuple) {
|
||||
// data is parsed correctly when tuple's length field is coded on 2 octets.
|
||||
TEST(OptionOpaqueDataTuples, unpack4NoTuple_with_ltf) {
|
||||
// Prepare data to decode.
|
||||
const uint8_t buf_data[] = {
|
||||
};
|
||||
OptionBuffer buf(buf_data, buf_data + sizeof(buf_data));
|
||||
std::vector<uint8_t> buf_vector;
|
||||
const uint8_t* buf_data = buf_vector.data();
|
||||
OptionBuffer buf(buf_data, buf_data + buf_vector.size());
|
||||
|
||||
OptionOpaqueDataTuplesPtr data_tuple;
|
||||
ASSERT_NO_THROW(
|
||||
@ -569,9 +569,9 @@ TEST(OptionOpaqueDataTuples, unpack4NoTuple_with_ltf) {
|
||||
// data is parsed correctly.
|
||||
TEST(OptionOpaqueDataTuples, unpack6NoTuple) {
|
||||
// Prepare data to decode.
|
||||
const uint8_t buf_data[] = {
|
||||
};
|
||||
OptionBuffer buf(buf_data, buf_data + sizeof(buf_data));
|
||||
std::vector<uint8_t> buf_vector;
|
||||
const uint8_t* buf_data = buf_vector.data();
|
||||
OptionBuffer buf(buf_data, buf_data + buf_vector.size());
|
||||
|
||||
OptionOpaqueDataTuplesPtr data_tuple;
|
||||
ASSERT_NO_THROW(
|
||||
|
@ -168,7 +168,7 @@ public:
|
||||
columns_[AUTH_KEY_COL] = "auth_key";
|
||||
|
||||
BOOST_STATIC_ASSERT(13 < HOST_COLUMNS);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Virtual destructor.
|
||||
virtual ~MySqlHostExchange() {
|
||||
@ -199,7 +199,7 @@ public:
|
||||
/// This method is used by derived classes.
|
||||
uint64_t getHostId() const {
|
||||
return (host_id_);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Set error indicators
|
||||
///
|
||||
@ -217,7 +217,7 @@ public:
|
||||
error[i] = MLM_FALSE;
|
||||
bind[i].error = reinterpret_cast<my_bool*>(&error[i]);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Return columns in error
|
||||
///
|
||||
@ -251,7 +251,7 @@ public:
|
||||
}
|
||||
|
||||
return (result);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Create MYSQL_BIND objects for Host Pointer
|
||||
///
|
||||
@ -419,7 +419,7 @@ public:
|
||||
vec.push_back(bind_[3]); // subnet_id
|
||||
}
|
||||
return (vec);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Create BIND array to receive Host data.
|
||||
///
|
||||
@ -551,7 +551,7 @@ public:
|
||||
// Add the data to the vector. Note the end element is one after the
|
||||
// end of the array.
|
||||
return (bind_);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Copy received data into Host object
|
||||
///
|
||||
@ -576,14 +576,14 @@ public:
|
||||
// set to 0.
|
||||
SubnetID ipv4_subnet_id(SUBNET_ID_UNUSED);
|
||||
if (dhcp4_subnet_id_null_ == MLM_FALSE) {
|
||||
ipv4_subnet_id = static_cast<SubnetID>(dhcp4_subnet_id_);
|
||||
ipv4_subnet_id = dhcp4_subnet_id_;
|
||||
}
|
||||
|
||||
// Set DHCPv6 subnet ID to the value returned. If NULL returned,
|
||||
// set to 0.
|
||||
SubnetID ipv6_subnet_id(SUBNET_ID_UNUSED);
|
||||
if (dhcp6_subnet_id_null_ == MLM_FALSE) {
|
||||
ipv6_subnet_id = static_cast<SubnetID>(dhcp6_subnet_id_);
|
||||
ipv6_subnet_id = dhcp6_subnet_id_;
|
||||
}
|
||||
|
||||
// Set IPv4 address reservation if it was given, if not, set IPv4 zero
|
||||
@ -671,7 +671,7 @@ public:
|
||||
}
|
||||
|
||||
return (h);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Processes one row of data fetched from a database.
|
||||
///
|
||||
@ -711,7 +711,7 @@ public:
|
||||
/// "(None)".
|
||||
std::string getErrorColumns() {
|
||||
return (getColumnsInError(error_, columns_));
|
||||
};
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@ -1310,7 +1310,7 @@ public:
|
||||
/// detects duplicated information and discards such entries.
|
||||
///
|
||||
/// @param [out] hosts Container holding parsed hosts and options.
|
||||
virtual void processFetchedData(ConstHostCollection& hosts) {
|
||||
virtual void processFetchedData(ConstHostCollection& hosts) override {
|
||||
// Holds pointer to the previously parsed host.
|
||||
HostPtr most_recent_host;
|
||||
if (!hosts.empty()) {
|
||||
@ -1350,7 +1350,7 @@ public:
|
||||
/// @brief Bind variables for receiving option data.
|
||||
///
|
||||
/// @return Vector of MYSQL_BIND object representing data to be retrieved.
|
||||
virtual std::vector<MYSQL_BIND> createBindForReceive() {
|
||||
virtual std::vector<MYSQL_BIND> createBindForReceive() override {
|
||||
// The following call sets bind_ values between 0 and 8.
|
||||
static_cast<void>(MySqlHostExchange::createBindForReceive());
|
||||
|
||||
@ -1368,7 +1368,7 @@ public:
|
||||
setErrorIndicators(bind_, error_);
|
||||
|
||||
return (bind_);
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@ -1453,7 +1453,7 @@ public:
|
||||
return (reservation_id_);
|
||||
}
|
||||
return (0);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Creates IPv6 reservation from the data contained in the
|
||||
/// currently processed row.
|
||||
@ -1484,7 +1484,7 @@ public:
|
||||
IOAddress addr6 = IOAddress::fromBytes(AF_INET6, ipv6_address_buffer_);
|
||||
IPv6Resrv r(type, addr6, prefix_len_);
|
||||
return (r);
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Processes one row of data fetched from a database.
|
||||
///
|
||||
@ -1505,7 +1505,7 @@ public:
|
||||
///
|
||||
/// @param [out] hosts Collection of hosts to which a new host created
|
||||
/// from the processed data should be inserted.
|
||||
virtual void processFetchedData(ConstHostCollection& hosts) {
|
||||
virtual void processFetchedData(ConstHostCollection& hosts) override {
|
||||
|
||||
// Call parent class to fetch host information and options.
|
||||
MySqlHostWithOptionsExchange::processFetchedData(hosts);
|
||||
@ -1539,7 +1539,7 @@ public:
|
||||
/// objects with associated IPv6 reservations.
|
||||
///
|
||||
/// @return Vector of MYSQL_BIND objects representing data to be retrieved.
|
||||
virtual std::vector<MYSQL_BIND> createBindForReceive() {
|
||||
virtual std::vector<MYSQL_BIND> createBindForReceive() override {
|
||||
// Reset most recent reservation id value because we're now making
|
||||
// a new SELECT query.
|
||||
most_recent_reservation_id_ = 0;
|
||||
@ -1580,7 +1580,7 @@ public:
|
||||
setErrorIndicators(bind_, error_);
|
||||
|
||||
return (bind_);
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@ -1798,18 +1798,6 @@ private:
|
||||
///
|
||||
/// This class supports inserting both DHCPv4 and DHCPv6 options.
|
||||
class MySqlOptionExchange {
|
||||
private:
|
||||
|
||||
static const size_t OPTION_ID_COL = 0;
|
||||
static const size_t CODE_COL = 1;
|
||||
static const size_t VALUE_COL = 2;
|
||||
static const size_t FORMATTED_VALUE_COL = 3;
|
||||
static const size_t SPACE_COL = 4;
|
||||
static const size_t PERSISTENT_COL = 5;
|
||||
static const size_t CANCELLED_COL = 6;
|
||||
static const size_t USER_CONTEXT_COL = 7;
|
||||
static const size_t DHCP_SUBNET_ID_COL = 8;
|
||||
static const size_t HOST_ID_COL = 9;
|
||||
/// @brief Number of columns in the option tables holding bindable values.
|
||||
static const size_t OPTION_COLUMNS = 10;
|
||||
|
||||
@ -3231,7 +3219,7 @@ MySqlHostDataSourceImpl::getHost(MySqlHostContextPtr& ctx,
|
||||
// Identifier type.
|
||||
char identifier_type_copy = static_cast<char>(identifier_type);
|
||||
inbind[1].buffer_type = MYSQL_TYPE_TINY;
|
||||
inbind[1].buffer = reinterpret_cast<char*>(&identifier_type_copy);
|
||||
inbind[1].buffer = &identifier_type_copy;
|
||||
inbind[1].is_unsigned = MLM_TRUE;
|
||||
|
||||
ConstHostCollection collection;
|
||||
@ -3394,7 +3382,7 @@ MySqlHostDataSource::del4(const SubnetID& subnet_id,
|
||||
// identifier type
|
||||
char identifier_type_copy = static_cast<char>(identifier_type);
|
||||
inbind[1].buffer_type = MYSQL_TYPE_TINY;
|
||||
inbind[1].buffer = reinterpret_cast<char*>(&identifier_type_copy);
|
||||
inbind[1].buffer = &identifier_type_copy;
|
||||
inbind[1].is_unsigned = MLM_TRUE;
|
||||
|
||||
// identifier value
|
||||
@ -3435,7 +3423,7 @@ MySqlHostDataSource::del6(const SubnetID& subnet_id,
|
||||
// identifier type
|
||||
char identifier_type_copy = static_cast<char>(identifier_type);
|
||||
inbind[1].buffer_type = MYSQL_TYPE_TINY;
|
||||
inbind[1].buffer = reinterpret_cast<char*>(&identifier_type_copy);
|
||||
inbind[1].buffer = &identifier_type_copy;
|
||||
inbind[1].is_unsigned = MLM_TRUE;
|
||||
|
||||
// identifier value
|
||||
|
@ -23,12 +23,13 @@
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <mysqld_error.h>
|
||||
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <time.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace isc;
|
||||
using namespace isc::asiolink;
|
||||
@ -82,21 +83,6 @@ using namespace std;
|
||||
|
||||
namespace {
|
||||
|
||||
/// @brief Maximum length of the hostname stored in DNS.
|
||||
///
|
||||
/// This length is restricted by the length of the domain-name carried
|
||||
/// in the Client FQDN %Option (see RFC4702 and RFC4704).
|
||||
const size_t HOSTNAME_MAX_LEN = 255;
|
||||
|
||||
/// @brief Maximum size of an IPv6 address represented as a text string.
|
||||
///
|
||||
/// This is 32 hexadecimal characters written in 8 groups of four, plus seven
|
||||
/// colon separators.
|
||||
const size_t ADDRESS6_TEXT_MAX_LEN = 39;
|
||||
|
||||
/// @brief Maximum length of user context.
|
||||
const size_t USER_CONTEXT_MAX_LEN = 8192;
|
||||
|
||||
/// @brief Maximum length of the text returned by the limit checking functions.
|
||||
const size_t LIMITS_TEXT_MAX_LEN = 512;
|
||||
|
||||
@ -555,7 +541,7 @@ public:
|
||||
size_t count) {
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
error[i] = MLM_FALSE;
|
||||
bind[i].error = reinterpret_cast<my_bool*>(&error[i]);
|
||||
bind[i].error = &error[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1926,7 +1912,7 @@ public:
|
||||
/// type (v6 only) per subnet id. This method binds the statement to
|
||||
/// the output bind array and then executes the statement, and fetches
|
||||
/// entire result set.
|
||||
void start() {
|
||||
void start() override {
|
||||
// Set up where clause inputs if needed.
|
||||
if (getSelectMode() != ALL_SUBNETS && getSelectMode() != ALL_SUBNET_POOLS) {
|
||||
MYSQL_BIND inbind[2];
|
||||
@ -2017,11 +2003,11 @@ public:
|
||||
///
|
||||
/// @return True if the fetch succeeded, false if there are no more
|
||||
/// rows to fetch.
|
||||
bool getNextRow(LeaseStatsRow& row) {
|
||||
bool getNextRow(LeaseStatsRow& row) override {
|
||||
bool have_row = false;
|
||||
int status = mysql_stmt_fetch(statement_);
|
||||
if (status == MLM_MYSQL_FETCH_SUCCESS) {
|
||||
row.subnet_id_ = static_cast<SubnetID>(subnet_id_);
|
||||
row.subnet_id_ = subnet_id_;
|
||||
row.pool_id_ = pool_id_;
|
||||
row.lease_type_ = static_cast<Lease::Type>(lease_type_);
|
||||
row.lease_state_ = state_;
|
||||
@ -3438,7 +3424,7 @@ MySqlLeaseMgr::deleteLeaseCommon(MySqlLeaseContextPtr& ctx,
|
||||
|
||||
// See how many rows were affected. Note that the statement may delete
|
||||
// multiple rows.
|
||||
return (static_cast<uint64_t>(mysql_stmt_affected_rows(ctx->conn_.getStatement(stindex))));
|
||||
return (mysql_stmt_affected_rows(ctx->conn_.getStatement(stindex)));
|
||||
}
|
||||
|
||||
bool
|
||||
@ -4111,8 +4097,9 @@ MySqlLeaseMgr::getLeases4ByRelayId(const OptionBuffer& relay_id,
|
||||
if (have_qet) {
|
||||
++bindings;
|
||||
}
|
||||
MYSQL_BIND inbind[bindings];
|
||||
memset(inbind, 0, sizeof(inbind));
|
||||
MYSQL_BIND zeroed_out;
|
||||
memset(&zeroed_out, 0, sizeof(zeroed_out));
|
||||
vector<MYSQL_BIND> inbind(bindings, zeroed_out);
|
||||
|
||||
std::vector<uint8_t> relay_id_data = relay_id;
|
||||
unsigned long relay_id_length = relay_id.size();
|
||||
@ -4176,7 +4163,7 @@ MySqlLeaseMgr::getLeases4ByRelayId(const OptionBuffer& relay_id,
|
||||
MySqlLeaseContextAlloc get_context(*this);
|
||||
MySqlLeaseContextPtr ctx = get_context.ctx_;
|
||||
|
||||
getLeaseCollection(ctx, stindex, inbind, result);
|
||||
getLeaseCollection(ctx, stindex, inbind.data(), result);
|
||||
|
||||
return (result);
|
||||
}
|
||||
@ -4223,8 +4210,9 @@ MySqlLeaseMgr::getLeases4ByRemoteId(const OptionBuffer& remote_id,
|
||||
if (have_qet) {
|
||||
++bindings;
|
||||
}
|
||||
MYSQL_BIND inbind[bindings];
|
||||
memset(inbind, 0, sizeof(inbind));
|
||||
MYSQL_BIND zeroed_out;
|
||||
memset(&zeroed_out, 0, sizeof(zeroed_out));
|
||||
vector<MYSQL_BIND> inbind(bindings, zeroed_out);
|
||||
|
||||
std::vector<uint8_t> remote_id_data = remote_id;
|
||||
unsigned long remote_id_length = remote_id.size();
|
||||
@ -4288,7 +4276,7 @@ MySqlLeaseMgr::getLeases4ByRemoteId(const OptionBuffer& remote_id,
|
||||
MySqlLeaseContextAlloc get_context(*this);
|
||||
MySqlLeaseContextPtr ctx = get_context.ctx_;
|
||||
|
||||
getLeaseCollection(ctx, stindex, inbind, result);
|
||||
getLeaseCollection(ctx, stindex, inbind.data(), result);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
@ -22,8 +22,9 @@ namespace http {
|
||||
/// The most common errors are due to receiving malformed requests.
|
||||
class HttpParseError : public Exception {
|
||||
public:
|
||||
HttpParseError(const char* file, size_t line, const char* what) :
|
||||
isc::Exception(file, line, what) { };
|
||||
HttpParseError(const char* file, size_t line, const char* what)
|
||||
: isc::Exception(file, line, what) {
|
||||
}
|
||||
};
|
||||
|
||||
/// @brief Base class for the HTTP message parsers.
|
||||
@ -171,13 +172,13 @@ private:
|
||||
protected:
|
||||
|
||||
/// @brief Define events used by the parser.
|
||||
virtual void defineEvents();
|
||||
virtual void defineEvents() override ;
|
||||
|
||||
/// @brief Verifies events used by the parser.
|
||||
virtual void verifyEvents();
|
||||
virtual void verifyEvents() override;
|
||||
|
||||
/// @brief Defines states of the parser.
|
||||
virtual void defineStates();
|
||||
virtual void defineStates() override;
|
||||
|
||||
/// @brief Generic parser handler which reads a single byte of data and
|
||||
/// parses it using specified callback function.
|
||||
@ -230,7 +231,7 @@ protected:
|
||||
///
|
||||
/// @param explanation Error message explaining the reason for parsing
|
||||
/// failure.
|
||||
virtual void onModelFailure(const std::string& explanation);
|
||||
virtual void onModelFailure(const std::string& explanation) override;
|
||||
|
||||
/// @brief Retrieves next bytes of data from the buffer.
|
||||
///
|
||||
|
@ -214,38 +214,38 @@ public:
|
||||
// returned row the lambda provided as 4th argument should be executed.
|
||||
ASSERT_NO_THROW_LOG(conn_.selectQuery(MySqlConnectionTest::GET_BY_INT_VALUE,
|
||||
bindings, out_bindings,
|
||||
[&](MySqlBindingCollection& out_bindings) {
|
||||
[&](MySqlBindingCollection& captured_out_bindings) {
|
||||
|
||||
// Compare received data with input data assuming they are both non-null.
|
||||
|
||||
if (!out_bindings[0]->amNull() && !in_bindings[0]->amNull()) {
|
||||
if (!captured_out_bindings[0]->amNull() && !in_bindings[0]->amNull()) {
|
||||
EXPECT_EQ(static_cast<int>(in_bindings[0]->getInteger<uint8_t>()),
|
||||
static_cast<int>(out_bindings[0]->getInteger<uint8_t>()));
|
||||
static_cast<int>(captured_out_bindings[0]->getInteger<uint8_t>()));
|
||||
}
|
||||
|
||||
if (!out_bindings[1]->amNull() && !in_bindings[1]->amNull()) {
|
||||
if (!captured_out_bindings[1]->amNull() && !in_bindings[1]->amNull()) {
|
||||
EXPECT_EQ(in_bindings[1]->getInteger<uint32_t>(),
|
||||
out_bindings[1]->getInteger<uint32_t>());
|
||||
captured_out_bindings[1]->getInteger<uint32_t>());
|
||||
}
|
||||
|
||||
if (!out_bindings[2]->amNull() && !in_bindings[2]->amNull()) {
|
||||
if (!captured_out_bindings[2]->amNull() && !in_bindings[2]->amNull()) {
|
||||
EXPECT_EQ(in_bindings[2]->getInteger<int64_t>(),
|
||||
out_bindings[2]->getInteger<int64_t>());
|
||||
captured_out_bindings[2]->getInteger<int64_t>());
|
||||
}
|
||||
|
||||
if (!out_bindings[3]->amNull() && !in_bindings[3]->amNull()) {
|
||||
if (!captured_out_bindings[3]->amNull() && !in_bindings[3]->amNull()) {
|
||||
EXPECT_EQ(in_bindings[3]->getString(),
|
||||
out_bindings[3]->getString());
|
||||
captured_out_bindings[3]->getString());
|
||||
}
|
||||
|
||||
if (!out_bindings[4]->amNull() && !in_bindings[4]->amNull()) {
|
||||
if (!captured_out_bindings[4]->amNull() && !in_bindings[4]->amNull()) {
|
||||
EXPECT_EQ(in_bindings[4]->getBlob(),
|
||||
out_bindings[4]->getBlob());
|
||||
captured_out_bindings[4]->getBlob());
|
||||
}
|
||||
|
||||
if (!out_bindings[5]->amNull() && !in_bindings[5]->amNull()) {
|
||||
if (!captured_out_bindings[5]->amNull() && !in_bindings[5]->amNull()) {
|
||||
EXPECT_TRUE(in_bindings[5]->getTimestamp() ==
|
||||
out_bindings[5]->getTimestamp());
|
||||
captured_out_bindings[5]->getTimestamp());
|
||||
}
|
||||
}));
|
||||
|
||||
|
@ -20,15 +20,6 @@
|
||||
using namespace isc::asiolink;
|
||||
namespace ph = std::placeholders;
|
||||
|
||||
namespace {
|
||||
|
||||
/// @brief Maximum size of a message that can be logged.
|
||||
///
|
||||
/// The part of the message beyond this value is truncated.
|
||||
const size_t MAX_LOGGED_MESSAGE_SIZE = 1024;
|
||||
|
||||
}
|
||||
|
||||
namespace isc {
|
||||
namespace tcp {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user