regenerated html

This commit is contained in:
Arvid Norberg 2011-11-07 06:57:48 +00:00
parent 57e7f14024
commit d16395beae
2 changed files with 305 additions and 173 deletions

View File

@ -2,25 +2,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript">
/* <![CDATA[ */
(function() {
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
t.parentNode.insertBefore(s, t);
})();
/* ]]> */
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
<link rel="stylesheet" type="text/css" href="../../css/rst.css" />
<script type="text/javascript">
/* <![CDATA[ */
(function() {
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
t.parentNode.insertBefore(s, t);
})();
/* ]]> */
</script>
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
/* Hides from IE-mac \*/
@ -132,8 +130,6 @@ as well as all local peers in a separate fast-resume file.</li>
<li>queues torrents for file check, instead of checking all of them in parallel.</li>
<li>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.</li>
<li>supports both sparse files and compact file allocation (where pieces
are kept consolidated on disk)</li>
<li>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.</li>
</ul>

View File

@ -168,174 +168,178 @@
<li><a class="reference internal" href="#get-peer-info" id="id118">get_peer_info()</a></li>
<li><a class="reference internal" href="#get-torrent-info" id="id119">get_torrent_info()</a></li>
<li><a class="reference internal" href="#is-valid" id="id120">is_valid()</a></li>
<li><a class="reference internal" href="#set-ssl-certificate" id="id121">set_ssl_certificate()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#torrent-status" id="id121">torrent_status</a></li>
<li><a class="reference internal" href="#peer-info" id="id122">peer_info</a></li>
<li><a class="reference internal" href="#feed-handle" id="id123">feed_handle</a><ul>
<li><a class="reference internal" href="#update-feed" id="id124">update_feed()</a></li>
<li><a class="reference internal" href="#get-feed-status" id="id125">get_feed_status()</a></li>
<li><a class="reference internal" href="#set-settings-settings" id="id126">set_settings() settings()</a></li>
<li><a class="reference internal" href="#torrent-status" id="id122">torrent_status</a></li>
<li><a class="reference internal" href="#peer-info" id="id123">peer_info</a></li>
<li><a class="reference internal" href="#feed-handle" id="id124">feed_handle</a><ul>
<li><a class="reference internal" href="#update-feed" id="id125">update_feed()</a></li>
<li><a class="reference internal" href="#get-feed-status" id="id126">get_feed_status()</a></li>
<li><a class="reference internal" href="#set-settings-settings" id="id127">set_settings() settings()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#feed-item" id="id127">feed_item</a></li>
<li><a class="reference internal" href="#session-customization" id="id128">session customization</a><ul>
<li><a class="reference internal" href="#presets" id="id129">presets</a></li>
<li><a class="reference internal" href="#session-settings" id="id130">session_settings</a></li>
<li><a class="reference internal" href="#feed-item" id="id128">feed_item</a></li>
<li><a class="reference internal" href="#session-customization" id="id129">session customization</a><ul>
<li><a class="reference internal" href="#presets" id="id130">presets</a></li>
<li><a class="reference internal" href="#session-settings" id="id131">session_settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#pe-settings" id="id131">pe_settings</a></li>
<li><a class="reference internal" href="#proxy-settings" id="id132">proxy_settings</a></li>
<li><a class="reference internal" href="#ip-filter" id="id133">ip_filter</a><ul>
<li><a class="reference internal" href="#id8" id="id134">ip_filter()</a></li>
<li><a class="reference internal" href="#add-rule" id="id135">add_rule()</a></li>
<li><a class="reference internal" href="#access" id="id136">access()</a></li>
<li><a class="reference internal" href="#export-filter" id="id137">export_filter()</a></li>
<li><a class="reference internal" href="#pe-settings" id="id132">pe_settings</a></li>
<li><a class="reference internal" href="#proxy-settings" id="id133">proxy_settings</a></li>
<li><a class="reference internal" href="#ip-filter" id="id134">ip_filter</a><ul>
<li><a class="reference internal" href="#id8" id="id135">ip_filter()</a></li>
<li><a class="reference internal" href="#add-rule" id="id136">add_rule()</a></li>
<li><a class="reference internal" href="#access" id="id137">access()</a></li>
<li><a class="reference internal" href="#export-filter" id="id138">export_filter()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#big-number" id="id138">big_number</a></li>
<li><a class="reference internal" href="#bitfield" id="id139">bitfield</a></li>
<li><a class="reference internal" href="#hasher" id="id140">hasher</a></li>
<li><a class="reference internal" href="#fingerprint" id="id141">fingerprint</a></li>
<li><a class="reference internal" href="#upnp-and-nat-pmp" id="id142">UPnP and NAT-PMP</a><ul>
<li><a class="reference internal" href="#add-mapping" id="id143">add_mapping()</a></li>
<li><a class="reference internal" href="#delete-mapping" id="id144">delete_mapping()</a></li>
<li><a class="reference internal" href="#router-model" id="id145">router_model()</a></li>
<li><a class="reference internal" href="#big-number" id="id139">big_number</a></li>
<li><a class="reference internal" href="#bitfield" id="id140">bitfield</a></li>
<li><a class="reference internal" href="#hasher" id="id141">hasher</a></li>
<li><a class="reference internal" href="#fingerprint" id="id142">fingerprint</a></li>
<li><a class="reference internal" href="#upnp-and-nat-pmp" id="id143">UPnP and NAT-PMP</a><ul>
<li><a class="reference internal" href="#add-mapping" id="id144">add_mapping()</a></li>
<li><a class="reference internal" href="#delete-mapping" id="id145">delete_mapping()</a></li>
<li><a class="reference internal" href="#router-model" id="id146">router_model()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#free-functions" id="id146">free functions</a><ul>
<li><a class="reference internal" href="#identify-client" id="id147">identify_client()</a></li>
<li><a class="reference internal" href="#client-fingerprint" id="id148">client_fingerprint()</a></li>
<li><a class="reference internal" href="#lazy-bdecode" id="id149">lazy_bdecode()</a></li>
<li><a class="reference internal" href="#bdecode-bencode" id="id150">bdecode() bencode()</a></li>
<li><a class="reference internal" href="#add-magnet-uri" id="id151">add_magnet_uri()</a></li>
<li><a class="reference internal" href="#make-magnet-uri" id="id152">make_magnet_uri()</a></li>
<li><a class="reference internal" href="#free-functions" id="id147">free functions</a><ul>
<li><a class="reference internal" href="#identify-client" id="id148">identify_client()</a></li>
<li><a class="reference internal" href="#client-fingerprint" id="id149">client_fingerprint()</a></li>
<li><a class="reference internal" href="#lazy-bdecode" id="id150">lazy_bdecode()</a></li>
<li><a class="reference internal" href="#bdecode-bencode" id="id151">bdecode() bencode()</a></li>
<li><a class="reference internal" href="#add-magnet-uri" id="id152">add_magnet_uri()</a></li>
<li><a class="reference internal" href="#make-magnet-uri" id="id153">make_magnet_uri()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#alerts" id="id153">alerts</a><ul>
<li><a class="reference internal" href="#torrent-added-alert" id="id154">torrent_added_alert</a></li>
<li><a class="reference internal" href="#torrent-removed-alert" id="id155">torrent_removed_alert</a></li>
<li><a class="reference internal" href="#read-piece-alert" id="id156">read_piece_alert</a></li>
<li><a class="reference internal" href="#external-ip-alert" id="id157">external_ip_alert</a></li>
<li><a class="reference internal" href="#listen-failed-alert" id="id158">listen_failed_alert</a></li>
<li><a class="reference internal" href="#listen-succeeded-alert" id="id159">listen_succeeded_alert</a></li>
<li><a class="reference internal" href="#portmap-error-alert" id="id160">portmap_error_alert</a></li>
<li><a class="reference internal" href="#portmap-alert" id="id161">portmap_alert</a></li>
<li><a class="reference internal" href="#portmap-log-alert" id="id162">portmap_log_alert</a></li>
<li><a class="reference internal" href="#file-error-alert" id="id163">file_error_alert</a></li>
<li><a class="reference internal" href="#torrent-error-alert" id="id164">torrent_error_alert</a></li>
<li><a class="reference internal" href="#file-renamed-alert" id="id165">file_renamed_alert</a></li>
<li><a class="reference internal" href="#file-rename-failed-alert" id="id166">file_rename_failed_alert</a></li>
<li><a class="reference internal" href="#tracker-announce-alert" id="id167">tracker_announce_alert</a></li>
<li><a class="reference internal" href="#tracker-error-alert" id="id168">tracker_error_alert</a></li>
<li><a class="reference internal" href="#tracker-reply-alert" id="id169">tracker_reply_alert</a></li>
<li><a class="reference internal" href="#tracker-warning-alert" id="id170">tracker_warning_alert</a></li>
<li><a class="reference internal" href="#scrape-reply-alert" id="id171">scrape_reply_alert</a></li>
<li><a class="reference internal" href="#scrape-failed-alert" id="id172">scrape_failed_alert</a></li>
<li><a class="reference internal" href="#url-seed-alert" id="id173">url_seed_alert</a></li>
<li><a class="reference internal" href="#hash-failed-alert" id="id174">hash_failed_alert</a></li>
<li><a class="reference internal" href="#peer-alert" id="id175">peer_alert</a></li>
<li><a class="reference internal" href="#peer-connect-alert" id="id176">peer_connect_alert</a></li>
<li><a class="reference internal" href="#peer-ban-alert" id="id177">peer_ban_alert</a></li>
<li><a class="reference internal" href="#peer-snubbed-alert" id="id178">peer_snubbed_alert</a></li>
<li><a class="reference internal" href="#peer-unsnubbed-alert" id="id179">peer_unsnubbed_alert</a></li>
<li><a class="reference internal" href="#peer-error-alert" id="id180">peer_error_alert</a></li>
<li><a class="reference internal" href="#peer-connected-alert" id="id181">peer_connected_alert</a></li>
<li><a class="reference internal" href="#peer-disconnected-alert" id="id182">peer_disconnected_alert</a></li>
<li><a class="reference internal" href="#invalid-request-alert" id="id183">invalid_request_alert</a></li>
<li><a class="reference internal" href="#request-dropped-alert" id="id184">request_dropped_alert</a></li>
<li><a class="reference internal" href="#block-timeout-alert" id="id185">block_timeout_alert</a></li>
<li><a class="reference internal" href="#block-finished-alert" id="id186">block_finished_alert</a></li>
<li><a class="reference internal" href="#lsd-peer-alert" id="id187">lsd_peer_alert</a></li>
<li><a class="reference internal" href="#file-completed-alert" id="id188">file_completed_alert</a></li>
<li><a class="reference internal" href="#block-downloading-alert" id="id189">block_downloading_alert</a></li>
<li><a class="reference internal" href="#unwanted-block-alert" id="id190">unwanted_block_alert</a></li>
<li><a class="reference internal" href="#torrent-delete-failed-alert" id="id191">torrent_delete_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-deleted-alert" id="id192">torrent_deleted_alert</a></li>
<li><a class="reference internal" href="#torrent-finished-alert" id="id193">torrent_finished_alert</a></li>
<li><a class="reference internal" href="#performance-alert" id="id194">performance_alert</a></li>
<li><a class="reference internal" href="#state-changed-alert" id="id195">state_changed_alert</a></li>
<li><a class="reference internal" href="#metadata-failed-alert" id="id196">metadata_failed_alert</a></li>
<li><a class="reference internal" href="#metadata-received-alert" id="id197">metadata_received_alert</a></li>
<li><a class="reference internal" href="#fastresume-rejected-alert" id="id198">fastresume_rejected_alert</a></li>
<li><a class="reference internal" href="#peer-blocked-alert" id="id199">peer_blocked_alert</a></li>
<li><a class="reference internal" href="#storage-moved-alert" id="id200">storage_moved_alert</a></li>
<li><a class="reference internal" href="#storage-moved-failed-alert" id="id201">storage_moved_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-paused-alert" id="id202">torrent_paused_alert</a></li>
<li><a class="reference internal" href="#torrent-resumed-alert" id="id203">torrent_resumed_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-alert" id="id204">save_resume_data_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-failed-alert" id="id205">save_resume_data_failed_alert</a></li>
<li><a class="reference internal" href="#stats-alert" id="id206">stats_alert</a></li>
<li><a class="reference internal" href="#cache-flushed-alert" id="id207">cache_flushed_alert</a></li>
<li><a class="reference internal" href="#dht-announce-alert" id="id208">dht_announce_alert</a></li>
<li><a class="reference internal" href="#dht-get-peers-alert" id="id209">dht_get_peers_alert</a></li>
<li><a class="reference internal" href="#dht-reply-alert" id="id210">dht_reply_alert</a></li>
<li><a class="reference internal" href="#dht-bootstrap-alert" id="id211">dht_bootstrap_alert</a></li>
<li><a class="reference internal" href="#anonymous-mode-alert" id="id212">anonymous_mode_alert</a></li>
<li><a class="reference internal" href="#rss-alert" id="id213">rss_alert</a></li>
<li><a class="reference internal" href="#alerts" id="id154">alerts</a><ul>
<li><a class="reference internal" href="#torrent-added-alert" id="id155">torrent_added_alert</a></li>
<li><a class="reference internal" href="#torrent-removed-alert" id="id156">torrent_removed_alert</a></li>
<li><a class="reference internal" href="#read-piece-alert" id="id157">read_piece_alert</a></li>
<li><a class="reference internal" href="#external-ip-alert" id="id158">external_ip_alert</a></li>
<li><a class="reference internal" href="#listen-failed-alert" id="id159">listen_failed_alert</a></li>
<li><a class="reference internal" href="#listen-succeeded-alert" id="id160">listen_succeeded_alert</a></li>
<li><a class="reference internal" href="#portmap-error-alert" id="id161">portmap_error_alert</a></li>
<li><a class="reference internal" href="#portmap-alert" id="id162">portmap_alert</a></li>
<li><a class="reference internal" href="#portmap-log-alert" id="id163">portmap_log_alert</a></li>
<li><a class="reference internal" href="#file-error-alert" id="id164">file_error_alert</a></li>
<li><a class="reference internal" href="#torrent-error-alert" id="id165">torrent_error_alert</a></li>
<li><a class="reference internal" href="#file-renamed-alert" id="id166">file_renamed_alert</a></li>
<li><a class="reference internal" href="#file-rename-failed-alert" id="id167">file_rename_failed_alert</a></li>
<li><a class="reference internal" href="#tracker-announce-alert" id="id168">tracker_announce_alert</a></li>
<li><a class="reference internal" href="#tracker-error-alert" id="id169">tracker_error_alert</a></li>
<li><a class="reference internal" href="#tracker-reply-alert" id="id170">tracker_reply_alert</a></li>
<li><a class="reference internal" href="#tracker-warning-alert" id="id171">tracker_warning_alert</a></li>
<li><a class="reference internal" href="#scrape-reply-alert" id="id172">scrape_reply_alert</a></li>
<li><a class="reference internal" href="#scrape-failed-alert" id="id173">scrape_failed_alert</a></li>
<li><a class="reference internal" href="#url-seed-alert" id="id174">url_seed_alert</a></li>
<li><a class="reference internal" href="#hash-failed-alert" id="id175">hash_failed_alert</a></li>
<li><a class="reference internal" href="#peer-alert" id="id176">peer_alert</a></li>
<li><a class="reference internal" href="#peer-connect-alert" id="id177">peer_connect_alert</a></li>
<li><a class="reference internal" href="#peer-ban-alert" id="id178">peer_ban_alert</a></li>
<li><a class="reference internal" href="#peer-snubbed-alert" id="id179">peer_snubbed_alert</a></li>
<li><a class="reference internal" href="#peer-unsnubbed-alert" id="id180">peer_unsnubbed_alert</a></li>
<li><a class="reference internal" href="#peer-error-alert" id="id181">peer_error_alert</a></li>
<li><a class="reference internal" href="#peer-connected-alert" id="id182">peer_connected_alert</a></li>
<li><a class="reference internal" href="#peer-disconnected-alert" id="id183">peer_disconnected_alert</a></li>
<li><a class="reference internal" href="#invalid-request-alert" id="id184">invalid_request_alert</a></li>
<li><a class="reference internal" href="#request-dropped-alert" id="id185">request_dropped_alert</a></li>
<li><a class="reference internal" href="#block-timeout-alert" id="id186">block_timeout_alert</a></li>
<li><a class="reference internal" href="#block-finished-alert" id="id187">block_finished_alert</a></li>
<li><a class="reference internal" href="#lsd-peer-alert" id="id188">lsd_peer_alert</a></li>
<li><a class="reference internal" href="#file-completed-alert" id="id189">file_completed_alert</a></li>
<li><a class="reference internal" href="#block-downloading-alert" id="id190">block_downloading_alert</a></li>
<li><a class="reference internal" href="#unwanted-block-alert" id="id191">unwanted_block_alert</a></li>
<li><a class="reference internal" href="#torrent-delete-failed-alert" id="id192">torrent_delete_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-deleted-alert" id="id193">torrent_deleted_alert</a></li>
<li><a class="reference internal" href="#torrent-finished-alert" id="id194">torrent_finished_alert</a></li>
<li><a class="reference internal" href="#performance-alert" id="id195">performance_alert</a></li>
<li><a class="reference internal" href="#state-changed-alert" id="id196">state_changed_alert</a></li>
<li><a class="reference internal" href="#metadata-failed-alert" id="id197">metadata_failed_alert</a></li>
<li><a class="reference internal" href="#metadata-received-alert" id="id198">metadata_received_alert</a></li>
<li><a class="reference internal" href="#fastresume-rejected-alert" id="id199">fastresume_rejected_alert</a></li>
<li><a class="reference internal" href="#peer-blocked-alert" id="id200">peer_blocked_alert</a></li>
<li><a class="reference internal" href="#storage-moved-alert" id="id201">storage_moved_alert</a></li>
<li><a class="reference internal" href="#storage-moved-failed-alert" id="id202">storage_moved_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-paused-alert" id="id203">torrent_paused_alert</a></li>
<li><a class="reference internal" href="#torrent-resumed-alert" id="id204">torrent_resumed_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-alert" id="id205">save_resume_data_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-failed-alert" id="id206">save_resume_data_failed_alert</a></li>
<li><a class="reference internal" href="#stats-alert" id="id207">stats_alert</a></li>
<li><a class="reference internal" href="#cache-flushed-alert" id="id208">cache_flushed_alert</a></li>
<li><a class="reference internal" href="#torrent-need-cert-alert" id="id209">torrent_need_cert_alert</a></li>
<li><a class="reference internal" href="#dht-announce-alert" id="id210">dht_announce_alert</a></li>
<li><a class="reference internal" href="#dht-get-peers-alert" id="id211">dht_get_peers_alert</a></li>
<li><a class="reference internal" href="#dht-reply-alert" id="id212">dht_reply_alert</a></li>
<li><a class="reference internal" href="#dht-bootstrap-alert" id="id213">dht_bootstrap_alert</a></li>
<li><a class="reference internal" href="#anonymous-mode-alert" id="id214">anonymous_mode_alert</a></li>
<li><a class="reference internal" href="#rss-alert" id="id215">rss_alert</a></li>
<li><a class="reference internal" href="#incoming-connection-alert" id="id216">incoming_connection_alert</a></li>
</ul>
</li>
<li><a class="reference internal" href="#alert-dispatcher" id="id214">alert dispatcher</a></li>
<li><a class="reference internal" href="#exceptions" id="id215">exceptions</a><ul>
<li><a class="reference internal" href="#libtorrent-exception" id="id216">libtorrent_exception</a></li>
<li><a class="reference internal" href="#alert-dispatcher" id="id217">alert dispatcher</a></li>
<li><a class="reference internal" href="#exceptions" id="id218">exceptions</a><ul>
<li><a class="reference internal" href="#libtorrent-exception" id="id219">libtorrent_exception</a></li>
</ul>
</li>
<li><a class="reference internal" href="#error-code" id="id217">error_code</a><ul>
<li><a class="reference internal" href="#translating-error-codes" id="id218">translating error codes</a></li>
<li><a class="reference internal" href="#error-code" id="id220">error_code</a><ul>
<li><a class="reference internal" href="#translating-error-codes" id="id221">translating error codes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#storage-interface" id="id219">storage_interface</a><ul>
<li><a class="reference internal" href="#initialize" id="id220">initialize()</a></li>
<li><a class="reference internal" href="#has-any-file" id="id221">has_any_file()</a></li>
<li><a class="reference internal" href="#hint-read" id="id222">hint_read()</a></li>
<li><a class="reference internal" href="#readv-writev" id="id223">readv() writev()</a></li>
<li><a class="reference internal" href="#sparse-end" id="id224">sparse_end()</a></li>
<li><a class="reference internal" href="#id10" id="id225">move_storage()</a></li>
<li><a class="reference internal" href="#verify-resume-data" id="id226">verify_resume_data()</a></li>
<li><a class="reference internal" href="#write-resume-data" id="id227">write_resume_data()</a></li>
<li><a class="reference internal" href="#move-slot" id="id228">move_slot()</a></li>
<li><a class="reference internal" href="#swap-slots" id="id229">swap_slots()</a></li>
<li><a class="reference internal" href="#swap-slots3" id="id230">swap_slots3()</a></li>
<li><a class="reference internal" href="#id11" id="id231">rename_file()</a></li>
<li><a class="reference internal" href="#release-files" id="id232">release_files()</a></li>
<li><a class="reference internal" href="#delete-files" id="id233">delete_files()</a></li>
<li><a class="reference internal" href="#finalize-file" id="id234">finalize_file()</a></li>
<li><a class="reference internal" href="#example" id="id235">example</a></li>
<li><a class="reference internal" href="#storage-interface" id="id222">storage_interface</a><ul>
<li><a class="reference internal" href="#initialize" id="id223">initialize()</a></li>
<li><a class="reference internal" href="#has-any-file" id="id224">has_any_file()</a></li>
<li><a class="reference internal" href="#hint-read" id="id225">hint_read()</a></li>
<li><a class="reference internal" href="#readv-writev" id="id226">readv() writev()</a></li>
<li><a class="reference internal" href="#sparse-end" id="id227">sparse_end()</a></li>
<li><a class="reference internal" href="#id10" id="id228">move_storage()</a></li>
<li><a class="reference internal" href="#verify-resume-data" id="id229">verify_resume_data()</a></li>
<li><a class="reference internal" href="#write-resume-data" id="id230">write_resume_data()</a></li>
<li><a class="reference internal" href="#move-slot" id="id231">move_slot()</a></li>
<li><a class="reference internal" href="#swap-slots" id="id232">swap_slots()</a></li>
<li><a class="reference internal" href="#swap-slots3" id="id233">swap_slots3()</a></li>
<li><a class="reference internal" href="#id11" id="id234">rename_file()</a></li>
<li><a class="reference internal" href="#release-files" id="id235">release_files()</a></li>
<li><a class="reference internal" href="#delete-files" id="id236">delete_files()</a></li>
<li><a class="reference internal" href="#finalize-file" id="id237">finalize_file()</a></li>
<li><a class="reference internal" href="#example" id="id238">example</a></li>
</ul>
</li>
<li><a class="reference internal" href="#magnet-links" id="id236">magnet links</a></li>
<li><a class="reference internal" href="#queuing" id="id237">queuing</a><ul>
<li><a class="reference internal" href="#downloading" id="id238">downloading</a></li>
<li><a class="reference internal" href="#seeding" id="id239">seeding</a></li>
<li><a class="reference internal" href="#magnet-links" id="id239">magnet links</a></li>
<li><a class="reference internal" href="#queuing" id="id240">queuing</a><ul>
<li><a class="reference internal" href="#downloading" id="id241">downloading</a></li>
<li><a class="reference internal" href="#seeding" id="id242">seeding</a></li>
</ul>
</li>
<li><a class="reference internal" href="#fast-resume" id="id240">fast resume</a><ul>
<li><a class="reference internal" href="#file-format" id="id241">file format</a></li>
<li><a class="reference internal" href="#fast-resume" id="id243">fast resume</a><ul>
<li><a class="reference internal" href="#file-format" id="id244">file format</a></li>
</ul>
</li>
<li><a class="reference internal" href="#threads" id="id242">threads</a></li>
<li><a class="reference internal" href="#storage-allocation" id="id243">storage allocation</a><ul>
<li><a class="reference internal" href="#sparse-allocation" id="id244">sparse allocation</a></li>
<li><a class="reference internal" href="#full-allocation" id="id245">full allocation</a></li>
<li><a class="reference internal" href="#compact-allocation" id="id246">compact allocation</a></li>
<li><a class="reference internal" href="#threads" id="id245">threads</a></li>
<li><a class="reference internal" href="#storage-allocation" id="id246">storage allocation</a><ul>
<li><a class="reference internal" href="#sparse-allocation" id="id247">sparse allocation</a></li>
<li><a class="reference internal" href="#full-allocation" id="id248">full allocation</a></li>
<li><a class="reference internal" href="#compact-allocation" id="id249">compact allocation</a></li>
</ul>
</li>
<li><a class="reference internal" href="#extensions" id="id247">extensions</a><ul>
<li><a class="reference internal" href="#metadata-from-peers" id="id248">metadata from peers</a></li>
<li><a class="reference internal" href="#dont-have" id="id249">dont_have</a></li>
<li><a class="reference internal" href="#http-seeding" id="id250">HTTP seeding</a></li>
<li><a class="reference internal" href="#extensions" id="id250">extensions</a><ul>
<li><a class="reference internal" href="#metadata-from-peers" id="id251">metadata from peers</a></li>
<li><a class="reference internal" href="#dont-have" id="id252">dont_have</a></li>
<li><a class="reference internal" href="#http-seeding" id="id253">HTTP seeding</a></li>
</ul>
</li>
<li><a class="reference internal" href="#piece-picker" id="id251">piece picker</a><ul>
<li><a class="reference internal" href="#internal-representation" id="id252">internal representation</a></li>
<li><a class="reference internal" href="#picker-strategy" id="id253">picker strategy</a></li>
<li><a class="reference internal" href="#reverse-order" id="id254">reverse order</a></li>
<li><a class="reference internal" href="#parole-mode" id="id255">parole mode</a></li>
<li><a class="reference internal" href="#prioritize-partial-pieces" id="id256">prioritize partial pieces</a></li>
<li><a class="reference internal" href="#prefer-whole-pieces" id="id257">prefer whole pieces</a></li>
<li><a class="reference internal" href="#piece-picker" id="id254">piece picker</a><ul>
<li><a class="reference internal" href="#internal-representation" id="id255">internal representation</a></li>
<li><a class="reference internal" href="#picker-strategy" id="id256">picker strategy</a></li>
<li><a class="reference internal" href="#reverse-order" id="id257">reverse order</a></li>
<li><a class="reference internal" href="#parole-mode" id="id258">parole mode</a></li>
<li><a class="reference internal" href="#prioritize-partial-pieces" id="id259">prioritize partial pieces</a></li>
<li><a class="reference internal" href="#prefer-whole-pieces" id="id260">prefer whole pieces</a></li>
</ul>
</li>
<li><a class="reference internal" href="#filename-checks" id="id258">filename checks</a></li>
<li><a class="reference internal" href="#ssl-torrents" id="id261">SSL torrents</a></li>
<li><a class="reference internal" href="#filename-checks" id="id262">filename checks</a></li>
</ul>
</div>
<div class="section" id="overview">
@ -771,7 +775,8 @@ will be used. This is the recommended, and default mode.</dd>
allocated in full when the torrent is first started. This is done with
<tt class="docutils literal"><span class="pre">fallocate()</span></tt> and similar calls. This mode minimizes fragmentation.</dd>
<dt>storage_mode_compact</dt>
<dd>The storage will grow as more pieces are downloaded, and pieces
<dd><strong>this mode is deprecated and will be removed in future versions of libtorrent</strong>
The storage will grow as more pieces are downloaded, and pieces
are rearranged to finally be in their correct places once the entire torrent has been
downloaded.</dd>
</dl>
@ -2420,6 +2425,11 @@ struct torrent_handle
sha1_hash info_hash() const;
void set_ssl_certificate(std::string const&amp; cert
, std::string const&amp; private_key
, std::string const&amp; dh_params
, std::string const&amp; passphrase = &quot;&quot;);
bool operator==(torrent_handle const&amp;) const;
bool operator!=(torrent_handle const&amp;) const;
bool operator&lt;(torrent_handle const&amp;) const;
@ -3360,6 +3370,30 @@ somehow invalid or if the filenames are not allowed (and hence cannot be opened/
your filesystem. If such an error occurs, a <a class="reference internal" href="#file-error-alert">file_error_alert</a> is generated and all handles
that refers to that torrent will become invalid.</p>
</div>
<div class="section" id="set-ssl-certificate">
<h2>set_ssl_certificate()</h2>
<blockquote>
<pre class="literal-block">
void set_ssl_certificate(std::string const&amp; cert, std::string const&amp; private_key
, std::string const&amp; dh_params, std::string const&amp; passphrase = &quot;&quot;);
</pre>
</blockquote>
<p>For SSL torrents, use this to specify a path to a .pem file to use as this client's certificate.
The certificate must be signed by the certificate in the .torrent file to be valid.</p>
<p><tt class="docutils literal"><span class="pre">cert</span></tt> is a path to the (signed) certificate in .pem format corresponding to this torrent.</p>
<p><tt class="docutils literal"><span class="pre">private_key</span></tt> is a path to the private key for the specified certificate. This must be in .pem
format.</p>
<p><tt class="docutils literal"><span class="pre">dh_params</span></tt> is a path to the Diffie-Hellman parameter file, which needs to be in .pem format.
You can generate this file using the openssl command like this:
<tt class="docutils literal"><span class="pre">openssl</span> <span class="pre">dhparam</span> <span class="pre">-outform</span> <span class="pre">PEM</span> <span class="pre">-out</span> <span class="pre">dhparams.pem</span> <span class="pre">512</span></tt>.</p>
<p><tt class="docutils literal"><span class="pre">passphrase</span></tt> may be specified if the private key is encrypted and requires a passphrase to
be decrypted.</p>
<p>Note that when a torrent first starts up, and it needs a certificate, it will suspend connecting
to any peers until it has one. It's typically desirable to resume the torrent after setting the
ssl certificate.</p>
<p>If you receive a <a class="reference internal" href="#torrent-need-cert-alert">torrent_need_cert_alert</a>, you need to call this to provide a valid cert. If you
don't have a cert you won't be allowed to connect to any peers.</p>
</div>
</div>
<div class="section" id="torrent-status">
<h1>torrent_status</h1>
@ -3482,6 +3516,8 @@ struct torrent_status
bool ip_filter_applies;
sha1_hash info_hash;
int listen_port;
};
</pre>
<p><tt class="docutils literal"><span class="pre">handle</span></tt> is a handle to the torrent whose status the object represents.</p>
@ -3715,6 +3751,10 @@ was saved.</p>
<p><tt class="docutils literal"><span class="pre">ip_filter_applies</span></tt> is true if the session global IP filter applies
to this torrent. This defaults to true.</p>
<p><tt class="docutils literal"><span class="pre">info_hash</span></tt> is the info-hash of the torrent.</p>
<p><tt class="docutils literal"><span class="pre">listen_port</span></tt> is the listen port this torrent is listening on for new
connections, if the torrent has its own listen socket. Only SSL torrents
have their own listen sockets. If the torrent doesn't have one, and is
accepting connections on the single listen socket, this is 0.</p>
</div>
<div class="section" id="peer-info">
<h1>peer_info</h1>
@ -3756,7 +3796,8 @@ struct peer_info
int source;
enum bw_state { bw_idle, bw_limit, bw_network, bw_disk };
// bitmask representing socket state
enum bw_state { bw_idle = 0, bw_limit = 1, bw_network = 2, bw_disk = 4 };
char read_state;
char write_state;
@ -3947,9 +3988,9 @@ discovery (The peer is on the local network).</td>
</tr>
</tbody>
</table>
<p><tt class="docutils literal"><span class="pre">read_state</span></tt> and <tt class="docutils literal"><span class="pre">write_state</span></tt> indicates what state this peer is in with regards
to sending and receiving data. The states are declared in the <tt class="docutils literal"><span class="pre">bw_state</span></tt> enum and
defines as follows:</p>
<p><tt class="docutils literal"><span class="pre">read_state</span></tt> and <tt class="docutils literal"><span class="pre">write_state</span></tt> are bitmasks indicating what state this peer
is in with regards to sending and receiving data. The states are declared in the
<tt class="docutils literal"><span class="pre">bw_state</span></tt> enum and defines as follows:</p>
<table border="1" class="docutils">
<colgroup>
<col width="30%" />
@ -3975,6 +4016,9 @@ up writing buffers to disk before downloading more.</td>
</tr>
</tbody>
</table>
<p>Note that <tt class="docutils literal"><span class="pre">read_state</span></tt> and <tt class="docutils literal"><span class="pre">write_state</span></tt> are bitmasks. A peer may be waiting
on disk and on the network at the same time. <tt class="docutils literal"><span class="pre">bw_idle</span></tt> does not represent a bit,
but is simply a name for no bit being set in the bitmask.</p>
<p>The <tt class="docutils literal"><span class="pre">ip</span></tt> field is the IP-address to this peer. The type is an asio endpoint. For
more info, see the <a class="reference external" href="http://asio.sf.net">asio</a> documentation.</p>
<p><tt class="docutils literal"><span class="pre">up_speed</span></tt> and <tt class="docutils literal"><span class="pre">down_speed</span></tt> contains the current upload and download speed
@ -4622,10 +4666,12 @@ onto it. If set too small, upload rate capacity will suffer. If set too high,
memory will be wasted. The actual watermark may be lower than this in case
the upload rate is low, this is the upper limit.</p>
<p><tt class="docutils literal"><span class="pre">send_buffer_watermark_factor</span></tt> is multiplied to the peer's upload rate
to determine the low-watermark for the peer. This is clamped to not
exceed the <tt class="docutils literal"><span class="pre">send_buffer_watermark</span></tt> upper limit. This defaults to 1.
For high capacity connections, setting this higher can improve upload
performance and disk throughput.</p>
to determine the low-watermark for the peer. It is specified as a percentage,
which means 100 represents a factor of 1.
The low-watermark is still clamped to not exceed the <tt class="docutils literal"><span class="pre">send_buffer_watermark</span></tt>
upper limit. This defaults to 50. For high capacity connections, setting this
higher can improve upload performance and disk throughput. Setting it too
high may waste RAM and create a bias towards read jobs over write jobs.</p>
<p><tt class="docutils literal"><span class="pre">auto_upload_slots</span></tt> defaults to true. When true, if there is a global upload
limit set and the current upload rate is less than 90% of that, another upload
slot is opened. If the upload rate has been saturated for an extended period
@ -6373,7 +6419,7 @@ struct peer_disconnected_alert: peer_alert
<div class="section" id="invalid-request-alert">
<h2>invalid_request_alert</h2>
<p>This is a debug alert that is generated by an incoming invalid piece request.
<tt class="docutils literal"><span class="pre">ìp</span></tt> is the address of the peer and the <tt class="docutils literal"><span class="pre">request</span></tt> is the actual incoming
<tt class="docutils literal"><span class="pre">Ïp</span></tt> is the address of the peer and the <tt class="docutils literal"><span class="pre">request</span></tt> is the actual incoming
request from the peer.</p>
<pre class="literal-block">
struct invalid_request_alert: peer_alert
@ -6584,7 +6630,7 @@ send it all before the disk gets back to us.
The number of bytes that we keep outstanding, requested from the disk, is calculated
as follows:</p>
<pre class="literal-block">
min(512, max(upload_rate * send_buffer_watermark_factor, send_buffer_watermark))
min(512, max(upload_rate * send_buffer_watermark_factor / 100, send_buffer_watermark))
</pre>
<p class="last">If you receive this alert, you migth want to either increase your <tt class="docutils literal"><span class="pre">send_buffer_watermark</span></tt>
or <tt class="docutils literal"><span class="pre">send_buffer_watermark_factor</span></tt>.</p>
@ -6766,6 +6812,19 @@ struct flush_cached_alert: torrent_alert
};
</pre>
</div>
<div class="section" id="torrent-need-cert-alert">
<h2>torrent_need_cert_alert</h2>
<p>This is always posted for SSL torrents. This is a reminder to the client that
the torrent won't work unless torrent_handle::set_ssl_certificate() is called with
a valid certificate. Valid certificates MUST be signed by the SSL certificate
in the .torrent file.</p>
<pre class="literal-block">
struct torrent_need_cert_alert: tracker_alert
{
// ...
};
</pre>
</div>
<div class="section" id="dht-announce-alert">
<h2>dht_announce_alert</h2>
<p>This alert is generated when a DHT node announces to an info-hash on our DHT node. It belongs
@ -6881,6 +6940,51 @@ what went wrong.</dd>
</dl>
<p><tt class="docutils literal"><span class="pre">error</span></tt> is an error code used for when an error occurs on the feed.</p>
</div>
<div class="section" id="incoming-connection-alert">
<h2>incoming_connection_alert</h2>
<p>The incoming connection alert is posted every time we successfully accept
an incoming connection, through any mean. The most straigh-forward ways
of accepting incoming connections are through the TCP listen socket and
the UDP listen socket for uTP sockets. However, connections may also be
accepted ofer a Socks5 or i2p listen socket, or via a torrent specific
listen socket for SSL torrents.</p>
<pre class="literal-block">
struct incoming_connection_alert: alert
{
// ...
virtual std::string message() const;
int socket_type;
tcp::endpoint ip;
};
</pre>
<p><tt class="docutils literal"><span class="pre">socket_type</span></tt> tells you what kind of socket the connection was accepted
as:</p>
<p>+==========+=====================================+
| value | type |
+==========+=====================================+
| 0 | none (no socket instantiated) |
+----------+-------------------------------------+
| 1 | TCP |
+----------+-------------------------------------+
| 2 | Socks5 |
+----------+-------------------------------------+
| 3 | HTTP |
+----------+-------------------------------------+
| 4 | uTP |
+----------+-------------------------------------+
| 5 | i2p |
+----------+-------------------------------------+
| 6 | SSL/TCP |
+----------+-------------------------------------+
| 7 | SSL/Socks5 |
+----------+-------------------------------------+
| 8 | HTTPS (SSL/HTTP) |
+----------+-------------------------------------+
| 9 | SSL/uTP |
+----------+-------------------------------------+</p>
<p><tt class="docutils literal"><span class="pre">ip</span></tt> is the IP address and port the connection came from.</p>
</div>
</div>
<div class="section" id="alert-dispatcher">
<h1>alert dispatcher</h1>
@ -7830,13 +7934,13 @@ std::string error_code_to_string(boost::system::error_code const&amp; ec)
static const char const* swedish[] =
{
&quot;inget fel&quot;,
&quot;en fil i torrenten kolliderar med en fil från en annan torrent&quot;,
&quot;en fil i torrenten kolliderar med en fil frÂn en annan torrent&quot;,
&quot;hash check misslyckades&quot;,
&quot;torrent filen är inte en dictionary&quot;,
&quot;'info'-nyckeln saknas eller är korrupt i torrentfilen&quot;,
&quot;'info'-fältet är inte en dictionary&quot;,
&quot;'piece length' fältet saknas eller är korrupt i torrentfilen&quot;,
&quot;torrentfilen saknar namnfältet&quot;,
&quot;torrent filen r inte en dictionary&quot;,
&quot;'info'-nyckeln saknas eller r korrupt i torrentfilen&quot;,
&quot;'info'-f‰ltet ‰r inte en dictionary&quot;,
&quot;'piece length' f‰ltet saknas eller ‰r korrupt i torrentfilen&quot;,
&quot;torrentfilen saknar namnfltet&quot;,
&quot;ogiltigt namn i torrentfilen (kan vara en attack)&quot;,
// ... more strings here
};
@ -8473,18 +8577,19 @@ non-blocking host name resolution to simulate non-blocking getaddrinfo().</li>
</div>
<div class="section" id="storage-allocation">
<h1>storage allocation</h1>
<p>There are three modes in which storage (files on disk) are allocated in libtorrent.</p>
<p>There are two modes in which storage (files on disk) are allocated in libtorrent.</p>
<ol class="arabic simple">
<li>The traditional <em>full allocation</em> mode, where the entire files are filled up with
zeros before anything is downloaded. libtorrent will look for sparse files support
in the filesystem that is used for storage, and use sparse files or file system
zero fill support if present. This means that on NTFS, full allocation mode will
only allocate storage for the downloaded pieces.</li>
<li>The <em>compact allocation</em> mode, where only files are allocated for actual
pieces that have been downloaded.</li>
<li>The <em>sparse allocation</em>, sparse files are used, and pieces are downloaded directly
to where they belong. This is the recommended (and default) mode.</li>
</ol>
<p>In previous versions of libtorrent, a 3rd mode was supported, <em>compact allocation</em>.
Support for this is deprecated and will be removed in future versions of libtorrent.
It's still described in here for completeness.</p>
<p>The allocation mode is selected when a torrent is started. It is passed as an
argument to <tt class="docutils literal"><span class="pre">session::add_torrent()</span></tt> (see <a class="reference internal" href="#add-torrent">add_torrent()</a>).</p>
<p>The decision to use full allocation or compact allocation typically depends on whether
@ -8535,6 +8640,8 @@ out of date data, since pieces won't move around.</li>
</div>
<div class="section" id="compact-allocation">
<h2>compact allocation</h2>
<p>Note that support for compact allocation is deprecated in libttorrent, and will
be removed in future versions.</p>
<p>The compact allocation will only allocate as much storage as it needs to keep the
pieces downloaded so far. This means that pieces will be moved around to be placed
at their final position in the files while downloading (to make sure the completed
@ -8861,6 +8968,35 @@ the same peer.</p>
<em>TODO: piece priorities</em></p>
</div>
</div>
<div class="section" id="ssl-torrents">
<h1>SSL torrents</h1>
<p>Torrents may have an SSL root (CA) certificate embedded in them. Such torrents
are called <em>SSL torrents</em>. An SSL torrent talks to all bittorrent peers over SSL.
The protocols are layered like this:</p>
<pre class="literal-block">
+-----------------------+
| BitTorrent protocol |
+-----------------------+
| SSL |
+-----------+-----------+
| TCP | uTP |
| +-----------+
| | UDP |
+-----------+-----------+
</pre>
<p>During the SSL handshake, both peers need to authenticate by providing a certificate
that is signed by the private counterpart of the CA certificate found in the
.torrent file. These peer certificates are expected to be privided to peers through
some other means than bittorrent. Typically by a peer generating a certificate request
which is sent to the publisher of the torrent, and the publisher returning a signed
certificate.</p>
<p>In libtorrent, <a class="reference internal" href="#set-ssl-certificate">set_ssl_certificate()</a> in <a class="reference internal" href="#torrent-handle">torrent_handle</a> is used to tell libtorrent where
to find the peer certificate and the private key for it. When an SSL torrent is loaded,
the <a class="reference internal" href="#torrent-need-cert-alert">torrent_need_cert_alert</a> is posted to remind the user to provide a certificate.</p>
<p>In order for the client to know which torrent an incoming connection belongs to, in order
to provide the correct certificate, each SSL torrent opens their own dedicated listen socket.</p>
<p>This feature is only available if libtorrent is build with openssl support (<tt class="docutils literal"><span class="pre">TORRENT_USE_OPENSSL</span></tt>).</p>
</div>
<div class="section" id="filename-checks">
<h1>filename checks</h1>
<p>Boost.Filesystem will by default check all its paths to make sure they conform