diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..894a439fb --- /dev/null +++ b/AUTHORS @@ -0,0 +1,14 @@ + +Written by Arvid Norberg. Copyright (c) 2003-2005 + +Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson + +Big thanks to Michael Wojciechowski and Peter Koeleman for making the +autotools scripts. + +Thanks to Reimond Retz for bugfixes, suggestions and testing + +Thanks to University of UmeŒ for providing development and test hardware. + +Project is hosted by sourceforge. + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..14555a05b --- /dev/null +++ b/ChangeLog @@ -0,0 +1,24 @@ + +Initial release 0.9 + + * multitracker support + * serves multiple torrents on a single port and a single thread + * supports http proxies and proxy authentication + * gzipped tracker-responses + * block level piece picker + * queues torrents for file check, instead of checking all of them in parallel + * uses separate threads for checking files and for main downloader + * upload and download rate limits + * piece-wise, unordered, incremental file allocation + * fast resume support + * supports files > 2 gigabytes + * supports the no_peer_id=1 extension + * support for udp-tracker protocol + * number of connections limit + * delays sending have messages + * can resume pieces downloaded in any order + * adjusts the length of the request queue depending on download rate + * supports compact=1 + * selective downloading + * ip filter + diff --git a/NEWS b/NEWS new file mode 100644 index 000000000..cd9658d6b --- /dev/null +++ b/NEWS @@ -0,0 +1,3 @@ + +initial release of libtorrent 0.9 + diff --git a/README b/README new file mode 100644 index 000000000..0b19bf61f --- /dev/null +++ b/README @@ -0,0 +1,25 @@ +libtorrent is a C++ library that aims to be a good alternative to all the +other bittorrent implementations around. It is a +library and not a full featured client, although it comes with a working +example client. + +The main goals of libtorrent are: + + * to be cpu efficient + * to be memory efficient + * to be very easy to use + +See docs/manual.html for more detailed build and usage instructions. + +To build with autotools, run: + + ./configure + +Followed by + + make + +When libtorrent is built, finish off by running the tests: + + make check + diff --git a/docs/client_test.html b/docs/client_test.html new file mode 100644 index 000000000..9e95166b7 --- /dev/null +++ b/docs/client_test.html @@ -0,0 +1,54 @@ + + + +
+ + +Client test is a, more or less, complete bittorrent client. It lacks most +settings and you can't start or stop torrents once you've started it. All +the settings are hardcoded. The commandline arguments are:
++client_test <filename1.torrent> <filename2.torrent> ... ++
You can start any number of torrent downloads/seeds via the commandline. +If one argument starts with http:// it is interpreted as a tracker +announce url, and it expects an info-hash as the next argument. The info-hash +has ti be hex-encoded. For example: 2410d4554d5ed856d69f426c38791673c59f4418. +If you pass an announce url and info-hash, a torrent-less download is started. +It relies on that at least one peer on the tracker is running a libtorrent based +client and has the metadata (.torrent file). The metadata extension in +libtorrent will then download it from that peer (or from those peers if more +than one).
+While running, the client_test sample will look something like this:
+ +The commands available in the client are:
++++
+- q quits the client (there will be a delay while the client waits +for tracker responses)
+- l toggle log. Will display the log at the bottom, informing about +tracker and peer events.
+- i toggles torrent info. Will show the peer list for each torrent.
+- d toggle download info. Will show the block list for each torrent, +showing downloaded and requested blocks.
+- p pause all torrents.
+- u unpause all torrents.
+- r force tracker reannounce for all torrents.
+
The list at the bottom (shown if you press d) shows which blocks has +been requested from which peer. The green background means that it has been +downloaded. It shows that fast peers will prefer to request whole pieces +instead of dowloading parts of pieces. It may make it easier to determine +which peer that sent the corrupt data if a piece fails the hash test.
+ +There's unicode support on linux, MacOS X and Windows.
+libtorrent is a C++ library that aims to be a good alternative to all the other bittorrent implementations around. It is a library and not a full featured client, although it comes with a working -example client.
+example client.The main goals of libtorrent are:
diff --git a/docs/index.rst b/docs/index.rst index 5c030c5b4..80d4fa452 100755 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,13 +12,15 @@ libtorrent .. _sourceforge page: http://www.sourceforge.net/projects/libtorrent .. _documentation: manual.html .. _`report bugs`: http://sourceforge.net/tracker/?group_id=79942&atid=558250 -.. _screenshot: libtorrent_screen.png +.. _screenshot: client_test.png .. _mailing list: http://lists.sourceforge.net/lists/listinfo/libtorrent-discuss libtorrent is a C++ library that aims to be a good alternative to all the other bittorrent implementations around. It is a library and not a full featured client, although it comes with a working -example client. +`example client`__. + +__ client_test.html The main goals of libtorrent are: diff --git a/docs/manual.html b/docs/manual.html index cc3f9ef75..6914a6202 100755 --- a/docs/manual.html +++ b/docs/manual.html @@ -19,140 +19,140 @@
Arvid Norberg, c99ang@cs.umu.se -- ++-
- introduction
-- downloading and building
-
- building with BBv2
-- building with autotools
-- Building with other build systems
-- Build configurations
+- introduction
+- downloading and building
-- using
-- session
-
- session()
-- ~session()
-- add_torrent()
-- remove_torrent()
-- disable_extensions() enable_extension()
-- set_upload_rate_limit() set_download_rate_limit()
-- set_max_uploads() set_max_connections()
-- set_ip_filter()
-- status()
-- is_listening() listen_port() listen_on()
-- pop_alert() set_severity_level()
+- overview
+- session
-- entry
-
- integer() string() list() dict() type()
+- entry
-- torrent_info
-
- torrent_info()
-- set_comment() set_piece_size() set_creator() set_hash() add_tracker() add_file()
-- create_torrent()
-- begin_files() end_files() rbegin_files() rend_files()
-- num_files() file_at()
-- print()
-- trackers()
-- total_size() piece_length() piece_size() num_pieces()
-- hash_for_piece() info_hash()
-- name() comment() creation_date()
+- torrent_info
-+
- torrent_info()
+- set_comment() set_piece_size() set_creator() set_hash() add_tracker() add_file()
+- create_torrent()
+- begin_files() end_files() rbegin_files() rend_files()
+- num_files() file_at()
+- print()
+- trackers()
+- total_size() piece_length() piece_size() num_pieces()
+- hash_for_piece() info_hash()
+- name() comment() creation_date()
- torrent_handle
-
- save_path()
-- move_storage()
-- force_reannounce()
-- connect_peer()
-- set_ratio()
-- set_upload_limit() set_download_limit()
-- pause() resume() is_paused()
-- is_seed()
-- has_metadata()
-- set_tracker_login()
-- trackers() replace_trackers()
-- use_interface()
-- info_hash()
-- set_max_uploads() set_max_connections()
-- write_resume_data()
-- metadata()
-- status()
-- get_download_queue()
-- get_peer_info()
-- get_torrent_info()
-- is_valid()
+- torrent_handle
-+
- save_path()
+- move_storage()
+- force_reannounce()
+- connect_peer()
+- set_ratio()
+- set_upload_limit() set_download_limit()
+- pause() resume() is_paused()
+- is_seed()
+- has_metadata()
+- set_tracker_login()
+- trackers() replace_trackers()
+- use_interface()
+- info_hash()
+- set_max_uploads() set_max_connections()
+- write_resume_data()
+- metadata()
+- status()
+- get_download_queue()
+- get_peer_info()
+- get_torrent_info()
+- is_valid()
- torrent_status
-- peer_info
-- address
-- http_settings
-- ip_filter
-
- ip_filter()
-- add_rule()
-- access()
-- export_filter()
+- torrent_status
+- peer_info
+- address
+- http_settings
+- ip_filter
-- big_number
-- hasher
-- fingerprint
-- free functions
-
- identify_client()
-- bdecode() bencode()
+- big_number
+- hasher
+- fingerprint
+- free functions
-- alerts
-
- listen_failed_alert
-- file_error_alert
-- tracker_announce_alert
-- tracker_alert
-- tracker_reply_alert
-- tracker_warning_alert
-- hash_failed_alert
-- peer_ban_alert
-- peer_error_alert
-- invalid_request_alert
-- torrent_finished_alert
-- metadata_received_alert
-- fastresume_rejected_alert
-- dispatcher
+- alerts
-- exceptions
@@ -361,7 +361,7 @@ For more build configuration flags see-building with autotools
First of all, you need to install automake and autoconf. Many -unix/linux systems come with these preinstalled.
+unix/linux systems comes with these preinstalled.Step 1: Running configure
In your shell, change directory to the libtorrent directory and run @@ -468,14 +468,20 @@ the session log. checks in the storage, including logging of piece sorting. +
UNICODE +If building on windows this will make sure the +UTF-8 strings in pathnames are converted into +UTF-16 before they are passed to the file +operations. +If you experience that libtorrent uses unreasonable amounts of cpu, it will definately help to define NDEBUG, since it will remove the invariant checks within the library.
-using
++overview
The interface of libtorrent consists of a few classes. The main class is the session, it contains the main loop that serves all torrents.
The basic usage is as follows:
@@ -494,7 +500,8 @@ the session, it conta -save resume data for all torrent_handles (optional)
+save resume data for all torrent_handles (optional, see +write_resume_data())
- @@ -1186,7 +1193,7 @@ struct torrent_handle
destruct session object
The default constructor will initialize the handle to an invalid state. Which means you cannot perform any operation on it, unless you first assign it a valid handle. If you try to perform any operation on an uninitialized handle, it will throw invalid_handle.
-TODO: document filter_piece(), filter_pieces(), is_piece_filtered(), filtered_pieces() and filter_files()
+TODO: document filter_piece(), filter_pieces(), is_piece_filtered(), filtered_pieces() and filter_files()
save_path()
@@ -1483,7 +1490,7 @@ it has been added to the session. Usually this is because the storage for the to somehow invalid or if the filenames are not allowed (and hence cannot be opened/created) on your filesystem. If such an error occurs, a file_error_alert is generated and all handles that refers to that torrent will become invalid. -TODO: document storage
+TODO: document storage
@@ -2472,6 +2479,9 @@ struct invalid_torrent_file: std::exceptionexamples
+Except for the example programs in this manual, there's also a bigger example +of a (little bit) more complete client, client_test. There are separate +instructions for how to use it here if you'd like to try it.
dump_torrent
This is an example of a program that will take a torrent-file as a parameter and @@ -3076,7 +3086,7 @@ boost::filesystem::path::default_name_check(boost::filesystem::native);
acknowledgements
-Written by Arvid Norberg. Copyright (c) 2003-2005
+Written by Arvid Norberg. Copyright © 2003-2005
Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson
Big thanks to Michael Wojciechowski and Peter Koeleman for making the autotools scripts.
diff --git a/docs/manual.rst b/docs/manual.rst index 7bd02609b..4a4a3d2ee 100755 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -4,8 +4,9 @@ libtorrent manual :Author: Arvid Norberg, c99ang@cs.umu.se -.. contents:: +.. contents:: Table of contents :depth: 2 + :backlinks: none introduction ============ @@ -362,8 +363,8 @@ defines you can use to control the build. If you experience that libtorrent uses unreasonable amounts of cpu, it will definately help to define ``NDEBUG``, since it will remove the invariant checks within the library. -using -===== +overview +======== The interface of libtorrent consists of a few classes. The main class is the ``session``, it contains the main loop that serves all torrents. @@ -376,7 +377,8 @@ The basic usage is as follows: * query the torrent_handles for progress (see torrent_handle_) * query the session for information * add and remove torrents from the session at run-time -* save resume data for all torrent_handles (optional) +* save resume data for all torrent_handles (optional, see + `write_resume_data()`_) * destruct session object Each class and function is described in this manual. @@ -1128,7 +1130,7 @@ The default constructor will initialize the handle to an invalid state. Which me perform any operation on it, unless you first assign it a valid handle. If you try to perform any operation on an uninitialized handle, it will throw ``invalid_handle``. -**TODO: document filter_piece(), filter_pieces(), is_piece_filtered(), filtered_pieces() and filter_files()** +*TODO: document filter_piece(), filter_pieces(), is_piece_filtered(), filtered_pieces() and filter_files()* save_path() ----------- @@ -1447,7 +1449,7 @@ somehow invalid or if the filenames are not allowed (and hence cannot be opened/ your filesystem. If such an error occurs, a file_error_alert_ is generated and all handles that refers to that torrent will become invalid. -**TODO: document storage** +*TODO: document storage* torrent_status @@ -2551,6 +2553,12 @@ doesn't meet the requirements on what information has to be present in a torrent examples ======== +Except for the example programs in this manual, there's also a bigger example +of a (little bit) more complete client, ``client_test``. There are separate +instructions for how to use it here__ if you'd like to try it. + +__ client_test.html + dump_torrent ------------ @@ -3087,7 +3095,7 @@ __ http://www.boost.org/libs/filesystem/doc/index.htm acknowledgements ================ -Written by Arvid Norberg. Copyright (c) 2003-2005 +Written by Arvid Norberg. Copyright |copy| 2003-2005 Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson @@ -3102,6 +3110,7 @@ Project is hosted by sourceforge. |sf_logo|__ +.. |copy| unicode:: 0xA9 .. copyright sign __ http://www.cs.umu.se .. |sf_logo| image:: http://sourceforge.net/sflogo.php?group_id=7994 __ http://sourceforge.net diff --git a/docs/unicode_support.png b/docs/unicode_support.png new file mode 100644 index 000000000..33c3f3c70 Binary files /dev/null and b/docs/unicode_support.png differ