mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 04:36:16 +00:00
* Changed RequestList so that it clears m_canceled when a non-canceled
piece is downloaded, and it no longer checks the whole dequeue for invalid transfers. * Fixed a bad exception in PeerConnectionBase::down_chunk_from_buffer(), it is supposed to check the buffer was used up only when the transfer is unfinished, not when finished. * Added --with-address-space to allow the user to change the address space size. Defaults to 1024 MB on 32 bit, 4096 MB on 64 bit archs. * Added a parameter to display::Manager::schedule_update that sets the minimum update interval. Normal updates use 50 msec, adjust_layout uses 0 msec. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@769 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -331,3 +331,24 @@ AC_DEFUN([TORRENT_WITHOUT_STATFS], [
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([TORRENT_WITH_ADDRESS_SPACE], [
|
||||||
|
AC_ARG_WITH(address-space,
|
||||||
|
AC_HELP_STRING([--with-address-space=MB], [Change the default address space size, default 1024 MB.]),
|
||||||
|
[
|
||||||
|
if test ! -z $withval -a "$withval" != "yes" -a "$withval" != "no"; then
|
||||||
|
AC_DEFINE_UNQUOTED(DEFAULT_ADDRESS_SPACE_SIZE, [$withval])
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR(--with-address-space requires a parameter.)
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_CHECK_SIZEOF(long)
|
||||||
|
|
||||||
|
if test "$ac_cv_sizeof_long" = "4"; then
|
||||||
|
AC_DEFINE(DEFAULT_ADDRESS_SPACE_SIZE, 4096, Default address space size.)
|
||||||
|
else
|
||||||
|
AC_DEFINE(DEFAULT_ADDRESS_SPACE_SIZE, 1024, Default address space size.)
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|||||||
@@ -66,19 +66,21 @@ void
|
|||||||
Manager::schedule(Window* w, rak::timer t) {
|
Manager::schedule(Window* w, rak::timer t) {
|
||||||
rak::priority_queue_erase(&m_scheduler, w->task_update());
|
rak::priority_queue_erase(&m_scheduler, w->task_update());
|
||||||
rak::priority_queue_insert(&m_scheduler, w->task_update(), t);
|
rak::priority_queue_insert(&m_scheduler, w->task_update(), t);
|
||||||
schedule_update();
|
schedule_update(50000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Manager::unschedule(Window* w) {
|
Manager::unschedule(Window* w) {
|
||||||
rak::priority_queue_erase(&m_scheduler, w->task_update());
|
rak::priority_queue_erase(&m_scheduler, w->task_update());
|
||||||
schedule_update();
|
schedule_update(50000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Manager::adjust_layout() {
|
Manager::adjust_layout() {
|
||||||
Canvas::redraw_std();
|
Canvas::redraw_std();
|
||||||
m_rootFrame.balance(0, 0, Canvas::get_screen_width(), Canvas::get_screen_height());
|
m_rootFrame.balance(0, 0, Canvas::get_screen_width(), Canvas::get_screen_height());
|
||||||
|
|
||||||
|
schedule_update(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -101,11 +103,11 @@ Manager::receive_update() {
|
|||||||
Canvas::do_update();
|
Canvas::do_update();
|
||||||
|
|
||||||
m_timeLastUpdate = cachedTime;
|
m_timeLastUpdate = cachedTime;
|
||||||
schedule_update();
|
schedule_update(50000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Manager::schedule_update() {
|
Manager::schedule_update(uint32_t minInterval) {
|
||||||
if (m_scheduler.empty()) {
|
if (m_scheduler.empty()) {
|
||||||
rak::priority_queue_erase(&taskScheduler, &m_taskUpdate);
|
rak::priority_queue_erase(&taskScheduler, &m_taskUpdate);
|
||||||
return;
|
return;
|
||||||
@@ -113,7 +115,7 @@ Manager::schedule_update() {
|
|||||||
|
|
||||||
if (!m_taskUpdate.is_queued() || m_taskUpdate.time() > m_scheduler.top()->time()) {
|
if (!m_taskUpdate.is_queued() || m_taskUpdate.time() > m_scheduler.top()->time()) {
|
||||||
rak::priority_queue_erase(&taskScheduler, &m_taskUpdate);
|
rak::priority_queue_erase(&taskScheduler, &m_taskUpdate);
|
||||||
rak::priority_queue_insert(&taskScheduler, &m_taskUpdate, std::max(m_scheduler.top()->time(), m_timeLastUpdate + 50000));
|
rak::priority_queue_insert(&taskScheduler, &m_taskUpdate, std::max(m_scheduler.top()->time(), m_timeLastUpdate + minInterval));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
Frame* root_frame() { return &m_rootFrame; }
|
Frame* root_frame() { return &m_rootFrame; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void schedule_update();
|
void schedule_update(uint32_t minInterval);
|
||||||
|
|
||||||
bool m_forceRedraw;
|
bool m_forceRedraw;
|
||||||
rak::timer m_timeLastUpdate;
|
rak::timer m_timeLastUpdate;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <torrent/file_list.h>
|
#include <torrent/file_list.h>
|
||||||
|
|
||||||
#include "display/frame.h"
|
#include "display/frame.h"
|
||||||
|
#include "display/manager.h"
|
||||||
#include "display/window_file_list.h"
|
#include "display/window_file_list.h"
|
||||||
#include "input/manager.h"
|
#include "input/manager.h"
|
||||||
|
|
||||||
@@ -77,6 +78,8 @@ ElementFileList::activate(display::Frame* frame, bool focus) {
|
|||||||
|
|
||||||
m_frame = frame;
|
m_frame = frame;
|
||||||
m_frame->initialize_window(m_window);
|
m_frame->initialize_window(m_window);
|
||||||
|
|
||||||
|
// control->display()->adjust_layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user