regenerated html

This commit is contained in:
Arvid Norberg 2011-07-04 05:46:18 +00:00
parent 94b3ef81c3
commit ea535bca2b
1 changed files with 28 additions and 12 deletions

View File

@ -3100,7 +3100,7 @@ the entire file.</p>
closing down.</p>
<p>Example code to pause and save resume data for all torrents and wait for the alerts:</p>
<pre class="literal-block">
int num_resume_data = 0;
extern int outstanding_resume_data; // global counter of outstanding resume data
std::vector&lt;torrent_handle&gt; handles = ses.get_torrents();
ses.pause();
for (std::vector&lt;torrent_handle&gt;::iterator i = handles.begin();
@ -3110,12 +3110,13 @@ for (std::vector&lt;torrent_handle&gt;::iterator i = handles.begin();
if (!h.is_valid()) continue;
torrent_status s = h.status();
if (!s.has_metadata) continue;
if (!s.need_save_resume_data()) continue;
h.save_resume_data();
++num_resume_data;
++outstanding_resume_data;
}
while (num_resume_data &gt; 0)
while (outstanding_resume_data &gt; 0)
{
alert const* a = ses.wait_for_alert(seconds(10));
@ -3127,7 +3128,7 @@ while (num_resume_data &gt; 0)
if (alert_cast&lt;save_resume_data_failed_alert&gt;(a))
{
process_alert(a);
--num_resume_data;
--outstanding_resume_data;
continue;
}
@ -3143,9 +3144,18 @@ while (num_resume_data &gt; 0)
/ (h.get_torrent_info().name() + &quot;.fastresume&quot;), std::ios_base::binary);
out.unsetf(std::ios_base::skipws);
bencode(std::ostream_iterator&lt;char&gt;(out), *rd-&gt;resume_data);
--num_resume_data;
--outstanding_resume_data;
}
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Note how <tt class="docutils literal"><span class="pre">outstanding_resume_data</span></tt> is a global counter in this example.
This is deliberate, otherwise there is a race condition for torrents that
was just asked to save their resume data, they posted the alert, but it has
not been received yet. Those torrents would report that they don't need to
save resume data again, and skipped by the initial loop, and thwart the counter
otherwise.</p>
</div>
</div>
<div class="section" id="need-save-resume-data">
<h2>need_save_resume_data()</h2>
@ -3158,6 +3168,12 @@ bool need_save_resume_data() const;
torrent was first loaded or since the last time the resume data was saved. When
saving resume data periodically, it makes sense to skip any torrent which hasn't
downloaded anything since the last time.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">A torrent's resume data is considered saved as soon as the alert
is posted. It is important to make sure this alert is received and handled
in order for this function to be meaningful.</p>
</div>
</div>
<div class="section" id="id5">
<h2>status()</h2>
@ -6303,7 +6319,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
@ -7754,13 +7770,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
};