mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 21:22:31 +00:00
* Add support for any number of custom download values identified by string keys.
d.set_custom=key,value d.get_custom=key (returns "" if not set) d.get_custom_throw=key (returns error if not set) * With this patch, rtorrent will detect and complain about .torrent files with broken bencode representation (e.g. where the order of dictionary keys is not lexicographic). * Choose a different poll type using the RTORRENT_POLL env. variable (if it's implemented), probably only useful as RTORRENT_POLL=select. * Add the commands execute_capture and execute_capture_nothrow that work like their other counterparts but return the OUTPUT (stdout) of the given command. Note that the output is not modified in any way, in particular a trailing newline is NOT removed. To work around this, have the command write its output without it e.g. using echo -n. Also note that with execute_capture_nothrow there is no way to check if the command failed. Example usage: d.set_custom4=$execute_capture=handler.sh * When logging peer communication errors, show IP and peer ID to help debugging. All patches above by Josef Drexler. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1088 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+17
-1
@@ -187,7 +187,23 @@ Manager::set_hashing_view(View* v) {
|
||||
|
||||
void
|
||||
Manager::initialize_first() {
|
||||
if ((m_pollManager = PollManagerEPoll::create(sysconf(_SC_OPEN_MAX))) != NULL)
|
||||
const char* poll = getenv("RTORRENT_POLL");
|
||||
if (poll != NULL) {
|
||||
if (!strcmp(poll, "epoll"))
|
||||
m_pollManager = PollManagerEPoll::create(sysconf(_SC_OPEN_MAX));
|
||||
else if (!strcmp(poll, "kqueue"))
|
||||
m_pollManager = PollManagerKQueue::create(sysconf(_SC_OPEN_MAX));
|
||||
else if (!strcmp(poll, "select"))
|
||||
m_pollManager = PollManagerSelect::create(sysconf(_SC_OPEN_MAX));
|
||||
|
||||
if (m_pollManager == NULL)
|
||||
m_logImportant.push_front(std::string("Cannot enable '") + poll + "' based polling.");
|
||||
}
|
||||
|
||||
if (m_pollManager != NULL)
|
||||
m_logImportant.push_front(std::string("Using '") + poll + "' based polling.");
|
||||
|
||||
else if ((m_pollManager = PollManagerEPoll::create(sysconf(_SC_OPEN_MAX))) != NULL)
|
||||
m_logImportant.push_front("Using 'epoll' based polling.");
|
||||
|
||||
else if ((m_pollManager = PollManagerKQueue::create(sysconf(_SC_OPEN_MAX))) != NULL)
|
||||
|
||||
Reference in New Issue
Block a user