*** empty log message ***
This commit is contained in:
parent
dced8aa172
commit
d99762f0b0
|
@ -569,6 +569,7 @@ fields::
|
|||
peer_id id;
|
||||
std::vector<bool> pieces;
|
||||
int upload_limit;
|
||||
int upload_ceiling;
|
||||
};
|
||||
|
||||
The ``flags`` attribute tells you in which state the peer is. It is set to
|
||||
|
@ -600,6 +601,9 @@ or if the peer miss that piece (set to false).
|
|||
peer every second. It may be -1 if there's no limit. The upload limits of all peers
|
||||
should sum up to the upload limit set by ``session::set_upload_limit``.
|
||||
|
||||
``upload_ceiling`` is the current maximum allowed upload rate given the cownload
|
||||
rate and share ratio. If the global upload rate is inlimited, the ``upload_limit``
|
||||
for every peer will be the same as their ``upload_ceiling``.
|
||||
|
||||
get_torrent_info()
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -75,7 +75,7 @@ void clear()
|
|||
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
COORD c = {0, 0};
|
||||
DWORD n;
|
||||
FillConsoleOutputCharacter(h, ' ', 80 * 50, c, &n);
|
||||
FillConsoleOutputCharacter(h, ' ', 80 * 80, c, &n);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -197,7 +197,7 @@ int main(int argc, char* argv[])
|
|||
entry e = bdecode(std::istream_iterator<char>(in), std::istream_iterator<char>());
|
||||
torrent_info t(e);
|
||||
t.print(std::cout);
|
||||
handles.push_back(s.add_torrent(t, boost::filesystem::path("", boost::filesystem::native)));
|
||||
handles.push_back(s.add_torrent(t, ""));
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
|
@ -256,6 +256,9 @@ int main(int argc, char* argv[])
|
|||
% add_suffix(total_up)
|
||||
% add_suffix(up);
|
||||
*/
|
||||
std::cout.precision(4);
|
||||
std::cout.width(5);
|
||||
std::cout.fill(' ');
|
||||
std::cout << (s.progress*100) << "% ";
|
||||
for (int i = 0; i < 50; ++i)
|
||||
{
|
||||
|
@ -279,10 +282,13 @@ int main(int argc, char* argv[])
|
|||
i != peers.end();
|
||||
++i)
|
||||
{
|
||||
std::cout << "d: " << add_suffix(i->down_speed) << "/s (" << add_suffix(i->total_download)
|
||||
<< ") u: " << add_suffix(i->up_speed) << "/s (" << add_suffix(i->total_upload)
|
||||
<< ") df: " << add_suffix((int)i->total_download - (int)i->total_upload)
|
||||
<< " f: "
|
||||
std::cout << "d: " << add_suffix(i->down_speed) << "/s "
|
||||
<< "(" << add_suffix(i->total_download) << ") "
|
||||
<< "u: " << add_suffix(i->up_speed) << "/s "
|
||||
<< "(" << add_suffix(i->total_upload) << ") "
|
||||
<< "df: " << add_suffix((int)i->total_download - (int)i->total_upload) << " "
|
||||
<< "l: " << add_suffix(i->upload_ceiling) << "/s "
|
||||
<< "f: "
|
||||
<< static_cast<const char*>((i->flags & peer_info::interesting)?"I":"_")
|
||||
<< static_cast<const char*>((i->flags & peer_info::choked)?"C":"_")
|
||||
<< static_cast<const char*>((i->flags & peer_info::remote_interested)?"i":"_")
|
||||
|
|
|
@ -57,6 +57,7 @@ namespace libtorrent
|
|||
peer_id id;
|
||||
std::vector<bool> pieces;
|
||||
int upload_limit;
|
||||
int upload_ceiling;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -352,7 +352,7 @@ namespace libtorrent
|
|||
{
|
||||
// if we're interested in the peer, we unchoke it
|
||||
// and hopes it will unchoke us too
|
||||
if (c.is_interesting) c.unchoke();
|
||||
if (c.is_interesting()) c.unchoke();
|
||||
}
|
||||
|
||||
void policy::not_interested(peer_connection& c)
|
||||
|
|
|
@ -209,6 +209,7 @@ namespace libtorrent
|
|||
p.total_upload = statistics.total_upload();
|
||||
|
||||
p.upload_limit = peer->send_quota();
|
||||
p.upload_ceiling = peer->send_quota_limit();
|
||||
|
||||
p.flags = 0;
|
||||
if (peer->is_interesting()) p.flags |= peer_info::interesting;
|
||||
|
|
Loading…
Reference in New Issue