diff --git a/docs/manual.html b/docs/manual.html index 7d564f802..55a12706b 100755 --- a/docs/manual.html +++ b/docs/manual.html @@ -191,6 +191,7 @@ means it can resume a torrent downloaded by any client.
  • supports the compact=1 tracker parameter.
  • selective downloading. The ability to select which parts of a torrent you want to download.
  • +
  • ip filter
  • libtorrent is portable at least among Windows, MacOSX and other UNIX-systems. It uses Boost.Thread, @@ -813,7 +814,7 @@ void add_file(boost::filesystem::path file, size_type size); the comment that belongs to this torrent. The comment can be retrieved with the comment() member.

    set_piece_size() will set the size of each piece in this torrent. The piece size must -be an even multiple of 2. i.e. usually something like 256 kB, 512 kB, 1024 kB etc. The +be an even multiple of 2. i.e. usually something like 256 kiB, 512 kiB, 1024 kiB etc. The size is given in number of bytes.

    set_creator() is an optional attribute that can be used to identify your application that was used to create the torrent file.

    @@ -2420,7 +2421,8 @@ int main(int argc, char* argv[]) if (argc != 4) { - std::cerr << "usage: make_torrent <output torrent-file> <announce url> <file or directory to create torrent from>\n"; + std::cerr << "usage: make_torrent <output torrent-file> <announce url> " + "<file or directory to create torrent from>\n"; return 1; } diff --git a/docs/manual.rst b/docs/manual.rst index 2432497a7..cf7e81084 100755 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -52,6 +52,7 @@ The current state includes the following features: * supports the ``compact=1`` tracker parameter. * selective downloading. The ability to select which parts of a torrent you want to download. + * ip filter __ http://home.elp.rr.com/tur/multitracker-spec.txt .. _Azureus: http://azureus.sourceforge.net @@ -714,7 +715,7 @@ the comment that belongs to this torrent. The comment can be retrieved with the ``comment()`` member. ``set_piece_size()`` will set the size of each piece in this torrent. The piece size must -be an even multiple of 2. i.e. usually something like 256 kB, 512 kB, 1024 kB etc. The +be an even multiple of 2. i.e. usually something like 256 kiB, 512 kiB, 1024 kiB etc. The size is given in number of bytes. ``set_creator()`` is an optional attribute that can be used to identify your application @@ -2482,7 +2483,8 @@ Shows how to create a torrent from a directory tree:: if (argc != 4) { - std::cerr << "usage: make_torrent \n"; + std::cerr << "usage: make_torrent " + "\n"; return 1; } diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index 6526bf7e4..d13479f64 100755 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -64,7 +64,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) struct logger; #endif @@ -345,7 +345,7 @@ namespace libtorrent torrent_handle get_handle() const; // LOGGING -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) logger* spawn_logger(const char* title); virtual void debug_log(const std::string& line); diff --git a/include/libtorrent/tracker_manager.hpp b/include/libtorrent/tracker_manager.hpp index 101749b5d..7e41652b7 100755 --- a/include/libtorrent/tracker_manager.hpp +++ b/include/libtorrent/tracker_manager.hpp @@ -125,7 +125,7 @@ namespace libtorrent address m_tracker_address; -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) virtual void debug_log(const std::string& line) = 0; #endif private: diff --git a/src/http_tracker_connection.cpp b/src/http_tracker_connection.cpp index 2402d0235..a79b37166 100755 --- a/src/http_tracker_connection.cpp +++ b/src/http_tracker_connection.cpp @@ -215,7 +215,7 @@ namespace libtorrent m_send_buffer += base64encode(auth); } m_send_buffer += "\r\n\r\n"; -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) { requester().debug_log("==> TRACKER_REQUEST [ str: " + m_send_buffer + " ]"); @@ -231,7 +231,7 @@ namespace libtorrent // the connections list. bool http_tracker_connection::tick() { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) try { #endif @@ -246,7 +246,7 @@ namespace libtorrent return true; } -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("tracker connection tick"); #endif @@ -287,7 +287,7 @@ namespace libtorrent if (!m_socket->is_readable()) return false; m_request_time = second_clock::universal_time(); -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("tracker connection socket readable"); #endif @@ -316,7 +316,7 @@ namespace libtorrent if (received > 0) m_recv_pos += received; -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("received: " + boost::lexical_cast(m_recv_pos)); #endif @@ -337,7 +337,7 @@ namespace libtorrent // if we don't have a full line yet, wait. if (newline == end) return false; -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log(std::string(m_buffer.begin(), newline)); #endif @@ -379,7 +379,7 @@ namespace libtorrent { line.assign(m_buffer.begin(), newline); -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log(line); #endif @@ -447,7 +447,7 @@ namespace libtorrent else if (line.size() < 3) { m_state = read_body; -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("end of http header"); #endif if (m_code >= 300 && m_code < 400) @@ -463,7 +463,7 @@ namespace libtorrent return true; } -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("Redirecting to \"" + m_location + "\""); #endif std::string::size_type i = m_location.find('?'); @@ -529,7 +529,7 @@ namespace libtorrent } return false; -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) } catch (std::exception&) { diff --git a/src/policy.cpp b/src/policy.cpp index 7b3e9a486..6121bf88c 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -813,7 +813,7 @@ namespace libtorrent throw protocol_error("too many connections, refusing incoming connection"); // cause a disconnect } -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (c.get_socket()->sender().ip() == m_torrent->current_tracker().ip()) { m_torrent->debug_log("overriding connection limit for tracker NAT-check"); diff --git a/src/torrent.cpp b/src/torrent.cpp index a83d63d96..3189c9b85 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -321,7 +321,7 @@ namespace libtorrent // connect to random peers from the list std::random_shuffle(peer_list.begin(), peer_list.end()); -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) std::stringstream s; s << "TRACKER RESPONSE:\n" "interval: " << m_duration << "\n" @@ -348,7 +348,7 @@ namespace libtorrent if (m_ses.m_ip_filter.access(a) == ip_filter::blocked) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) debug_log("blocked ip from tracker: " + i->ip); #endif continue; @@ -1465,7 +1465,7 @@ namespace libtorrent void torrent::tracker_request_timed_out( tracker_request const&) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) debug_log("*** tracker timed out"); #endif if (m_ses.m_alerts.should_post(alert::warning)) @@ -1486,7 +1486,7 @@ namespace libtorrent void torrent::tracker_request_error(tracker_request const& , int response_code, const std::string& str) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) debug_log(std::string("*** tracker error: ") + str); #endif if (m_ses.m_alerts.should_post(alert::warning)) @@ -1504,7 +1504,7 @@ namespace libtorrent } -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) void torrent::debug_log(const std::string& line) { (*m_ses.m_logger) << line << "\n"; diff --git a/src/udp_tracker_connection.cpp b/src/udp_tracker_connection.cpp index d03ba800d..a92f9b6bf 100755 --- a/src/udp_tracker_connection.cpp +++ b/src/udp_tracker_connection.cpp @@ -256,7 +256,7 @@ namespace libtorrent if (len < 8) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("udp_tracker_connection: " "got a message with size < 8, ignoring"); @@ -282,7 +282,7 @@ namespace libtorrent if (len < 20) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("udp_tracker_connection: " "got a message with size < 20, ignoring"); @@ -330,7 +330,7 @@ namespace libtorrent if (len < 8) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("udp_tracker_connection: " "got a message with size < 8, ignoring"); @@ -356,7 +356,7 @@ namespace libtorrent if (len < 20) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("udp_tracker_connection: " "got a message with size < 20, ignoring"); @@ -383,7 +383,7 @@ namespace libtorrent if (len < 8) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("udp_tracker_connection: " "got a message with size < 8, ignoring"); @@ -404,7 +404,7 @@ namespace libtorrent if (action != connect) return false; if (m_transaction_id != transaction) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("udp_tracker_connection: " "got a message with incorrect transaction id, ignoring"); @@ -414,7 +414,7 @@ namespace libtorrent if (len < 16) { -#ifdef TORRENT_VERBOSE_LOGGING +#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) if (has_requester()) requester().debug_log("udp_tracker_connection: " "got a connection message size < 16, ignoring");