*** empty log message ***
This commit is contained in:
@@ -149,7 +149,7 @@ int main(int argc, char* argv[])
|
|||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
std::cerr << "usage: ./client_test torrent-files ...\n"
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,8 +222,8 @@ int main(int argc, char* argv[])
|
|||||||
i->get_peer_info(peers);
|
i->get_peer_info(peers);
|
||||||
float down = 0.f;
|
float down = 0.f;
|
||||||
float up = 0.f;
|
float up = 0.f;
|
||||||
unsigned int total_down = 0;
|
unsigned int total_down = s.total_download;
|
||||||
unsigned int total_up = 0;
|
unsigned int total_up = s.total_upload;
|
||||||
int num_peers = peers.size();
|
int num_peers = peers.size();
|
||||||
|
|
||||||
for (std::vector<peer_info>::iterator i = peers.begin();
|
for (std::vector<peer_info>::iterator i = peers.begin();
|
||||||
@@ -232,8 +232,6 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
down += i->down_speed;
|
down += i->down_speed;
|
||||||
up += i->up_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")
|
std::cout << boost::format("%f%% p:%d d:(%s) %s/s u:(%s) %s/s\n")
|
||||||
|
@@ -85,7 +85,7 @@ namespace libtorrent
|
|||||||
// workaround for microsofts
|
// workaround for microsofts
|
||||||
// hardware exceptions that makes
|
// hardware exceptions that makes
|
||||||
// it hard to debug stuff
|
// it hard to debug stuff
|
||||||
#if defined(WIN32) && !defined(NDEBUG)
|
#if defined(_MSC_VER) && !defined(NDEBUG)
|
||||||
struct eh_initializer
|
struct eh_initializer
|
||||||
{
|
{
|
||||||
eh_initializer()
|
eh_initializer()
|
||||||
|
@@ -249,8 +249,8 @@ namespace libtorrent
|
|||||||
|
|
||||||
void parse_response(const entry& e, std::vector<peer>& peer_list);
|
void parse_response(const entry& e, std::vector<peer>& peer_list);
|
||||||
|
|
||||||
// total amount of bytes uploaded, downloaded and
|
// TODO: Replace with stat-object
|
||||||
// the number of bytes left to be downloaded
|
// total amount of bytes uploaded, downloaded
|
||||||
entry::integer_type m_bytes_uploaded;
|
entry::integer_type m_bytes_uploaded;
|
||||||
entry::integer_type m_bytes_downloaded;
|
entry::integer_type m_bytes_downloaded;
|
||||||
|
|
||||||
|
@@ -422,9 +422,8 @@ namespace libtorrent
|
|||||||
- blocks_per_piece;
|
- blocks_per_piece;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Implement total download and total_upload
|
st.total_download = m_bytes_downloaded;
|
||||||
st.total_download = 0;
|
st.total_upload = m_bytes_uploaded;
|
||||||
st.total_upload = 0;
|
|
||||||
st.progress = (blocks_we_have + unverified_blocks)
|
st.progress = (blocks_we_have + unverified_blocks)
|
||||||
/ static_cast<float>(total_blocks);
|
/ static_cast<float>(total_blocks);
|
||||||
|
|
||||||
|
@@ -69,13 +69,14 @@ namespace libtorrent
|
|||||||
{
|
{
|
||||||
torrent_status st;
|
torrent_status st;
|
||||||
st.total_download = 0;
|
st.total_download = 0;
|
||||||
st.total_download = 0;
|
st.total_upload = 0;
|
||||||
st.progress = 0.f;
|
st.progress = 0.f;
|
||||||
st.state = torrent_status::invalid_handle;
|
st.state = torrent_status::invalid_handle;
|
||||||
st.next_announce = boost::posix_time::time_duration();
|
st.next_announce = boost::posix_time::time_duration();
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(m_chk != 0);
|
||||||
{
|
{
|
||||||
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);
|
||||||
@@ -103,7 +104,7 @@ namespace libtorrent
|
|||||||
|
|
||||||
torrent_status st;
|
torrent_status st;
|
||||||
st.total_download = 0;
|
st.total_download = 0;
|
||||||
st.total_download = 0;
|
st.total_upload = 0;
|
||||||
st.progress = 0.f;
|
st.progress = 0.f;
|
||||||
st.state = torrent_status::invalid_handle;
|
st.state = torrent_status::invalid_handle;
|
||||||
st.next_announce = boost::posix_time::time_duration();
|
st.next_announce = boost::posix_time::time_duration();
|
||||||
@@ -114,6 +115,8 @@ namespace libtorrent
|
|||||||
{
|
{
|
||||||
v.clear();
|
v.clear();
|
||||||
if (m_ses == 0) return;
|
if (m_ses == 0) return;
|
||||||
|
assert(m_chk != 0);
|
||||||
|
|
||||||
boost::mutex::scoped_lock l(m_ses->m_mutex);
|
boost::mutex::scoped_lock l(m_ses->m_mutex);
|
||||||
|
|
||||||
const torrent* t = m_ses->find_torrent(m_info_hash);
|
const torrent* t = m_ses->find_torrent(m_info_hash);
|
||||||
@@ -151,6 +154,7 @@ namespace libtorrent
|
|||||||
queue.clear();
|
queue.clear();
|
||||||
|
|
||||||
if (m_ses == 0) return;
|
if (m_ses == 0) return;
|
||||||
|
assert(m_chk != 0);
|
||||||
|
|
||||||
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);
|
||||||
@@ -183,6 +187,7 @@ namespace libtorrent
|
|||||||
void torrent_handle::abort()
|
void torrent_handle::abort()
|
||||||
{
|
{
|
||||||
if (m_ses == 0) return;
|
if (m_ses == 0) return;
|
||||||
|
assert(m_chk != 0);
|
||||||
|
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock l(m_ses->m_mutex);
|
boost::mutex::scoped_lock l(m_ses->m_mutex);
|
||||||
|
Reference in New Issue
Block a user