mirror of
https://github.com/asamy/ctorrent
synced 2025-10-05 23:52:41 +02:00
cleanup
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# CTorrent
|
# CTorrent
|
||||||
|
|
||||||
CTorrent is a torrent client written in C++11 with some help from Boost.
|
CTorrent is a torrent client written in C++11 with some help from Boost.
|
||||||
|

|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
8
main.cpp
8
main.cpp
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <chrono>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
@@ -223,17 +224,13 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!nodownload && started > 0) {
|
if (!nodownload && started > 0) {
|
||||||
int last = 0;
|
|
||||||
while (completed != total - errors) {
|
while (completed != total - errors) {
|
||||||
if (errors == total)
|
if (errors == total)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Connection::poll();
|
Connection::poll();
|
||||||
print_all_stats(torrents, total);
|
print_all_stats(torrents, total);
|
||||||
if (last == completed)
|
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||||
continue;
|
|
||||||
|
|
||||||
last = completed;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,6 +238,7 @@ int main(int argc, char *argv[])
|
|||||||
while (eseed != total) {
|
while (eseed != total) {
|
||||||
Connection::poll();
|
Connection::poll();
|
||||||
print_all_stats(torrents, total);
|
print_all_stats(torrents, total);
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user