fixed integer overflow bug occuring when building with gcc 4.1.x. updated the projects page, removed dead code from allocate_resources.

This commit is contained in:
Arvid Norberg 2006-09-25 22:37:48 +00:00
parent 6ff86a8973
commit 362f700906
12 changed files with 60 additions and 36 deletions

View File

@ -1,3 +1,4 @@
* fixed an integer overflow bug occuring when built with gcc 4.1.x
* fixed crasing bug when closing while checking a torrent
* fixed bug causing a crash with a torrent with piece length 0
* added an extension to the DHT network protocol to support the

View File

@ -293,6 +293,14 @@ LDFLAGS, as Boost::Thread detection will fail without it, even if
Boost::Thread is installed.</p>
<p>If you need to set these variables, it may be a good idea to add those lines
to your <tt class="docutils literal"><span class="pre">~/.profile</span></tt> or <tt class="docutils literal"><span class="pre">~/.tcshrc</span></tt> depending on your shell.</p>
<p>If the boost libraries are named with a suffix on your platform, you may use
the <tt class="docutils literal"><span class="pre">--with-boost-thread=</span></tt> option to specify the suffix used for the thread
library in this case. For more information about these options, run:</p>
<pre class="literal-block">
./configure --help
</pre>
<p>On gentoo the boost libraries that are built with multi-threading support have
the suffix <tt class="docutils literal"><span class="pre">mt</span></tt>.</p>
<p>You know that the boost libraries were found if you see the following output
from the configure script:</p>
<pre class="literal-block">

View File

@ -291,6 +291,15 @@ Boost::Thread is installed.
If you need to set these variables, it may be a good idea to add those lines
to your ``~/.profile`` or ``~/.tcshrc`` depending on your shell.
If the boost libraries are named with a suffix on your platform, you may use
the ``--with-boost-thread=`` option to specify the suffix used for the thread
library in this case. For more information about these options, run::
./configure --help
On gentoo the boost libraries that are built with multi-threading support have
the suffix ``mt``.
You know that the boost libraries were found if you see the following output
from the configure script::

BIN
docs/gtorrent_thumb.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -21,6 +21,11 @@
<li><a class="reference" href="http://sourceforge.net/tracker/?group_id=79942&amp;atid=558250">report bugs</a></li>
<li><a class="reference" href="http://www.sourceforge.net/projects/libtorrent">sourceforge page</a></li>
</ul>
<hr class="docutils" />
<ul class="simple">
<li><a class="reference" href="http://libtorrent-ruby.rubyforge.org/">ruby bindings</a></li>
<li><a class="reference" href="http://code.google.com/p/python-libtorrent/">python bindings</a></li>
</ul>
</div>
<div id="libraryBody"><div class="section" id="libtorrent">
<h1><a name="libtorrent">libtorrent</a></h1>
@ -54,7 +59,7 @@ library and not a full featured client, although it comes with a working
</div>
<div class="section" id="acknowledgements">
<h2><a name="acknowledgements">Acknowledgements</a></h2>
<p>Written by Arvid Norberg. Copyright (c) 2003</p>
<p>Written by Arvid Norberg. Copyright (c) 2003-2006</p>
<p>Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson</p>
<p>Thanks to Reimond Retz for bugfixes, suggestions and testing</p>
<p>Project is hosted by sourceforge.</p>

View File

@ -11,7 +11,12 @@
* `mailing list`_ (archive_)
* `who's using libtorrent?`_
* `report bugs`_
* `sourceforge page`_
* `sourceforge page`_
--------
* `ruby bindings`_
* `python bindings`_
.. raw:: html
@ -34,6 +39,9 @@ libtorrent
.. _`report bugs`: http://sourceforge.net/tracker/?group_id=79942&atid=558250
.. _sourceforge page: http://www.sourceforge.net/projects/libtorrent
.. _`ruby bindings`: http://libtorrent-ruby.rubyforge.org/
.. _`python bindings`: http://code.google.com/p/python-libtorrent/
libtorrent is a C++ library that aims to be a good alternative to all the
other bittorrent implementations around. It is a
library and not a full featured client, although it comes with a working
@ -81,7 +89,7 @@ You can usually find me as hydri in ``#libtorrent`` on ``irc.freenode.net``.
Acknowledgements
================
Written by Arvid Norberg. Copyright (c) 2003
Written by Arvid Norberg. Copyright (c) 2003-2006
Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson

View File

@ -426,7 +426,7 @@ void set_max_half_open_connections(int limit);
</blockquote>
<p>Sets the maximum number of half-open connections libtorrent will have when
connecting to peers. A half-open connection is one where connect() has been
called, but the connection still hasn't been established (nor filed). Windows
called, but the connection still hasn't been established (nor failed). Windows
XP Service Pack 2 sets a default, system wide, limit of the number of half-open
connections to 10. So, this limit can be used to work nicer together with
other network applications on that system. The default is to have no limit,
@ -2458,7 +2458,7 @@ struct peer_error_alert: alert
<div class="section" id="invalid-request-alert">
<h2><a name="invalid-request-alert">invalid_request_alert</a></h2>
<p>This is a debug alert that is generated by an incoming invalid piece request. The <tt class="docutils literal"><span class="pre">handle</span></tt>
is a handle to the torrent the peer is a member of. <tt class="docutils literal"><span class="pre">Ïp</span></tt> is the address of the peer and the
is a handle to the torrent the peer is a member of. <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. The alert is generated as severity level
<tt class="docutils literal"><span class="pre">debug</span></tt>.</p>
<pre class="literal-block">
@ -3045,13 +3045,13 @@ boost::filesystem::path::default_name_check(boost::filesystem::native);
</div>
<div class="section" id="acknowledgments">
<h1><a name="acknowledgments">acknowledgments</a></h1>
<p>Written by Arvid Norberg. Copyright © 2003-2005</p>
<p>Written by Arvid Norberg. Copyright © 2003-2006</p>
<p>Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson</p>
<p>Lots of testing, suggestions and contributions by Massaroddel and Tianhao Qiu.</p>
<p>Big thanks to Michael Wojciechowski and Peter Koeleman for making the autotools
scripts.</p>
<p>Thanks to Reimond Retz for bugfixes, suggestions and testing</p>
<p>Thanks to <a class="reference" href="http://www.cs.umu.se">University of UmeÂ</a> for providing development and test hardware.</p>
<p>Thanks to <a class="reference" href="http://www.cs.umu.se">University of Umeå</a> for providing development and test hardware.</p>
<p>Project is hosted by sourceforge.</p>
<p><a class="reference" href="http://sourceforge.net"><img alt="sf_logo" src="http://sourceforge.net/sflogo.php?group_id=7994" /></a></p>
</div>

View File

@ -285,7 +285,7 @@ set_max_half_open_connections()
Sets the maximum number of half-open connections libtorrent will have when
connecting to peers. A half-open connection is one where connect() has been
called, but the connection still hasn't been established (nor filed). Windows
called, but the connection still hasn't been established (nor failed). Windows
XP Service Pack 2 sets a default, system wide, limit of the number of half-open
connections to 10. So, this limit can be used to work nicer together with
other network applications on that system. The default is to have no limit,
@ -3086,7 +3086,7 @@ __ http://www.boost.org/libs/filesystem/doc/index.htm
acknowledgments
===============
Written by Arvid Norberg. Copyright |copy| 2003-2005
Written by Arvid Norberg. Copyright |copy| 2003-2006
Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson

View File

@ -100,6 +100,14 @@ Written by Cory Nelson.</p>
<td><div class="image first last"><img alt="arctic_thumb.png" class="first last" src="arctic_thumb.png" /></div>
</td>
</tr>
<tr><td><p class="first"><strong>deluge torrent</strong></p>
<p class="last"><a class="reference" href="http://code.google.com/p/deluge-torrent/">deluge Torrent</a> is a more full-featured yet still lightweight bittorrent
client. It has the ability to automatically resume partial downloads and
background to the system tray.</p>
</td>
<td><div class="image first last"><img alt="gtorrent_thumb.jpg" class="first last" src="gtorrent_thumb.jpg" /></div>
</td>
</tr>
<tr><td><p class="first"><strong>ZipTorrent</strong></p>
<p class="last"><a class="reference" href="http://www.ziptorrent.com/">ZipTorrent</a> is another windows
bittorrent client with

View File

@ -69,6 +69,12 @@ project listed here, let me_ know.
| bittorrent client for windows. | |
| Written by Cory Nelson. | |
+-------------------------------------------------------------------------------+-------------------------------------+
| **deluge torrent** | .. image:: gtorrent_thumb.jpg |
| | |
| `deluge Torrent`_ is a more full-featured yet still lightweight bittorrent | |
| client. It has the ability to automatically resume partial downloads and | |
| background to the system tray. | |
+-------------------------------------------------------------------------------+-------------------------------------+
| **ZipTorrent** | .. image:: ziptorrent_thumb.gif |
| | |
| ZipTorrent_ is another windows | |
@ -108,6 +114,7 @@ project listed here, let me_ know.
.. _BitSlug: http://bitslug.sourceforge.net/
.. _BitBuddy: http://www.btvampire.com
.. _`Arctic Torrent`: http://www.int64.org/arctic.html
.. _`deluge Torrent`: http://code.google.com/p/deluge-torrent/
.. _ZipTorrent: http://www.ziptorrent.com/
.. _FireANT: http://antisnottv.net/
.. _eDonkey2000: http://www.edonkey2000.com/

View File

@ -55,12 +55,7 @@ namespace libtorrent
// sure "used" is updated between calls!).
// If resources = std::numeric_limits<int>::max() it means there is an infinite
// supply of resources (so everyone can get what they want).
/*
void allocate_resources(
int resources
, std::map<boost::shared_ptr<socket>, boost::intrusive_ptr<peer_connection> >& connections
, resource_request peer_connection::* res);
*/
void allocate_resources(
int resources
, std::map<sha1_hash, boost::shared_ptr<torrent> >& torrents

View File

@ -73,12 +73,12 @@ namespace libtorrent
assert(b <= resource_request::inf);
assert(resource_request::inf + resource_request::inf < 0);
int sum = a + b;
if (sum < 0)
unsigned int sum = unsigned(a) + unsigned(b);
if (sum > unsigned(resource_request::inf))
sum = resource_request::inf;
assert(sum >= a && sum >= b);
return sum;
assert(sum >= unsigned(a) && sum >= unsigned(b));
return int(sum);
}
namespace
@ -278,23 +278,6 @@ namespace libtorrent
} // namespace anonymous
/*
void allocate_resources(
int resources
, std::map<boost::shared_ptr<socket>, boost::intrusive_ptr<peer_connection> >& c
, resource_request peer_connection::* res)
{
typedef std::map<boost::shared_ptr<socket>, boost::intrusive_ptr<peer_connection> >::iterator orig_iter;
typedef std::pair<boost::shared_ptr<socket>, boost::intrusive_ptr<peer_connection> > in_param;
typedef boost::transform_iterator<peer_connection& (*)(in_param const&), orig_iter> new_iter;
allocate_resources_impl(
resources
, new_iter(c.begin(), &pick_peer)
, new_iter(c.end(), &pick_peer)
, res);
}
*/
#if defined(_MSC_VER) && _MSC_VER < 1310
namespace detail