server: Fix set-but-unused variable warnings

This commit is contained in:
Iris Morelle 2022-02-14 22:51:39 -03:00
parent 6b41eae4e5
commit baf6f5d30a
No known key found for this signature in database
GPG key ID: E312033F4023A753
2 changed files with 4 additions and 4 deletions

View file

@ -359,7 +359,7 @@ void server_base::coro_send_file(socket_ptr socket, const std::string& filename,
std::size_t filesize { std::size_t(filesystem::file_size(filename)) };
int in_file { open(filename.c_str(), O_RDONLY) };
off_t offset { 0 };
std::size_t total_bytes_transferred { 0 };
//std::size_t total_bytes_transferred { 0 };
union DataSize
{
@ -383,7 +383,7 @@ void server_base::coro_send_file(socket_ptr socket, const std::string& filename,
int n = ::sendfile(socket->native_handle(), in_file, &offset, 65536);
*(yield.ec_) = boost::system::error_code(n < 0 ? errno : 0,
boost::asio::error::get_system_category());
total_bytes_transferred += *(yield.ec_) ? 0 : n;
//total_bytes_transferred += *(yield.ec_) ? 0 : n;
// Retry operation immediately if interrupted by signal.
if (*(yield.ec_) == boost::asio::error::interrupted)

View file

@ -124,13 +124,13 @@ ip_mask parse_ip(const std::string& ip)
if (split_ip.size() > 4) throw banned::error("Malformed ip address: " + ip);
unsigned int shift = 4*8; // start shifting from the highest byte
unsigned int mask = 0xFF000000;
//unsigned int mask = 0xFF000000;
const unsigned int complete_part_mask = 0xFF;
auto part = split_ip.begin();
bool wildcard = false;
do {
shift -= 8;
mask >>= 8;
//mask >>= 8;
if(part == split_ip.end()) {
if(!wildcard)
throw banned::error("Malformed ip address: '" + ip + "'");