* 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:
rakshasa
2009-05-13 09:39:00 +00:00
parent 6753b45627
commit 3c670a7add
6 changed files with 113 additions and 11 deletions
+3 -1
View File
@@ -48,18 +48,20 @@ public:
static const int flag_expand_tilde = 0x1;
static const int flag_throw = 0x2;
static const int flag_capture = 0x4;
ExecFile() : m_logFd(-1) {}
int log_fd() const { return m_logFd; }
void set_log_fd(int fd) { m_logFd = fd; }
int execute(const char* file, char* const* argv);
int execute(const char* file, char* const* argv, int flags);
torrent::Object execute_object(const torrent::Object& rawArgs, int flags);
private:
int m_logFd;
std::string m_capture;
};
}