*** empty log message ***

This commit is contained in:
Arvid Norberg 2003-11-06 10:44:19 +00:00
parent f495117e39
commit 81289c9354
5 changed files with 15 additions and 13 deletions

View File

@ -149,7 +149,7 @@ int main(int argc, char* argv[])
if (argc < 2)
{
std::cerr << "usage: ./client_test torrent-files ...\n"
"to stop the client, type a number and press enter.\n";
"to stop the client, press q.\n";
return 1;
}
@ -222,8 +222,8 @@ int main(int argc, char* argv[])
i->get_peer_info(peers);
float down = 0.f;
float up = 0.f;
unsigned int total_down = 0;
unsigned int total_up = 0;
unsigned int total_down = s.total_download;
unsigned int total_up = s.total_upload;
int num_peers = peers.size();
for (std::vector<peer_info>::iterator i = peers.begin();
@ -232,8 +232,6 @@ int main(int argc, char* argv[])
{
down += i->down_speed;
up += i->up_speed;
total_down += i->total_download;
total_up += i->total_upload;
}
/*
std::cout << boost::format("%f%% p:%d d:(%s) %s/s u:(%s) %s/s\n")

View File

@ -85,7 +85,7 @@ namespace libtorrent
// workaround for microsofts
// hardware exceptions that makes
// it hard to debug stuff
#if defined(WIN32) && !defined(NDEBUG)
#if defined(_MSC_VER) && !defined(NDEBUG)
struct eh_initializer
{
eh_initializer()

View File

@ -249,8 +249,8 @@ namespace libtorrent
void parse_response(const entry& e, std::vector<peer>& peer_list);
// total amount of bytes uploaded, downloaded and
// the number of bytes left to be downloaded
// TODO: Replace with stat-object
// total amount of bytes uploaded, downloaded
entry::integer_type m_bytes_uploaded;
entry::integer_type m_bytes_downloaded;

View File

@ -422,9 +422,8 @@ namespace libtorrent
- blocks_per_piece;
}
// TODO: Implement total download and total_upload
st.total_download = 0;
st.total_upload = 0;
st.total_download = m_bytes_downloaded;
st.total_upload = m_bytes_uploaded;
st.progress = (blocks_we_have + unverified_blocks)
/ static_cast<float>(total_blocks);

View File

@ -69,13 +69,14 @@ namespace libtorrent
{
torrent_status st;
st.total_download = 0;
st.total_download = 0;
st.total_upload = 0;
st.progress = 0.f;
st.state = torrent_status::invalid_handle;
st.next_announce = boost::posix_time::time_duration();
return st;
}
assert(m_chk != 0);
{
boost::mutex::scoped_lock l(m_ses->m_mutex);
torrent* t = m_ses->find_torrent(m_info_hash);
@ -103,7 +104,7 @@ namespace libtorrent
torrent_status st;
st.total_download = 0;
st.total_download = 0;
st.total_upload = 0;
st.progress = 0.f;
st.state = torrent_status::invalid_handle;
st.next_announce = boost::posix_time::time_duration();
@ -114,6 +115,8 @@ namespace libtorrent
{
v.clear();
if (m_ses == 0) return;
assert(m_chk != 0);
boost::mutex::scoped_lock l(m_ses->m_mutex);
const torrent* t = m_ses->find_torrent(m_info_hash);
@ -151,6 +154,7 @@ namespace libtorrent
queue.clear();
if (m_ses == 0) return;
assert(m_chk != 0);
boost::mutex::scoped_lock l(m_ses->m_mutex);
torrent* t = m_ses->find_torrent(m_info_hash);
@ -183,6 +187,7 @@ namespace libtorrent
void torrent_handle::abort()
{
if (m_ses == 0) return;
assert(m_chk != 0);
{
boost::mutex::scoped_lock l(m_ses->m_mutex);