From 3f40890eb6a9b9f6c7286238845b0c67eb7f258b Mon Sep 17 00:00:00 2001
From: arvidn
Date: Sat, 20 Feb 2016 15:45:46 -0500
Subject: [PATCH 1/6] simplify logic for saving resume a bit
---
src/torrent.cpp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/torrent.cpp b/src/torrent.cpp
index 029efe41b..140c03a58 100644
--- a/src/torrent.cpp
+++ b/src/torrent.cpp
@@ -7262,9 +7262,6 @@ namespace libtorrent
// bit 0: set if we have the piece
// bit 1: set if we have verified the piece (in seed mode)
bool const is_checking = state() == torrent_status::checking_files;
- bool const has_checked = state() == torrent_status::downloading
- || state() == torrent_status::finished
- || state() == torrent_status::seeding;
// if we are checking, only save the have_pieces bitfield up to the piece
// we have actually checked. This allows us to resume the checking when we
@@ -7273,7 +7270,7 @@ namespace libtorrent
// bitfield.
int const max_piece
= is_checking ? m_num_checked_pieces
- : has_checked ? m_torrent_file->num_pieces()
+ : m_files_checked ? m_torrent_file->num_pieces()
: 0;
if (max_piece > 0)
From 3231aa4c9d9e4a7c9f4f0deb585387a9d7930cd6 Mon Sep 17 00:00:00 2001
From: arvidn
Date: Sat, 20 Feb 2016 15:53:43 -0500
Subject: [PATCH 2/6] make force recheck a bit more robust by initializing the
progress state immediately
---
src/torrent.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/torrent.cpp b/src/torrent.cpp
index 029efe41b..41c4e4595 100644
--- a/src/torrent.cpp
+++ b/src/torrent.cpp
@@ -2659,6 +2659,10 @@ namespace libtorrent
}
else
{
+ m_progress_ppm = 0;
+ m_checking_piece = 0;
+ m_num_checked_pieces = 0;
+
set_state(torrent_status::checking_files);
if (m_auto_managed) pause(true);
if (should_check_files()) start_checking();
From 5e4d6d139f342d6140432cc7d14e5eefdc591886 Mon Sep 17 00:00:00 2001
From: arvidn
Date: Sat, 20 Feb 2016 16:38:56 -0500
Subject: [PATCH 3/6] documentation fixes
---
docs/contributing.html | 7 ++++--
docs/contributing.rst | 7 +++++-
docs/features.html | 16 ++++++------
docs/features.rst | 18 ++++++--------
docs/hacking.diagram | 20 +++++++--------
docs/index.html | 13 +++++-----
docs/index.rst | 21 +++++++---------
docs/todo.html | 56 +++++++++++++++++++++---------------------
8 files changed, 80 insertions(+), 78 deletions(-)
diff --git a/docs/contributing.html b/docs/contributing.html
index d72c9bad0..1df40233d 100644
--- a/docs/contributing.html
+++ b/docs/contributing.html
@@ -75,7 +75,9 @@ as explicit_cache).
Finding typos or outdated sections in the documentation. Contributing documentation
based on your own experience and experimentation with the library or with BitTorrent
in general. Non-reference documentation is very much welcome as well, higher level
-descriptions on how to configure libtorrent for various situations for instance.
+descriptions on how to configure libtorrent for various situations for instance.
+The reference documentation for libtorrent is generated from the header files.
+For updates, please submit a pull request.
@@ -83,7 +85,8 @@ descriptions on how to configure libtorrent for various situations for instance.
Code
Contributing code for new features or bug-fixes is highly welcome. If you're interested
in adding a feature but not sure where to start, please contact the mailing list or
-#libtorrent @ irc.freenode.net.
+#libtorrent @ irc.freenode.net. For proposed fixes or udpates, please
+submit a pull request.
New features might be better support for integrating with other services, new choking
algorithms, seeding policies, ports to new platforms etc.
diff --git a/docs/contributing.rst b/docs/contributing.rst
index cb93797c2..35307c9e2 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -34,11 +34,14 @@ enumerated on this page, please contact arvid@libtorrent.org or the `mailing lis
based on your own experience and experimentation with the library or with BitTorrent
in general. Non-reference documentation is very much welcome as well, higher level
descriptions on how to configure libtorrent for various situations for instance.
+ The reference documentation for libtorrent is generated from the header files.
+ For updates, please submit a `pull request`_.
3. Code
Contributing code for new features or bug-fixes is highly welcome. If you're interested
in adding a feature but not sure where to start, please contact the `mailing list`_ or
- ``#libtorrent`` @ ``irc.freenode.net``.
+ ``#libtorrent`` @ ``irc.freenode.net``. For proposed fixes or udpates, please
+ submit a `pull request`_.
New features might be better support for integrating with other services, new choking
algorithms, seeding policies, ports to new platforms etc.
@@ -49,5 +52,7 @@ For outstanding things to do, see the `todo list`_.
.. _hacking: hacking.html
+.. _`pull request`: https://github.com/arvidn/libtorrent
+
.. _`todo list`: todo.html
diff --git a/docs/features.html b/docs/features.html
index 142ddf944..efe362179 100644
--- a/docs/features.html
+++ b/docs/features.html
@@ -79,7 +79,7 @@ the library.
features
-
libtorrent is under active development. It is an ongoing project. Its
+
libtorrent is an ongoing project under active development. Its
current state supports and includes the following features:
extensions
@@ -113,22 +113,22 @@ ratio rather than downloading the torrent.
disk management
-- uses a separate disk I/O thread to not have the disk ever block on network or
-client interaction. (see threads).
-- uses asynchronous disk I/O when available (overlapped I/O, kaio, and posix-aio)
-to make optimal use of disk bandwidth capacity
-- supports verifying the SHA-1 hash of pieces in multiple threads, to take full
+
- can use multipled disk I/O threads to not have the disk block network or
+client interaction.
+- supports verifying the SHA-1 hash of pieces in multiple threads, to take
advantage of multi core machines.
- supports files > 2 gigabytes.
-- fast resume support, a way to get rid of the costly piece check at the
+
- fast resume support, a way to avoid the costly piece check at the
start of a resumed torrent. Saves the storage state, piece_picker state
-as well as all local peers in a separate fast-resume file.
+as well as all local peers in a fast-resume file.
- has an adjustable read and write disk cache for improved disk throughput.
- queues torrents for file check, instead of checking all of them in parallel.
- does not have any requirements on the piece order in a torrent that it
resumes. This means it can resume a torrent downloaded by any client.
- seed mode, where the files on disk are assumed to be complete, and each
piece's hash is verified the first time it is requested.
+- implements an ARC disk cache, tuned for performing well under bittorrent work
+loads
diff --git a/docs/features.rst b/docs/features.rst
index a2043ae92..47b4a0a9e 100644
--- a/docs/features.rst
+++ b/docs/features.rst
@@ -21,7 +21,7 @@ the library.
features
========
-libtorrent is under active development. It is an ongoing project. Its
+libtorrent is an ongoing project under active development. Its
current state supports and includes the following features:
extensions
@@ -59,24 +59,22 @@ extensions
disk management
---------------
-* uses a separate disk I/O thread to not have the disk ever block on network or
- client interaction. (see threads_).
-* uses asynchronous disk I/O when available (overlapped I/O, kaio, and posix-aio)
- to make optimal use of disk bandwidth capacity
-* supports verifying the SHA-1 hash of pieces in multiple threads, to take full
+* can use multipled disk I/O threads to not have the disk block network or
+ client interaction.
+* supports verifying the SHA-1 hash of pieces in multiple threads, to take
advantage of multi core machines.
* supports files > 2 gigabytes.
-* fast resume support, a way to get rid of the costly piece check at the
+* fast resume support, a way to avoid the costly piece check at the
start of a resumed torrent. Saves the storage state, piece_picker state
- as well as all local peers in a separate fast-resume file.
+ as well as all local peers in a fast-resume file.
* has an adjustable read and write disk cache for improved disk throughput.
* queues torrents for file check, instead of checking all of them in parallel.
* does not have any requirements on the piece order in a torrent that it
resumes. This means it can resume a torrent downloaded by any client.
* seed mode, where the files on disk are assumed to be complete, and each
piece's hash is verified the first time it is requested.
-
-.. _threads: manualref.html#threads
+* implements an ARC disk cache, tuned for performing well under bittorrent work
+ loads
network
-------
diff --git a/docs/hacking.diagram b/docs/hacking.diagram
index 02d64968d..d9604ef6e 100644
--- a/docs/hacking.diagram
+++ b/docs/hacking.diagram
@@ -6,25 +6,25 @@
| "torrent_handle" +--------+ | |
+---------------------+ "weak" | +--------------+ |
| | | "m_connections[]"
- | | +-------------+----+
- | | | |
- "m_picker" v v | v "peers we are connected to"
- +----------------+ +----------++ +-------------------+
- | "piece_picker" |<---+-+ "torrent" ++ +--+ "peer_connection" ++
- +----------------+ | ++----------+| | ++------------------+|
- "m_torrent_file" | +-----------+ | +-------------------+
+ | | +-------------+ +--+
+ | | | | |
+ "m_picker" v v | v v "peers we are connected to"
+ +----------------+ +----------++ +-------------------+
+ | "piece_picker" |<---+-+ "torrent" ++ +--+ "peer_connection" ++
+ +----------------+ | ++----------+| | ++------------------+|
+ "m_torrent_file" | +-----------+ | +-------------------+
+-------------------+ | |
- | "torrent_info" |<---+ | "m_socket"
+ | "torrent_info" |<---+ | "m_socket"
+-------------------+ | | +----------------------------+
| +->| "socket_type (variant)" |
"m_peer_list" v | | "(TCP/uTP/SSL/socks5/...)" |
+--------------+ | +----------------------------+
- | "peer_list" | |
+ | "peer_list" | |
+------------+-+ | "m_peer_info"
"list of all" | "m_peers[]" | "contains contact information"
"peers we" | | "for peers we're not necessarily"
"know of" | v "connected to"
- | +----------------+
+ | +----------------+
+---->| "torrent_peer" ++
++---------------+|
+----------------+
diff --git a/docs/index.html b/docs/index.html
index 1e81365de..205b158bb 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -47,14 +47,13 @@