*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-02-24 23:55:42 +00:00
parent ed7c5e6d13
commit 6d614bc6d3
8 changed files with 54 additions and 13 deletions

View File

@ -135,13 +135,13 @@ boost.filesystem, boost.date_time and various other boost libraries as well as z
<li>Windows 2000 vc7.1</li>
<li>Linux x86 (debian) GCC 3.0.4, GCC 3.2.3</li>
<li>Windows 2000, msvc6 sp5 (does not support 64-bit values due to problems with operator&lt;&lt;(ostream&amp;, __int64))</li>
<li>Cygwin GCC 3.3.1</li>
</ul>
</blockquote>
<p>Fails on:</p>
<blockquote>
<ul class="simple">
<li>Linux x86 (Debian) GCC 2.95.4 (<tt class="literal"><span class="pre">std::ios_base</span></tt> is missing)</li>
<li>Cygwin GCC 3.3.1 (compiles but crashes)</li>
<li>GCC 2.95.4 (<tt class="literal"><span class="pre">std::ios_base</span></tt> is missing)</li>
</ul>
</blockquote>
<p>libtorrent is released under the <a class="reference" href="http://www.opensource.org/licenses/bsd-license.php">BSD-license</a>.</p>
@ -166,6 +166,14 @@ bjam &lt;toolset&gt;
&quot;force conformance in for loop scope&quot; and &quot;treat wchar_t as built-in type&quot; to Yes.</p>
<p>If you're building in developer studio 6, you will probably have to use the previous
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>
<p>There are two versions of the socket code, one that works with unix systems (and bsd-sockets) and
one that uses winsock. If you're building in windows, the file <tt class="literal"><span class="pre">socket_win.cpp</span></tt> is supposed to
be included in the build while <tt class="literal"><span class="pre">socket_bsd.cpp</span></tt> is supposed to be excluded.</p>
<p>The file abstraction has the same kind of separation. There's one <tt class="literal"><span class="pre">file_win.cpp</span></tt> which
relies on windows file API that supports files larger than 2 Gigabytes. This does not work
in vc6 for some reason, possibly because it may require windows NT and above. The other file,
<tt class="literal"><span class="pre">file.cpp</span></tt> is the default implementation that simply relies on the standard library's fstream,
and as a result does not support files larger than 2 Gigabytes.</p>
<div class="section" id="release-and-debug-builds">
<h2><a name="release-and-debug-builds">release and debug builds</a></h2>
<p>The <tt class="literal"><span class="pre">Jamfile</span></tt> can build both a release and debug version of libtorrent. In debug mode,

View File

@ -116,6 +116,16 @@ version of boost, `boost 1.30.2`__.
__ http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&release_id=178835
There are two versions of the socket code, one that works with unix systems (and bsd-sockets) and
one that uses winsock. If you're building in windows, the file ``socket_win.cpp`` is supposed to
be included in the build while ``socket_bsd.cpp`` is supposed to be excluded.
The file abstraction has the same kind of separation. There's one ``file_win.cpp`` which
relies on windows file API that supports files larger than 2 Gigabytes. This does not work
in vc6 for some reason, possibly because it may require windows NT and above. The other file,
``file.cpp`` is the default implementation that simply relies on the standard library's fstream,
and as a result does not support files larger than 2 Gigabytes.
release and debug builds
------------------------

View File

@ -401,7 +401,7 @@ int main(int argc, char* argv[])
// << static_cast<const char*>((i->flags & peer_info::supports_extensions)?"e":"_")
// << static_cast<const char*>((i->flags & peer_info::local_connection)?"l":"r")
<< "\n";
/*
if (i->downloading_piece_index >= 0)
{
out.width(5);
@ -413,9 +413,9 @@ int main(int argc, char* argv[])
, 50);
out << "\n";
}
*/
}
/*
out << "___________________________________\n";
i->get_download_queue(queue);
@ -436,7 +436,7 @@ int main(int argc, char* argv[])
}
out << "___________________________________\n";
*/
}
for (std::deque<std::string>::iterator i = events.begin();

View File

@ -187,6 +187,8 @@ namespace libtorrent
bool verify_piece(const peer_request& p) const;
const stat& statistics() const { return m_statistics; }
void add_stat(size_type downloaded, size_type uploaded)
{ m_statistics.add_stat(downloaded, uploaded); }
// is called once every second by the main loop
void second_tick();

View File

@ -124,6 +124,12 @@ namespace libtorrent
size_type total_protocol_upload() const { return m_total_upload_protocol; }
size_type total_protocol_download() const { return m_total_download_protocol; }
void add_stat(size_type downloaded, size_type uploaded)
{
m_total_download_payload += downloaded;
m_total_upload_payload += uploaded;
}
private:
#ifndef NDEBUG

View File

@ -153,7 +153,13 @@ namespace libtorrent
// 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() const;
// TODO: support pause/resume
// that will not delete the torrent or its
// policy. If those are deleted all share
// ratios to all clients are lost, we don't
// want that.
// forces this torrent to reannounce
// (make a rerequest from the tracker)

View File

@ -487,6 +487,9 @@ namespace libtorrent
{
using namespace boost::posix_time;
// TODO: we must also remove peers that
// we failed to connect to from this list
// to avoid being part of a DDOS-attack
// remove old disconnected peers from the list
m_peers.erase(
std::remove_if(m_peers.begin()
@ -719,9 +722,12 @@ namespace libtorrent
}
assert(i->connection == 0);
c.add_stat(i->prev_amount_download, i->prev_amount_upload);
i->prev_amount_download = 0;
i->prev_amount_upload = 0;
i->connection = &c;
i->connected = boost::posix_time::second_clock::local_time();
m_last_optimistic_disconnect=boost::posix_time::second_clock::local_time();
m_last_optimistic_disconnect = boost::posix_time::second_clock::local_time();
}
void policy::peer_from_tracker(const address& remote, const peer_id& id)
@ -906,6 +912,9 @@ namespace libtorrent
assert(p->type==peer::connectable);
p->connection = &m_torrent->connect_to_peer(p->id);
p->connection->add_stat(p->prev_amount_download, p->prev_amount_upload);
p->prev_amount_download = 0;
p->prev_amount_upload = 0;
p->connected = boost::posix_time::second_clock::local_time();
return true;
}
@ -1015,8 +1024,8 @@ namespace libtorrent
{
if (connection != 0)
{
return connection->statistics().total_payload_download()
+ prev_amount_download;
assert(prev_amount_download == 0);
return connection->statistics().total_payload_download();
}
else
{
@ -1028,8 +1037,8 @@ namespace libtorrent
{
if (connection != 0)
{
return connection->statistics().total_payload_upload()
+ prev_amount_upload;
assert(prev_amount_upload == 0);
return connection->statistics().total_payload_upload();
}
else
{

View File

@ -225,7 +225,7 @@ namespace libtorrent
return false;
}
entry torrent_handle::write_resume_data()
entry torrent_handle::write_resume_data() const
{
std::vector<int> piece_index;
if (m_ses == 0)