changed queuing logic

This commit is contained in:
Arvid Norberg 2008-06-13 05:11:36 +00:00
parent af477fa266
commit 7df5d4a9c6
3 changed files with 156 additions and 117 deletions

View File

@ -95,128 +95,130 @@
<li><a class="reference" href="#set-sequential-download" id="id79" name="id79">set_sequential_download()</a></li>
<li><a class="reference" href="#set-peer-upload-limit-set-peer-download-limit" id="id80" name="id80">set_peer_upload_limit() set_peer_download_limit()</a></li>
<li><a class="reference" href="#pause-resume-is-paused" id="id81" name="id81">pause() resume() is_paused()</a></li>
<li><a class="reference" href="#resolve-countries" id="id82" name="id82">resolve_countries()</a></li>
<li><a class="reference" href="#is-seed" id="id83" name="id83">is_seed()</a></li>
<li><a class="reference" href="#is-auto-managed-auto-managed" id="id84" name="id84">is_auto_managed() auto_managed()</a></li>
<li><a class="reference" href="#has-metadata" id="id85" name="id85">has_metadata()</a></li>
<li><a class="reference" href="#set-tracker-login" id="id86" name="id86">set_tracker_login()</a></li>
<li><a class="reference" href="#trackers-replace-trackers" id="id87" name="id87">trackers() replace_trackers()</a></li>
<li><a class="reference" href="#add-url-seed-remove-url-seed-url-seeds" id="id88" name="id88">add_url_seed() remove_url_seed() url_seeds()</a></li>
<li><a class="reference" href="#queue-position-queue-position-up-queue-position-down-queue-position-top-queue-position-bottom" id="id89" name="id89">queue_position() queue_position_up() queue_position_down() queue_position_top() queue_position_bottom()</a></li>
<li><a class="reference" href="#use-interface" id="id90" name="id90">use_interface()</a></li>
<li><a class="reference" href="#info-hash" id="id91" name="id91">info_hash()</a></li>
<li><a class="reference" href="#id5" id="id92" name="id92">set_max_uploads() set_max_connections()</a></li>
<li><a class="reference" href="#save-resume-data" id="id93" name="id93">save_resume_data()</a></li>
<li><a class="reference" href="#id6" id="id94" name="id94">status()</a></li>
<li><a class="reference" href="#get-download-queue" id="id95" name="id95">get_download_queue()</a></li>
<li><a class="reference" href="#get-peer-info" id="id96" name="id96">get_peer_info()</a></li>
<li><a class="reference" href="#get-torrent-info" id="id97" name="id97">get_torrent_info()</a></li>
<li><a class="reference" href="#is-valid" id="id98" name="id98">is_valid()</a></li>
<li><a class="reference" href="#force-recheck" id="id82" name="id82">force_recheck()</a></li>
<li><a class="reference" href="#resolve-countries" id="id83" name="id83">resolve_countries()</a></li>
<li><a class="reference" href="#is-seed" id="id84" name="id84">is_seed()</a></li>
<li><a class="reference" href="#is-auto-managed-auto-managed" id="id85" name="id85">is_auto_managed() auto_managed()</a></li>
<li><a class="reference" href="#has-metadata" id="id86" name="id86">has_metadata()</a></li>
<li><a class="reference" href="#set-tracker-login" id="id87" name="id87">set_tracker_login()</a></li>
<li><a class="reference" href="#trackers-replace-trackers" id="id88" name="id88">trackers() replace_trackers()</a></li>
<li><a class="reference" href="#add-url-seed-remove-url-seed-url-seeds" id="id89" name="id89">add_url_seed() remove_url_seed() url_seeds()</a></li>
<li><a class="reference" href="#queue-position-queue-position-up-queue-position-down-queue-position-top-queue-position-bottom" id="id90" name="id90">queue_position() queue_position_up() queue_position_down() queue_position_top() queue_position_bottom()</a></li>
<li><a class="reference" href="#use-interface" id="id91" name="id91">use_interface()</a></li>
<li><a class="reference" href="#info-hash" id="id92" name="id92">info_hash()</a></li>
<li><a class="reference" href="#id5" id="id93" name="id93">set_max_uploads() set_max_connections()</a></li>
<li><a class="reference" href="#save-resume-data" id="id94" name="id94">save_resume_data()</a></li>
<li><a class="reference" href="#id6" id="id95" name="id95">status()</a></li>
<li><a class="reference" href="#get-download-queue" id="id96" name="id96">get_download_queue()</a></li>
<li><a class="reference" href="#get-peer-info" id="id97" name="id97">get_peer_info()</a></li>
<li><a class="reference" href="#get-torrent-info" id="id98" name="id98">get_torrent_info()</a></li>
<li><a class="reference" href="#is-valid" id="id99" name="id99">is_valid()</a></li>
</ul>
</li>
<li><a class="reference" href="#torrent-status" id="id99" name="id99">torrent_status</a></li>
<li><a class="reference" href="#peer-info" id="id100" name="id100">peer_info</a></li>
<li><a class="reference" href="#session-settings" id="id101" name="id101">session_settings</a></li>
<li><a class="reference" href="#pe-settings" id="id102" name="id102">pe_settings</a></li>
<li><a class="reference" href="#proxy-settings" id="id103" name="id103">proxy_settings</a></li>
<li><a class="reference" href="#ip-filter" id="id104" name="id104">ip_filter</a><ul>
<li><a class="reference" href="#id9" id="id105" name="id105">ip_filter()</a></li>
<li><a class="reference" href="#add-rule" id="id106" name="id106">add_rule()</a></li>
<li><a class="reference" href="#access" id="id107" name="id107">access()</a></li>
<li><a class="reference" href="#export-filter" id="id108" name="id108">export_filter()</a></li>
<li><a class="reference" href="#torrent-status" id="id100" name="id100">torrent_status</a></li>
<li><a class="reference" href="#peer-info" id="id101" name="id101">peer_info</a></li>
<li><a class="reference" href="#session-settings" id="id102" name="id102">session_settings</a></li>
<li><a class="reference" href="#pe-settings" id="id103" name="id103">pe_settings</a></li>
<li><a class="reference" href="#proxy-settings" id="id104" name="id104">proxy_settings</a></li>
<li><a class="reference" href="#ip-filter" id="id105" name="id105">ip_filter</a><ul>
<li><a class="reference" href="#id9" id="id106" name="id106">ip_filter()</a></li>
<li><a class="reference" href="#add-rule" id="id107" name="id107">add_rule()</a></li>
<li><a class="reference" href="#access" id="id108" name="id108">access()</a></li>
<li><a class="reference" href="#export-filter" id="id109" name="id109">export_filter()</a></li>
</ul>
</li>
<li><a class="reference" href="#big-number" id="id109" name="id109">big_number</a></li>
<li><a class="reference" href="#bitfield" id="id110" name="id110">bitfield</a></li>
<li><a class="reference" href="#hasher" id="id111" name="id111">hasher</a></li>
<li><a class="reference" href="#fingerprint" id="id112" name="id112">fingerprint</a></li>
<li><a class="reference" href="#upnp-and-nat-pmp" id="id113" name="id113">UPnP and NAT-PMP</a><ul>
<li><a class="reference" href="#add-mapping" id="id114" name="id114">add_mapping</a></li>
<li><a class="reference" href="#delete-mapping" id="id115" name="id115">delete_mapping</a></li>
<li><a class="reference" href="#router-model" id="id116" name="id116">router_model()</a></li>
<li><a class="reference" href="#big-number" id="id110" name="id110">big_number</a></li>
<li><a class="reference" href="#bitfield" id="id111" name="id111">bitfield</a></li>
<li><a class="reference" href="#hasher" id="id112" name="id112">hasher</a></li>
<li><a class="reference" href="#fingerprint" id="id113" name="id113">fingerprint</a></li>
<li><a class="reference" href="#upnp-and-nat-pmp" id="id114" name="id114">UPnP and NAT-PMP</a><ul>
<li><a class="reference" href="#add-mapping" id="id115" name="id115">add_mapping</a></li>
<li><a class="reference" href="#delete-mapping" id="id116" name="id116">delete_mapping</a></li>
<li><a class="reference" href="#router-model" id="id117" name="id117">router_model()</a></li>
</ul>
</li>
<li><a class="reference" href="#free-functions" id="id117" name="id117">free functions</a><ul>
<li><a class="reference" href="#identify-client" id="id118" name="id118">identify_client()</a></li>
<li><a class="reference" href="#client-fingerprint" id="id119" name="id119">client_fingerprint()</a></li>
<li><a class="reference" href="#bdecode-bencode" id="id120" name="id120">bdecode() bencode()</a></li>
<li><a class="reference" href="#free-functions" id="id118" name="id118">free functions</a><ul>
<li><a class="reference" href="#identify-client" id="id119" name="id119">identify_client()</a></li>
<li><a class="reference" href="#client-fingerprint" id="id120" name="id120">client_fingerprint()</a></li>
<li><a class="reference" href="#bdecode-bencode" id="id121" name="id121">bdecode() bencode()</a></li>
</ul>
</li>
<li><a class="reference" href="#alerts" id="id121" name="id121">alerts</a><ul>
<li><a class="reference" href="#external-ip-alert" id="id122" name="id122">external_ip_alert</a></li>
<li><a class="reference" href="#listen-failed-alert" id="id123" name="id123">listen_failed_alert</a></li>
<li><a class="reference" href="#portmap-error-alert" id="id124" name="id124">portmap_error_alert</a></li>
<li><a class="reference" href="#portmap-alert" id="id125" name="id125">portmap_alert</a></li>
<li><a class="reference" href="#file-error-alert" id="id126" name="id126">file_error_alert</a></li>
<li><a class="reference" href="#tracker-announce-alert" id="id127" name="id127">tracker_announce_alert</a></li>
<li><a class="reference" href="#tracker-alert" id="id128" name="id128">tracker_alert</a></li>
<li><a class="reference" href="#tracker-error-alert" id="id129" name="id129">tracker_error_alert</a></li>
<li><a class="reference" href="#tracker-reply-alert" id="id130" name="id130">tracker_reply_alert</a></li>
<li><a class="reference" href="#tracker-warning-alert" id="id131" name="id131">tracker_warning_alert</a></li>
<li><a class="reference" href="#scrape-reply-alert" id="id132" name="id132">scrape_reply_alert</a></li>
<li><a class="reference" href="#scrape-failed-alert" id="id133" name="id133">scrape_failed_alert</a></li>
<li><a class="reference" href="#url-seed-alert" id="id134" name="id134">url_seed_alert</a></li>
<li><a class="reference" href="#hash-failed-alert" id="id135" name="id135">hash_failed_alert</a></li>
<li><a class="reference" href="#peer-ban-alert" id="id136" name="id136">peer_ban_alert</a></li>
<li><a class="reference" href="#peer-error-alert" id="id137" name="id137">peer_error_alert</a></li>
<li><a class="reference" href="#invalid-request-alert" id="id138" name="id138">invalid_request_alert</a></li>
<li><a class="reference" href="#torrent-finished-alert" id="id139" name="id139">torrent_finished_alert</a></li>
<li><a class="reference" href="#metadata-failed-alert" id="id140" name="id140">metadata_failed_alert</a></li>
<li><a class="reference" href="#metadata-received-alert" id="id141" name="id141">metadata_received_alert</a></li>
<li><a class="reference" href="#fastresume-rejected-alert" id="id142" name="id142">fastresume_rejected_alert</a></li>
<li><a class="reference" href="#peer-blocked-alert" id="id143" name="id143">peer_blocked_alert</a></li>
<li><a class="reference" href="#storage-moved-alert" id="id144" name="id144">storage_moved_alert</a></li>
<li><a class="reference" href="#torrent-paused-alert" id="id145" name="id145">torrent_paused_alert</a></li>
<li><a class="reference" href="#save-resume-data-alert" id="id146" name="id146">save_resume_data_alert</a></li>
<li><a class="reference" href="#dispatcher" id="id147" name="id147">dispatcher</a></li>
<li><a class="reference" href="#alerts" id="id122" name="id122">alerts</a><ul>
<li><a class="reference" href="#external-ip-alert" id="id123" name="id123">external_ip_alert</a></li>
<li><a class="reference" href="#listen-failed-alert" id="id124" name="id124">listen_failed_alert</a></li>
<li><a class="reference" href="#portmap-error-alert" id="id125" name="id125">portmap_error_alert</a></li>
<li><a class="reference" href="#portmap-alert" id="id126" name="id126">portmap_alert</a></li>
<li><a class="reference" href="#file-error-alert" id="id127" name="id127">file_error_alert</a></li>
<li><a class="reference" href="#tracker-announce-alert" id="id128" name="id128">tracker_announce_alert</a></li>
<li><a class="reference" href="#tracker-alert" id="id129" name="id129">tracker_alert</a></li>
<li><a class="reference" href="#tracker-error-alert" id="id130" name="id130">tracker_error_alert</a></li>
<li><a class="reference" href="#tracker-reply-alert" id="id131" name="id131">tracker_reply_alert</a></li>
<li><a class="reference" href="#tracker-warning-alert" id="id132" name="id132">tracker_warning_alert</a></li>
<li><a class="reference" href="#scrape-reply-alert" id="id133" name="id133">scrape_reply_alert</a></li>
<li><a class="reference" href="#scrape-failed-alert" id="id134" name="id134">scrape_failed_alert</a></li>
<li><a class="reference" href="#url-seed-alert" id="id135" name="id135">url_seed_alert</a></li>
<li><a class="reference" href="#hash-failed-alert" id="id136" name="id136">hash_failed_alert</a></li>
<li><a class="reference" href="#peer-ban-alert" id="id137" name="id137">peer_ban_alert</a></li>
<li><a class="reference" href="#peer-error-alert" id="id138" name="id138">peer_error_alert</a></li>
<li><a class="reference" href="#invalid-request-alert" id="id139" name="id139">invalid_request_alert</a></li>
<li><a class="reference" href="#torrent-finished-alert" id="id140" name="id140">torrent_finished_alert</a></li>
<li><a class="reference" href="#metadata-failed-alert" id="id141" name="id141">metadata_failed_alert</a></li>
<li><a class="reference" href="#metadata-received-alert" id="id142" name="id142">metadata_received_alert</a></li>
<li><a class="reference" href="#fastresume-rejected-alert" id="id143" name="id143">fastresume_rejected_alert</a></li>
<li><a class="reference" href="#peer-blocked-alert" id="id144" name="id144">peer_blocked_alert</a></li>
<li><a class="reference" href="#storage-moved-alert" id="id145" name="id145">storage_moved_alert</a></li>
<li><a class="reference" href="#torrent-paused-alert" id="id146" name="id146">torrent_paused_alert</a></li>
<li><a class="reference" href="#save-resume-data-alert" id="id147" name="id147">save_resume_data_alert</a></li>
<li><a class="reference" href="#torrent-resumed-alert" id="id148" name="id148">torrent_resumed_alert</a></li>
<li><a class="reference" href="#dispatcher" id="id149" name="id149">dispatcher</a></li>
</ul>
</li>
<li><a class="reference" href="#exceptions" id="id148" name="id148">exceptions</a><ul>
<li><a class="reference" href="#invalid-handle" id="id149" name="id149">invalid_handle</a></li>
<li><a class="reference" href="#duplicate-torrent" id="id150" name="id150">duplicate_torrent</a></li>
<li><a class="reference" href="#invalid-encoding" id="id151" name="id151">invalid_encoding</a></li>
<li><a class="reference" href="#type-error" id="id152" name="id152">type_error</a></li>
<li><a class="reference" href="#invalid-torrent-file" id="id153" name="id153">invalid_torrent_file</a></li>
<li><a class="reference" href="#exceptions" id="id150" name="id150">exceptions</a><ul>
<li><a class="reference" href="#invalid-handle" id="id151" name="id151">invalid_handle</a></li>
<li><a class="reference" href="#duplicate-torrent" id="id152" name="id152">duplicate_torrent</a></li>
<li><a class="reference" href="#invalid-encoding" id="id153" name="id153">invalid_encoding</a></li>
<li><a class="reference" href="#type-error" id="id154" name="id154">type_error</a></li>
<li><a class="reference" href="#invalid-torrent-file" id="id155" name="id155">invalid_torrent_file</a></li>
</ul>
</li>
<li><a class="reference" href="#storage-interface" id="id154" name="id154">storage_interface</a><ul>
<li><a class="reference" href="#initialize" id="id155" name="id155">initialize()</a></li>
<li><a class="reference" href="#read" id="id156" name="id156">read()</a></li>
<li><a class="reference" href="#write" id="id157" name="id157">write()</a></li>
<li><a class="reference" href="#id11" id="id158" name="id158">move_storage()</a></li>
<li><a class="reference" href="#verify-resume-data" id="id159" name="id159">verify_resume_data()</a></li>
<li><a class="reference" href="#write-resume-data" id="id160" name="id160">write_resume_data()</a></li>
<li><a class="reference" href="#move-slot" id="id161" name="id161">move_slot()</a></li>
<li><a class="reference" href="#swap-slots" id="id162" name="id162">swap_slots()</a></li>
<li><a class="reference" href="#swap-slots3" id="id163" name="id163">swap_slots3()</a></li>
<li><a class="reference" href="#hash-for-slot" id="id164" name="id164">hash_for_slot()</a></li>
<li><a class="reference" href="#release-files" id="id165" name="id165">release_files()</a></li>
<li><a class="reference" href="#delete-files" id="id166" name="id166">delete_files()</a></li>
<li><a class="reference" href="#storage-interface" id="id156" name="id156">storage_interface</a><ul>
<li><a class="reference" href="#initialize" id="id157" name="id157">initialize()</a></li>
<li><a class="reference" href="#read" id="id158" name="id158">read()</a></li>
<li><a class="reference" href="#write" id="id159" name="id159">write()</a></li>
<li><a class="reference" href="#id11" id="id160" name="id160">move_storage()</a></li>
<li><a class="reference" href="#verify-resume-data" id="id161" name="id161">verify_resume_data()</a></li>
<li><a class="reference" href="#write-resume-data" id="id162" name="id162">write_resume_data()</a></li>
<li><a class="reference" href="#move-slot" id="id163" name="id163">move_slot()</a></li>
<li><a class="reference" href="#swap-slots" id="id164" name="id164">swap_slots()</a></li>
<li><a class="reference" href="#swap-slots3" id="id165" name="id165">swap_slots3()</a></li>
<li><a class="reference" href="#hash-for-slot" id="id166" name="id166">hash_for_slot()</a></li>
<li><a class="reference" href="#release-files" id="id167" name="id167">release_files()</a></li>
<li><a class="reference" href="#delete-files" id="id168" name="id168">delete_files()</a></li>
</ul>
</li>
<li><a class="reference" href="#queuing" id="id167" name="id167">queuing</a><ul>
<li><a class="reference" href="#downloading" id="id168" name="id168">downloading</a></li>
<li><a class="reference" href="#seeding" id="id169" name="id169">seeding</a></li>
<li><a class="reference" href="#queuing" id="id169" name="id169">queuing</a><ul>
<li><a class="reference" href="#downloading" id="id170" name="id170">downloading</a></li>
<li><a class="reference" href="#seeding" id="id171" name="id171">seeding</a></li>
</ul>
</li>
<li><a class="reference" href="#fast-resume" id="id170" name="id170">fast resume</a><ul>
<li><a class="reference" href="#file-format" id="id171" name="id171">file format</a></li>
<li><a class="reference" href="#fast-resume" id="id172" name="id172">fast resume</a><ul>
<li><a class="reference" href="#file-format" id="id173" name="id173">file format</a></li>
</ul>
</li>
<li><a class="reference" href="#threads" id="id172" name="id172">threads</a></li>
<li><a class="reference" href="#storage-allocation" id="id173" name="id173">storage allocation</a><ul>
<li><a class="reference" href="#sparse-allocation" id="id174" name="id174">sparse allocation</a></li>
<li><a class="reference" href="#full-allocation" id="id175" name="id175">full allocation</a></li>
<li><a class="reference" href="#compact-allocation" id="id176" name="id176">compact allocation</a></li>
<li><a class="reference" href="#threads" id="id174" name="id174">threads</a></li>
<li><a class="reference" href="#storage-allocation" id="id175" name="id175">storage allocation</a><ul>
<li><a class="reference" href="#sparse-allocation" id="id176" name="id176">sparse allocation</a></li>
<li><a class="reference" href="#full-allocation" id="id177" name="id177">full allocation</a></li>
<li><a class="reference" href="#compact-allocation" id="id178" name="id178">compact allocation</a></li>
</ul>
</li>
<li><a class="reference" href="#extensions" id="id177" name="id177">extensions</a><ul>
<li><a class="reference" href="#metadata-from-peers" id="id178" name="id178">metadata from peers</a></li>
<li><a class="reference" href="#http-seeding" id="id179" name="id179">HTTP seeding</a></li>
<li><a class="reference" href="#extensions" id="id179" name="id179">extensions</a><ul>
<li><a class="reference" href="#metadata-from-peers" id="id180" name="id180">metadata from peers</a></li>
<li><a class="reference" href="#http-seeding" id="id181" name="id181">HTTP seeding</a></li>
</ul>
</li>
<li><a class="reference" href="#filename-checks" id="id180" name="id180">filename checks</a></li>
<li><a class="reference" href="#acknowledgments" id="id181" name="id181">acknowledgments</a></li>
<li><a class="reference" href="#filename-checks" id="id182" name="id182">filename checks</a></li>
<li><a class="reference" href="#acknowledgments" id="id183" name="id183">acknowledgments</a></li>
</ul>
</div>
<div class="section">
@ -1610,6 +1612,7 @@ struct torrent_handle
void resume() const;
bool is_paused() const;
bool is_seed() const;
void force_recheck() const;
void resolve_countries(bool r);
bool resolve_countries() const;
@ -1854,6 +1857,19 @@ is currently paused. Torrents may be paused automatically if there is a file err
or something similar. See <a class="reference" href="#file-error-alert">file_error_alert</a>.</p>
</div>
<div class="section">
<h2><a id="force-recheck" name="force-recheck">force_recheck()</a></h2>
<blockquote>
<pre class="literal-block">
void force_recheck() const;
</pre>
</blockquote>
<p><tt class="docutils literal"><span class="pre">force_recheck</span></tt> puts the torrent back in a state where it assumes to have no resume data.
All peers will be disconnected and the torrent will stop announcing to the tracker. The torrent
will be added to the checking queue, and will be checked (all the files will be read and
compared to the piece hashes). Once the check is complete, the torrent will start connecting
to peers again, as normal.</p>
</div>
<div class="section">
<h2><a id="resolve-countries" name="resolve-countries">resolve_countries()</a></h2>
<blockquote>
<pre class="literal-block">
@ -2979,9 +2995,17 @@ sent to peers (including web seeds). The default value for this is <tt class="do
(no marking). One potentially useful TOS mark is <tt class="docutils literal"><span class="pre">0x20</span></tt>, this represents
the <em>QBone scavenger service</em>. For more details, see <a class="reference" href="http://qbone.internet2.edu/qbss/">QBSS</a>.</p>
<p><tt class="docutils literal"><span class="pre">active_downloads</span></tt> and <tt class="docutils literal"><span class="pre">active_seeds</span></tt> controls how many active seeding and
downloading torrents the queuing mechanism allows. Seeding torrents are
counted against the downloads limit but downloading torrenst are not
counted against the seed limit.</p>
downloading torrents the queuing mechanism allows. The target number of active
torrents is <tt class="docutils literal"><span class="pre">max(active_downloads,</span> <span class="pre">active_seeds)</span></tt>. <tt class="docutils literal"><span class="pre">active_downloads</span></tt> and
<tt class="docutils literal"><span class="pre">active_seeds</span></tt> are upper limits on the number of downloading torrents and
seeding torrents respectively.</p>
<p>For example if there are 10 seeding torrents and 10 downloading torrents, and
<tt class="docutils literal"><span class="pre">active_downloads</span></tt> is 4 and <tt class="docutils literal"><span class="pre">active_seeds</span></tt> is 4, there will be no seed
active, but 4 downloading torrents. If the settings are <tt class="docutils literal"><span class="pre">active_downloads</span></tt> = 2
and <tt class="docutils literal"><span class="pre">active_seeds</span></tt> = 4, then there will be 2 downloading torrenst and 2 seeding
torrents active. Torrents that are not auto managed are also counted against these
limits. If there are non-auto managed torrents that use up all the slots, no
auto managed torrent will be activated.</p>
<p><tt class="docutils literal"><span class="pre">auto_manage_interval</span></tt> is the number of seconds between the torrent queue
is updated, and rotated.</p>
<p><tt class="docutils literal"><span class="pre">share_ratio_limit</span></tt> is the upload / download ratio limit for considering a
@ -4053,6 +4077,18 @@ struct save_resume_data_alert: torrent_alert
</pre>
</div>
<div class="section">
<h2><a id="torrent-resumed-alert" name="torrent-resumed-alert">torrent_resumed_alert</a></h2>
<p>This alert is generated as a response to a <tt class="docutils literal"><span class="pre">torrent_handle::resume</span></tt> request. It is
generated when a torrent goes from a paused state to an active state.</p>
<pre class="literal-block">
struct torrent_resumed_alert: torrent_alert
{
torrent_resumed_alert(torrent_handle const&amp; h, std::string const&amp; msg);
virtual std::auto_ptr&lt;alert&gt; clone() const;
};
</pre>
</div>
<div class="section">
<h2><a id="dispatcher" name="dispatcher">dispatcher</a></h2>
<p>The <tt class="docutils literal"><span class="pre">handle_alert</span></tt> class is defined in <tt class="docutils literal"><span class="pre">&lt;libtorrent/alert.hpp&gt;</span></tt>.</p>
<p>Examples usage:</p>

View File

@ -3018,9 +3018,18 @@ the *QBone scavenger service*. For more details, see QBSS_.
.. _`QBSS`: http://qbone.internet2.edu/qbss/
``active_downloads`` and ``active_seeds`` controls how many active seeding and
downloading torrents the queuing mechanism allows. Seeding torrents are
counted against the downloads limit but downloading torrenst are not
counted against the seed limit.
downloading torrents the queuing mechanism allows. The target number of active
torrents is ``max(active_downloads, active_seeds)``. ``active_downloads`` and
``active_seeds`` are upper limits on the number of downloading torrents and
seeding torrents respectively.
For example if there are 10 seeding torrents and 10 downloading torrents, and
``active_downloads`` is 4 and ``active_seeds`` is 4, there will be no seed
active, but 4 downloading torrents. If the settings are ``active_downloads`` = 2
and ``active_seeds`` = 4, then there will be 2 downloading torrenst and 2 seeding
torrents active. Torrents that are not auto managed are also counted against these
limits. If there are non-auto managed torrents that use up all the slots, no
auto managed torrent will be activated.
``auto_manage_interval`` is the number of seconds between the torrent queue
is updated, and rotated.
@ -4224,7 +4233,7 @@ The ``resume_data`` member points to the resume data or is 0 on errors.
};
torrent_resumed_alert
--------------------
---------------------
This alert is generated as a response to a ``torrent_handle::resume`` request. It is
generated when a torrent goes from a paused state to an active state.

View File

@ -1327,15 +1327,8 @@ namespace aux {
// this is not an auto managed torrent,
// if it's running, decrease the respective
// counters.
if (t->is_finished())
{
--num_seeds;
--num_downloaders;
}
else
{
--num_downloaders;
}
--num_downloaders;
--num_seeds;
}
}
@ -1362,6 +1355,7 @@ namespace aux {
if (num_downloaders > 0)
{
--num_downloaders;
--num_seeds;
if (t->is_paused()) t->resume();
}
else
@ -1374,7 +1368,7 @@ namespace aux {
, end(seeds.end()); i != end; ++i)
{
torrent* t = *i;
if (num_downloaders > 0 && num_seeds > 0)
if (num_seeds > 0)
{
--num_downloaders;
--num_seeds;