*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-02-24 16:22:43 +00:00
parent cea75e3723
commit f788d65ee5
5 changed files with 80 additions and 63 deletions

View File

@ -13,63 +13,63 @@
<div class="contents topic" id="contents"> <div class="contents topic" id="contents">
<p class="topic-title"><a name="contents">Contents</a></p> <p class="topic-title"><a name="contents">Contents</a></p>
<ul class="simple"> <ul class="simple">
<li><a class="reference" href="#introduction" id="id12" name="id12">introduction</a></li> <li><a class="reference" href="#introduction" id="id13" name="id13">introduction</a></li>
<li><a class="reference" href="#building" id="id13" name="id13">building</a><ul> <li><a class="reference" href="#downloading-and-building" id="id14" name="id14">downloading and building</a><ul>
<li><a class="reference" href="#release-and-debug-builds" id="id14" name="id14">release and debug builds</a></li> <li><a class="reference" href="#release-and-debug-builds" id="id15" name="id15">release and debug builds</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#using" id="id15" name="id15">using</a></li> <li><a class="reference" href="#using" id="id16" name="id16">using</a></li>
<li><a class="reference" href="#session" id="id16" name="id16">session</a></li> <li><a class="reference" href="#session" id="id17" name="id17">session</a></li>
<li><a class="reference" href="#parsing-torrent-files" id="id17" name="id17">parsing torrent files</a></li> <li><a class="reference" href="#parsing-torrent-files" id="id18" name="id18">parsing torrent files</a></li>
<li><a class="reference" href="#entry" id="id18" name="id18">entry</a></li> <li><a class="reference" href="#entry" id="id19" name="id19">entry</a></li>
<li><a class="reference" href="#torrent-info" id="id19" name="id19">torrent_info</a></li> <li><a class="reference" href="#torrent-info" id="id20" name="id20">torrent_info</a></li>
<li><a class="reference" href="#torrent-handle" id="id20" name="id20">torrent_handle</a><ul> <li><a class="reference" href="#torrent-handle" id="id21" name="id21">torrent_handle</a><ul>
<li><a class="reference" href="#status" id="id21" name="id21">status()</a></li> <li><a class="reference" href="#status" id="id22" name="id22">status()</a></li>
<li><a class="reference" href="#get-download-queue" id="id22" name="id22">get_download_queue()</a></li> <li><a class="reference" href="#get-download-queue" id="id23" name="id23">get_download_queue()</a></li>
<li><a class="reference" href="#get-peer-info" id="id23" name="id23">get_peer_info()</a></li> <li><a class="reference" href="#get-peer-info" id="id24" name="id24">get_peer_info()</a></li>
<li><a class="reference" href="#get-torrent-info" id="id24" name="id24">get_torrent_info()</a></li> <li><a class="reference" href="#get-torrent-info" id="id25" name="id25">get_torrent_info()</a></li>
<li><a class="reference" href="#is-valid" id="id25" name="id25">is_valid()</a></li> <li><a class="reference" href="#is-valid" id="id26" name="id26">is_valid()</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#address" id="id26" name="id26">address</a></li> <li><a class="reference" href="#address" id="id27" name="id27">address</a></li>
<li><a class="reference" href="#http-settings" id="id27" name="id27">http_settings</a></li> <li><a class="reference" href="#http-settings" id="id28" name="id28">http_settings</a></li>
<li><a class="reference" href="#big-number" id="id28" name="id28">big_number</a></li> <li><a class="reference" href="#big-number" id="id29" name="id29">big_number</a></li>
<li><a class="reference" href="#hasher" id="id29" name="id29">hasher</a></li> <li><a class="reference" href="#hasher" id="id30" name="id30">hasher</a></li>
<li><a class="reference" href="#fingerprint" id="id30" name="id30">fingerprint</a><ul> <li><a class="reference" href="#fingerprint" id="id31" name="id31">fingerprint</a><ul>
<li><a class="reference" href="#identify-client" id="id31" name="id31">identify_client</a></li> <li><a class="reference" href="#identify-client" id="id32" name="id32">identify_client</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#alerts" id="id32" name="id32">alerts</a><ul> <li><a class="reference" href="#alerts" id="id33" name="id33">alerts</a><ul>
<li><a class="reference" href="#listen-failed-alert" id="id33" name="id33">listen_failed_alert</a></li> <li><a class="reference" href="#listen-failed-alert" id="id34" name="id34">listen_failed_alert</a></li>
<li><a class="reference" href="#file-error-alert" id="id34" name="id34">file_error_alert</a></li> <li><a class="reference" href="#file-error-alert" id="id35" name="id35">file_error_alert</a></li>
<li><a class="reference" href="#tracker-alert" id="id35" name="id35">tracker_alert</a></li> <li><a class="reference" href="#tracker-alert" id="id36" name="id36">tracker_alert</a></li>
<li><a class="reference" href="#hash-failed-alert" id="id36" name="id36">hash_failed_alert</a></li> <li><a class="reference" href="#hash-failed-alert" id="id37" name="id37">hash_failed_alert</a></li>
<li><a class="reference" href="#peer-error-alert" id="id37" name="id37">peer_error_alert</a></li> <li><a class="reference" href="#peer-error-alert" id="id38" name="id38">peer_error_alert</a></li>
<li><a class="reference" href="#invalid-request-alert" id="id38" name="id38">invalid_request_alert</a></li> <li><a class="reference" href="#invalid-request-alert" id="id39" name="id39">invalid_request_alert</a></li>
<li><a class="reference" href="#torrent-finished-alert" id="id39" name="id39">torrent_finished_alert</a></li> <li><a class="reference" href="#torrent-finished-alert" id="id40" name="id40">torrent_finished_alert</a></li>
<li><a class="reference" href="#dispatcher" id="id40" name="id40">dispatcher</a></li> <li><a class="reference" href="#dispatcher" id="id41" name="id41">dispatcher</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#exceptions" id="id41" name="id41">exceptions</a><ul> <li><a class="reference" href="#exceptions" id="id42" name="id42">exceptions</a><ul>
<li><a class="reference" href="#invalid-handle" id="id42" name="id42">invalid_handle</a></li> <li><a class="reference" href="#invalid-handle" id="id43" name="id43">invalid_handle</a></li>
<li><a class="reference" href="#duplicate-torrent" id="id43" name="id43">duplicate_torrent</a></li> <li><a class="reference" href="#duplicate-torrent" id="id44" name="id44">duplicate_torrent</a></li>
<li><a class="reference" href="#invalid-encoding" id="id44" name="id44">invalid_encoding</a></li> <li><a class="reference" href="#invalid-encoding" id="id45" name="id45">invalid_encoding</a></li>
<li><a class="reference" href="#type-error" id="id45" name="id45">type_error</a></li> <li><a class="reference" href="#type-error" id="id46" name="id46">type_error</a></li>
<li><a class="reference" href="#invalid-torrent-file" id="id46" name="id46">invalid_torrent_file</a></li> <li><a class="reference" href="#invalid-torrent-file" id="id47" name="id47">invalid_torrent_file</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#examples" id="id47" name="id47">examples</a><ul> <li><a class="reference" href="#examples" id="id48" name="id48">examples</a><ul>
<li><a class="reference" href="#dump-torrent" id="id48" name="id48">dump_torrent</a></li> <li><a class="reference" href="#dump-torrent" id="id49" name="id49">dump_torrent</a></li>
<li><a class="reference" href="#simple-client" id="id49" name="id49">simple client</a></li> <li><a class="reference" href="#simple-client" id="id50" name="id50">simple client</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#fast-resume" id="id50" name="id50">fast resume</a><ul> <li><a class="reference" href="#fast-resume" id="id51" name="id51">fast resume</a><ul>
<li><a class="reference" href="#file-format" id="id51" name="id51">file format</a></li> <li><a class="reference" href="#file-format" id="id52" name="id52">file format</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#extensions" id="id52" name="id52">extensions</a></li> <li><a class="reference" href="#extensions" id="id53" name="id53">extensions</a></li>
<li><a class="reference" href="#filenames-checks" id="id53" name="id53">filenames checks</a></li> <li><a class="reference" href="#filenames-checks" id="id54" name="id54">filenames checks</a></li>
<li><a class="reference" href="#aknowledgements" id="id54" name="id54">aknowledgements</a></li> <li><a class="reference" href="#aknowledgements" id="id55" name="id55">aknowledgements</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="introduction"> <div class="section" id="introduction">
@ -146,8 +146,10 @@ boost.filesystem, boost.date_time and various other boost libraries as well as z
</blockquote> </blockquote>
<p>libtorrent is released under the <a class="reference" href="http://www.opensource.org/licenses/bsd-license.php">BSD-license</a>.</p> <p>libtorrent is released under the <a class="reference" href="http://www.opensource.org/licenses/bsd-license.php">BSD-license</a>.</p>
</div> </div>
<div class="section" id="building"> <div class="section" id="downloading-and-building">
<h1><a name="building">building</a></h1> <h1><a name="downloading-and-building">downloading and building</a></h1>
<p>To acquire the latest version of libtorrent, you'll have to grab it from CVS. You'll find instructions
on how to do this <a class="reference" href="http://sourceforge.net/cvs/?group_id=79942">here</a> (see Anonymous CVS access).</p>
<p>The easiest way to build libtorrent is probably to use <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=80982">boost-build</a>. Make sure you install it <p>The easiest way to build libtorrent is probably to use <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=80982">boost-build</a>. Make sure you install it
correctly by setting the environment variable <tt class="literal"><span class="pre">BOOST_BUILD_PATH</span></tt> and modifying the correctly by setting the environment variable <tt class="literal"><span class="pre">BOOST_BUILD_PATH</span></tt> and modifying the
<tt class="literal"><span class="pre">user_config.jam</span></tt> to reflect the toolsets you have installed.</p> <tt class="literal"><span class="pre">user_config.jam</span></tt> to reflect the toolsets you have installed.</p>
@ -166,10 +168,11 @@ bjam &lt;toolset&gt;
version of boost, <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=178835">boost 1.30.2</a>.</p> version of boost, <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=178835">boost 1.30.2</a>.</p>
<div class="section" id="release-and-debug-builds"> <div class="section" id="release-and-debug-builds">
<h2><a name="release-and-debug-builds">release and debug builds</a></h2> <h2><a name="release-and-debug-builds">release and debug builds</a></h2>
<p>If you just invoke the makefile you'll get a debug build. In debug the libtorrent vill <p>The <tt class="literal"><span class="pre">Jamfile</span></tt> can build both a release and debug version of libtorrent. In debug mode,
have pretty expensive invariant checks and asserts built into it. If you want to disable libtorrent will have pretty expensive invariant checks and asserts built into it. If you
such checks (you want to do that in a release build) you can see the table below for which want to disable such checks (you want to do that in a release build) you can see the
defines you can use to control the build.</p> table below for which defines you can use to control the build. The <tt class="literal"><span class="pre">Jamfile</span></tt> will define
<tt class="literal"><span class="pre">NDEBUG</span></tt> when it's building a release build.</p>
<table border class="table"> <table border class="table">
<colgroup> <colgroup>
<col width="39%" /> <col width="39%" />

View File

@ -69,19 +69,24 @@ libtorrent has been successfully compiled and tested on:
* Windows 2000 vc7.1 * Windows 2000 vc7.1
* Linux x86 (debian) GCC 3.0.4, GCC 3.2.3 * Linux x86 (debian) GCC 3.0.4, GCC 3.2.3
* Windows 2000, msvc6 sp5 (does not support 64-bit values due to problems with operator<<(ostream&, __int64)) * Windows 2000, msvc6 sp5 (does not support 64-bit values due to problems with operator<<(ostream&, __int64))
* Cygwin GCC 3.3.1
Fails on: Fails on:
* Linux x86 (Debian) GCC 2.95.4 (``std::ios_base`` is missing) * GCC 2.95.4 (``std::ios_base`` is missing)
* Cygwin GCC 3.3.1 (compiles but crashes)
libtorrent is released under the BSD-license_. libtorrent is released under the BSD-license_.
.. _BSD-license: http://www.opensource.org/licenses/bsd-license.php .. _BSD-license: http://www.opensource.org/licenses/bsd-license.php
building downloading and building
======== ========================
To acquire the latest version of libtorrent, you'll have to grab it from CVS. You'll find instructions
on how to do this here__ (see Anonymous CVS access).
__ http://sourceforge.net/cvs/?group_id=79942
The easiest way to build libtorrent is probably to use `boost-build`_. Make sure you install it The easiest way to build libtorrent is probably to use `boost-build`_. Make sure you install it
correctly by setting the environment variable ``BOOST_BUILD_PATH`` and modifying the correctly by setting the environment variable ``BOOST_BUILD_PATH`` and modifying the
@ -114,10 +119,11 @@ __ http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&re
release and debug builds release and debug builds
------------------------ ------------------------
If you just invoke the makefile you'll get a debug build. In debug the libtorrent vill The ``Jamfile`` can build both a release and debug version of libtorrent. In debug mode,
have pretty expensive invariant checks and asserts built into it. If you want to disable libtorrent will have pretty expensive invariant checks and asserts built into it. If you
such checks (you want to do that in a release build) you can see the table below for which want to disable such checks (you want to do that in a release build) you can see the
defines you can use to control the build. table below for which defines you can use to control the build. The ``Jamfile`` will define
``NDEBUG`` when it's building a release build.
+-------------------------------+-------------------------------------------------+ +-------------------------------+-------------------------------------------------+
| macro | description | | macro | description |

View File

@ -271,9 +271,7 @@ namespace libtorrent
// DEBUG // DEBUG
#ifndef NDEBUG #ifndef NDEBUG
logger* spawn_logger(const char* title); logger* spawn_logger(const char* title);
#endif
#ifndef NDEBUG
virtual void debug_log(const std::string& line); virtual void debug_log(const std::string& line);
void check_invariant(); void check_invariant();
#endif #endif

View File

@ -151,6 +151,8 @@ namespace libtorrent
const torrent_info& get_torrent_info() const; const torrent_info& get_torrent_info() const;
bool is_valid() const; bool is_valid() const;
// TODO: there must be a way to get resume data and
// shut down the torrent in one atomic operation
entry write_resume_data(); entry write_resume_data();
// forces this torrent to reannounce // forces this torrent to reannounce

View File

@ -192,14 +192,22 @@ namespace libtorrent
{ {
boost::mutex::scoped_lock l(m_ses->m_mutex); boost::mutex::scoped_lock l(m_ses->m_mutex);
torrent* t = m_ses->find_torrent(m_info_hash); torrent* t = m_ses->find_torrent(m_info_hash);
if (t != 0) t->set_tracker_login(name, password); if (t != 0)
{
t->set_tracker_login(name, password);
return;
}
} }
if (m_chk) if (m_chk)
{ {
boost::mutex::scoped_lock l(m_chk->m_mutex); boost::mutex::scoped_lock l(m_chk->m_mutex);
detail::piece_checker_data* d = m_chk->find_torrent(m_info_hash); detail::piece_checker_data* d = m_chk->find_torrent(m_info_hash);
if (d != 0) d->torrent_ptr->set_tracker_login(name, password); if (d != 0)
{
d->torrent_ptr->set_tracker_login(name, password);
return;
}
} }
throw invalid_handle(); throw invalid_handle();
@ -459,8 +467,8 @@ namespace libtorrent
p.total_download = statistics.total_payload_download(); p.total_download = statistics.total_payload_download();
p.total_upload = statistics.total_payload_upload(); p.total_upload = statistics.total_payload_upload();
p.upload_limit = peer->upload_bandwidth.given; p.upload_limit = peer->send_quota();
p.upload_ceiling = peer->upload_bandwidth.wanted; p.upload_ceiling = peer->send_quota_limit();
p.load_balancing = peer->total_free_upload(); p.load_balancing = peer->total_free_upload();