From d4a3ec0224dfa21c7312db905d2d6967fbdf1f46 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Mon, 13 Feb 2012 19:07:53 +0900 Subject: [PATCH] Add logging for IP addresses added. --- src/command_ip.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/command_ip.cc b/src/command_ip.cc index 0dc590b4..031b0d1f 100644 --- a/src/command_ip.cc +++ b/src/command_ip.cc @@ -75,6 +75,10 @@ ipv4_filter_parse(const char* address, int value) { if (values_read < 7) block = 8 * (values_read / 2); + lt_log_print(torrent::LOG_CONNECTION_DEBUG, "Adding ip filter for %u.%u.%u.%u/%u.", + ip_values[0], ip_values[1], ip_values[2], ip_values[3], block); + + torrent::PeerList::ipv4_filter()->insert((ip_values[0] << 24) + (ip_values[1] << 16) + (ip_values[2] << 8) + ip_values[3], rpc::ipv4_table::mask_bits - block, value); } @@ -214,13 +218,6 @@ apply_ipv4_filter_load(const torrent::Object::list_type& args) { if (file.gcount() == 0) throw torrent::internal_error("parse_command_file(...) file.gcount() == 0."); - int lineLength = file.gcount() - 1; - // In case we are at the end of the file and the last character is - // not a line feed, we'll just increase the read character count so - // that the last would also be included in option line. - if (file.eof() && file.get() != '\n') - lineLength++; - lineNumber++; if (buffer[0] == '\0' || buffer[0] == '#')