mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-15 13:46:17 +00:00
* Renamed read/write stuff to down/up.
* Adding incomplete PeerConnectionSeed. * For every new peer connection it would traverse the local bitfield to check if it was zero'ed, instead of using a cached value. Forgot to change over when changing it from the BitFieldExt to the normal class. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@547 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ echo aclocal...
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
aclocal
|
aclocal -I . ${ACLOCAL_FLAGS}
|
||||||
|
|
||||||
echo autoheader...
|
echo autoheader...
|
||||||
(autoheader --version) < /dev/null > /dev/null 2>&1 || {
|
(autoheader --version) < /dev/null > /dev/null 2>&1 || {
|
||||||
|
|||||||
+8
-13
@@ -37,19 +37,14 @@ AC_DEFUN([TORRENT_ENABLE_WERROR], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([TORRENT_ENABLE_UNSAFE_OPTIMIZATION], [
|
AC_DEFUN([TORRENT_ENABLE_EXTRA_DEBUG], [
|
||||||
AC_ARG_ENABLE(unsafe-optimization,
|
AC_ARG_ENABLE(extra-debug,
|
||||||
[ --enable-unsafe-optimization
|
[ --enable-extra-debug enable extra debugging checks. [default=no]],
|
||||||
enable unsafe optimization [default=yes]],
|
|
||||||
[
|
[
|
||||||
if test "$enableval" = "yes"; then
|
if test "$enableval" = "yes"; then
|
||||||
AC_DEFINE(USE_UNSAFE_OPTIMIZATION, 1, Enable possibly unsafe optimization techniques.)
|
AC_DEFINE(USE_EXTRA_DEBUG, 1, Enable extra debugging checks.)
|
||||||
else
|
|
||||||
AC_DEFINE(USE_UNSAFE_OPTIMIZATION, 0, Disable possibly unsafe optimization techniques.)
|
|
||||||
fi
|
fi
|
||||||
],[
|
])
|
||||||
AC_DEFINE(USE_UNSAFE_OPTIMIZATION, 0, Disable possibly unsafe optimization techniques.)
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -125,10 +120,10 @@ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
|
|||||||
AC_RUN_IFELSE(
|
AC_RUN_IFELSE(
|
||||||
[[#include <inttypes.h>
|
[[#include <inttypes.h>
|
||||||
int main() {
|
int main() {
|
||||||
char buf[5] = { 0, 0, 0, 0, 1 };
|
char buf[8] = { 0, 0, 0, 0, 1, 0, 0, 0 };
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 1; i < 4; ++i)
|
||||||
if (*(uint32_t*)(buf + 1) == 0) return -1;
|
if (*(uint32_t*)(buf + i) == 0) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
]],
|
]],
|
||||||
|
|||||||
@@ -116,7 +116,12 @@ Download::receive_storage_error(std::string msg) {
|
|||||||
torrent::Download::ConnectionType
|
torrent::Download::ConnectionType
|
||||||
Download::string_to_connection_type(const std::string& name) {
|
Download::string_to_connection_type(const std::string& name) {
|
||||||
// Return default if the name isn't found.
|
// Return default if the name isn't found.
|
||||||
return torrent::Download::CONNECTION_DEFAULT;
|
if (name == "default")
|
||||||
|
return torrent::Download::CONNECTION_DEFAULT;
|
||||||
|
else if (name == "seed")
|
||||||
|
return torrent::Download::CONNECTION_SEED;
|
||||||
|
else
|
||||||
|
throw std::runtime_error("Invalid connection type selected: \"" + name + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,9 +71,9 @@ print_download_info(char* buf, unsigned int length, core::Download* d) {
|
|||||||
(double)d->get_download().get_bytes_total() / (double)(1 << 20)));
|
(double)d->get_download().get_bytes_total() / (double)(1 << 20)));
|
||||||
|
|
||||||
buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KB Uploaded: %.1f MB",
|
buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KB Uploaded: %.1f MB",
|
||||||
(double)d->get_download().get_write_rate().rate() / (1 << 10),
|
(double)d->get_download().get_up_rate().rate() / (1 << 10),
|
||||||
(double)d->get_download().get_read_rate().rate() / (1 << 10),
|
(double)d->get_download().get_down_rate().rate() / (1 << 10),
|
||||||
(double)d->get_download().get_write_rate().total() / (1 << 20)));
|
(double)d->get_download().get_up_rate().total() / (1 << 20)));
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,10 +91,10 @@ WindowPeerInfo::redraw() {
|
|||||||
m_canvas->print(0, y++, "Done: %i%", done_percentage(**m_focus));
|
m_canvas->print(0, y++, "Done: %i%", done_percentage(**m_focus));
|
||||||
|
|
||||||
m_canvas->print(0, y++, "Rate: %5.1f/%5.1f KB Total: %.1f/%.1f MB",
|
m_canvas->print(0, y++, "Rate: %5.1f/%5.1f KB Total: %.1f/%.1f MB",
|
||||||
(double)(*m_focus)->get_write_rate().rate() / (double)(1 << 10),
|
(double)(*m_focus)->get_up_rate().rate() / (double)(1 << 10),
|
||||||
(double)(*m_focus)->get_read_rate().rate() / (double)(1 << 10),
|
(double)(*m_focus)->get_down_rate().rate() / (double)(1 << 10),
|
||||||
(double)(*m_focus)->get_write_rate().total() / (double)(1 << 20),
|
(double)(*m_focus)->get_up_rate().total() / (double)(1 << 20),
|
||||||
(double)(*m_focus)->get_read_rate().total() / (double)(1 << 20));
|
(double)(*m_focus)->get_down_rate().total() / (double)(1 << 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ WindowPeerList::redraw() {
|
|||||||
p.get_dns().c_str());
|
p.get_dns().c_str());
|
||||||
x += 18;
|
x += 18;
|
||||||
|
|
||||||
m_canvas->print(x, y, "%.1f", (double)p.get_write_rate().rate() / 1024); x += 7;
|
m_canvas->print(x, y, "%.1f", (double)p.get_up_rate().rate() / 1024); x += 7;
|
||||||
m_canvas->print(x, y, "%.1f", (double)p.get_read_rate().rate() / 1024); x += 7;
|
m_canvas->print(x, y, "%.1f", (double)p.get_down_rate().rate() / 1024); x += 7;
|
||||||
m_canvas->print(x, y, "%.1f", (double)p.get_peer_rate().rate() / 1024); x += 7;
|
m_canvas->print(x, y, "%.1f", (double)p.get_peer_rate().rate() / 1024); x += 7;
|
||||||
|
|
||||||
m_canvas->print(x, y, "%c/%c%c/%c%c",
|
m_canvas->print(x, y, "%c/%c%c/%c%c",
|
||||||
|
|||||||
@@ -62,20 +62,20 @@ WindowStatusbar::redraw() {
|
|||||||
int pos = 0;
|
int pos = 0;
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
if (torrent::get_write_throttle() == 0)
|
if (torrent::get_up_throttle() == 0)
|
||||||
pos = snprintf(buf, 128, "off/");
|
pos = snprintf(buf, 128, "off/");
|
||||||
else
|
else
|
||||||
pos = snprintf(buf, 128, "%3i/", torrent::get_write_throttle() / 1024);
|
pos = snprintf(buf, 128, "%3i/", torrent::get_up_throttle() / 1024);
|
||||||
|
|
||||||
if (torrent::get_read_throttle() == 0)
|
if (torrent::get_down_throttle() == 0)
|
||||||
pos = snprintf(buf + pos, 128 - pos, "off");
|
pos = snprintf(buf + pos, 128 - pos, "off");
|
||||||
else
|
else
|
||||||
pos = snprintf(buf + pos, 128 - pos, "%-3i", torrent::get_read_throttle() / 1024);
|
pos = snprintf(buf + pos, 128 - pos, "%-3i", torrent::get_down_throttle() / 1024);
|
||||||
|
|
||||||
m_canvas->print(0, 0, "Throttle U/D: %s Rate: %5.1f / %5.1f KB Listen: %s:%i%s",
|
m_canvas->print(0, 0, "Throttle U/D: %s Rate: %5.1f / %5.1f KB Listen: %s:%i%s",
|
||||||
buf,
|
buf,
|
||||||
(double)torrent::get_write_rate().rate() / 1024.0,
|
(double)torrent::get_up_rate().rate() / 1024.0,
|
||||||
(double)torrent::get_read_rate().rate() / 1024.0,
|
(double)torrent::get_down_rate().rate() / 1024.0,
|
||||||
!torrent::get_local_address().empty() ? torrent::get_local_address().c_str() : "<default>",
|
!torrent::get_local_address().empty() ? torrent::get_local_address().c_str() : "<default>",
|
||||||
(int)torrent::get_listen_port(),
|
(int)torrent::get_listen_port(),
|
||||||
!torrent::get_bind_address().empty() ? (" Bind: " + torrent::get_bind_address()).c_str() : "");
|
!torrent::get_bind_address().empty() ? (" Bind: " + torrent::get_bind_address()).c_str() : "");
|
||||||
|
|||||||
@@ -149,12 +149,12 @@ apply_connection_seed(ui::Control* m, const std::string& arg) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
apply_global_download_rate(ui::Control* m, int arg) {
|
apply_global_download_rate(ui::Control* m, int arg) {
|
||||||
torrent::set_read_throttle(arg * 1024);
|
torrent::set_down_throttle(arg * 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
apply_global_upload_rate(ui::Control* m, int arg) {
|
apply_global_upload_rate(ui::Control* m, int arg) {
|
||||||
torrent::set_write_throttle(arg * 1024);
|
torrent::set_up_throttle(arg * 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
+16
-16
@@ -92,36 +92,36 @@ void
|
|||||||
Root::setup_keys() {
|
Root::setup_keys() {
|
||||||
m_control->get_input().push_back(&m_bindings);
|
m_control->get_input().push_back(&m_bindings);
|
||||||
|
|
||||||
m_bindings['a'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_write_throttle), 1);
|
m_bindings['a'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_up_throttle), 1);
|
||||||
m_bindings['z'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_write_throttle), -1);
|
m_bindings['z'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_up_throttle), -1);
|
||||||
m_bindings['s'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_write_throttle), 5);
|
m_bindings['s'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_up_throttle), 5);
|
||||||
m_bindings['x'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_write_throttle), -5);
|
m_bindings['x'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_up_throttle), -5);
|
||||||
m_bindings['d'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_write_throttle), 50);
|
m_bindings['d'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_up_throttle), 50);
|
||||||
m_bindings['c'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_write_throttle), -50);
|
m_bindings['c'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_up_throttle), -50);
|
||||||
|
|
||||||
m_bindings['A'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_read_throttle), 1);
|
m_bindings['A'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_down_throttle), 1);
|
||||||
m_bindings['Z'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_read_throttle), -1);
|
m_bindings['Z'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_down_throttle), -1);
|
||||||
m_bindings['S'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_read_throttle), 5);
|
m_bindings['S'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_down_throttle), 5);
|
||||||
m_bindings['X'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_read_throttle), -5);
|
m_bindings['X'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_down_throttle), -5);
|
||||||
m_bindings['D'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_read_throttle), 50);
|
m_bindings['D'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_down_throttle), 50);
|
||||||
m_bindings['C'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_read_throttle), -50);
|
m_bindings['C'] = sigc::bind(sigc::mem_fun(*this, &Root::receive_down_throttle), -50);
|
||||||
|
|
||||||
m_bindings[KEY_RESIZE] = sigc::mem_fun(m_control->get_display(), &display::Manager::adjust_layout);
|
m_bindings[KEY_RESIZE] = sigc::mem_fun(m_control->get_display(), &display::Manager::adjust_layout);
|
||||||
m_bindings['\x11'] = sigc::mem_fun(*m_control, &Control::receive_shutdown);
|
m_bindings['\x11'] = sigc::mem_fun(*m_control, &Control::receive_shutdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Root::receive_read_throttle(int t) {
|
Root::receive_down_throttle(int t) {
|
||||||
m_windowStatusbar->mark_dirty();
|
m_windowStatusbar->mark_dirty();
|
||||||
|
|
||||||
torrent::set_read_throttle(torrent::get_read_throttle() + t * 1024);
|
torrent::set_down_throttle(torrent::get_down_throttle() + t * 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Root::receive_write_throttle(int t) {
|
Root::receive_up_throttle(int t) {
|
||||||
m_windowStatusbar->mark_dirty();
|
m_windowStatusbar->mark_dirty();
|
||||||
|
|
||||||
torrent::set_write_throttle(torrent::get_write_throttle() + t * 1024);
|
torrent::set_up_throttle(torrent::get_up_throttle() + t * 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -62,8 +62,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
void setup_keys();
|
void setup_keys();
|
||||||
|
|
||||||
void receive_read_throttle(int t);
|
void receive_down_throttle(int t);
|
||||||
void receive_write_throttle(int t);
|
void receive_up_throttle(int t);
|
||||||
|
|
||||||
Control* m_control;
|
Control* m_control;
|
||||||
DownloadList* m_downloadList;
|
DownloadList* m_downloadList;
|
||||||
|
|||||||
Reference in New Issue
Block a user