Commit Graph

784 Commits

Author SHA1 Message Date
rakshasa 28aabb7874 * Reordered Makefile.am entries to fix linking errors.
* Changed more commands to std::tr1::bind.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1151 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-23 11:24:27 +00:00
rakshasa 83e993a1eb * Added missing command_new_slot.{cc,h} files.
* Converted more commands.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1150 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-21 09:45:45 +00:00
rakshasa 8622100e09 * Added a new Command type based on std::tr1::function aimed at replacing the current ones.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1149 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-19 09:33:25 +00:00
rakshasa ee5b0819a1 * Added 'system.files.{opened,closed,failed}_counter' commands.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1148 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-17 06:45:00 +00:00
rakshasa 589c8c147b * Cleaned up torrent/download.h.
* Removed raw_value as it is redundant.

* Fixed 'greater' command and added 'equal'. Patch by Josef Drexler.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1146 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-15 23:31:58 +00:00
rakshasa c5e839287d * Cleaned up torrent/download.h.
* Removed raw_value as it is redundant.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1145 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-15 18:31:50 +00:00
rakshasa 19be810642 * Added '-D' flag which turns of redirects for deprecated commands. Use this to ensure your scripts/webui.
* Moved DownloadInfo to src/torrent.

* Applied the magnet-uri patch.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1144 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-15 16:42:05 +00:00
rakshasa ded689d3ff * Fixed the linux fallocate detection script.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1143 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-12 10:29:11 +00:00
rakshasa df4c0ce67b * Optimized bencode read skip function.
* Fixed various bugs in the new dht/static map implementation.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1140 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-04 17:35:46 +00:00
rakshasa 44e77016a9 * Renamed 'system.method.*' to 'method.*'.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1139 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-03 13:45:34 +00:00
rakshasa db8f217569 * Commited the DHT changes from dht-pex-static_map.diff with changes so it works with the modified static_map implementation.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1138 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-03 11:52:01 +00:00
rakshasa 806941b6c7 * Added a static_map implementation based on Josef's patches.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1136 e378c898-3ddf-0310-93e7-cc216c733640
2010-03-01 07:45:54 +00:00
rakshasa 6fe6dcd8d8 * Fixed session file loading.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1135 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-19 15:05:33 +00:00
rakshasa 49cbbad5d7 * Make the torrent::Object immediately after loading a file to lower memory footprint.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1133 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-18 06:26:06 +00:00
rakshasa 0a76faa427 * Copy a torrent to std::stringstream instead of keeping a fstream open. This ensures rtorrent doesn't run out of file descriptors during launch.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1132 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-17 17:18:54 +00:00
rakshasa 3cae3d37be * Cleaning up command names. The deprecated commands will be redirected.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1131 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-16 17:29:53 +00:00
rakshasa 31abf85846 * Added support for Linux's fallocate and Darwin's fcntl(...,F_PREALLOCATE,...) to preallocate files by default. The 'system.file_allocate' setting will now only be used to indicate you want posix_fallocate called, which may block while it zeros out the file manually.
* Added 'event.download.hash_failed' and 'event.download.hash_final_failed'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1130 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-14 01:20:20 +00:00
rakshasa 8954393e52 * Don't recheck hashes of from 'uncertain_pieces' resume data when closing/resuming a torrent within the same session.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1129 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-11 15:45:56 +00:00
rakshasa 6796e9ad34 * Added missing <sys/types.h> includes. Patch by Artifex Maximus.
* Changed torrent::Object to use placement new instead of a pointer to std::string/list/map.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1128 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-11 03:39:13 +00:00
rakshasa 222bf7ae8f * Better handling of resume after crash/reboot. Sponsored by anonymous source.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1126 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-08 19:41:46 +00:00
rakshasa 2d3e12387d * Check if the thread is active before sending a signal.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1124 e378c898-3ddf-0310-93e7-cc216c733640
2010-02-02 23:17:49 +00:00
rakshasa 588f9e80c7 * Threaded XMLRPC support. Sponsored by Xirvik.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1123 e378c898-3ddf-0310-93e7-cc216c733640
2010-01-25 13:14:09 +00:00
rakshasa 83ea813245 * Fixed system.method.{set,find}_key commands.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1122 e378c898-3ddf-0310-93e7-cc216c733640
2010-01-20 18:11:58 +00:00
rakshasa 5ad2eff8c9 * Allow interrupting a thread's polling through SIGUSR1. Used to signal events across threads.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1121 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-30 07:27:43 +00:00
rakshasa 027edf9dcd * Discard dht cache if it is corrupt, instead of killing rtorrent.
* Minor fixes to the configure script.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1120 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-30 01:29:20 +00:00
rakshasa 8987be3001 * Fixed some minor compiler warnings/errors.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1119 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-26 11:16:21 +00:00
rakshasa 6188d110c5 * Added a flag to torrent::Poll that lets us set which Poll objects should waive the global lock.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1118 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-24 10:53:52 +00:00
rakshasa 2c7563825c * Added shutdown for worker thread.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1117 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-22 03:29:47 +00:00
rakshasa 5a1d0be323 * Use the safe default cacheline settings for all platforms for now.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1116 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-19 21:36:44 +00:00
rakshasa 5470e50ffb * Added autoconf support for cacheline_aligned and SMP_CACHE_BYTES.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1115 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-18 21:56:14 +00:00
rakshasa 2304983f4f * Finished the foundation of threading.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1114 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-15 21:39:35 +00:00
rakshasa 6a94909647 * More work on the threading stuff.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1113 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-14 21:18:51 +00:00
rakshasa b635f8c852 * More work on threading.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1112 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-12 21:30:52 +00:00
rakshasa ef6e4deca9 * Foundation for multi-threaded support.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1111 e378c898-3ddf-0310-93e7-cc216c733640
2009-12-12 15:32:04 +00:00
rakshasa d71e0ccf9a * Bumped version to 0.8.6/0.12.6.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1106 e378c898-3ddf-0310-93e7-cc216c733640
2009-11-30 15:08:17 +00:00
rakshasa 76fd429f89 * Changed the ctor for rt_triple to a non-template version.
* Made torrent::Rate::rate_type uint64_t and added sanity checks due to reports of bad download/upload values being reported to some trackers.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1103 e378c898-3ddf-0310-93e7-cc216c733640
2009-11-16 14:02:24 +00:00
rakshasa 3359c2bbb0 * Some commands were not using the new "log.tracker" name. Ticket #1888.
* Fixed crash on empty bitfield in 'd.bitfield'.

* Fixes a file handle leak in the execute_capture functions. Patch by Josef Drexler.

* Moved ThreadBase to ./src as ./src/utils caused linker problems due to core::PollManager::create_poll_manager().


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1102 e378c898-3ddf-0310-93e7-cc216c733640
2009-11-15 06:36:01 +00:00
rakshasa 667c4c3562 * Created ThreadBase holding poll manager, etc, and added a this_thread global object.
* Cleaned up main initialization, SCGI and polling code.

* Fixed a bug that would cause reading of a piece to hang if the incoming data contains only data up to the file boundary, but not the next file's data. The bug did not trigger if the file boundary and piece boundaries were the same.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1101 e378c898-3ddf-0310-93e7-cc216c733640
2009-11-12 09:28:35 +00:00
rakshasa a60c330d3b * Logging for scgi calls.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1100 e378c898-3ddf-0310-93e7-cc216c733640
2009-10-27 15:11:32 +00:00
rakshasa f11c48d454 * Fixed handling of errors when writing out session torrents, it should no longer hit an infinite loop.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1099 e378c898-3ddf-0310-93e7-cc216c733640
2009-10-23 15:45:45 +00:00
rakshasa 6c3a80636a * Fixed warnings in snprintf statements.
* Don't send numwant in tracker STOPPED requests.

* Reintroudced clearing of epoll event list when a socket is closed as it might cause race conditions.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1097 e378c898-3ddf-0310-93e7-cc216c733640
2009-10-22 07:01:53 +00:00
rakshasa abcb2cea48 * Added simple scheduler.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1096 e378c898-3ddf-0310-93e7-cc216c733640
2009-08-06 16:21:36 +00:00
rakshasa 134ae81ae3 * Fixes to xmlrpc's int64_t type, etc.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1095 e378c898-3ddf-0310-93e7-cc216c733640
2009-06-18 19:01:20 +00:00
rakshasa b19bc576c4 * Fix crashes/errors due to rtorrent attempting to pass non-utf-8 strings to xmlrpc. Patch by Josef Drexler.
* Disabled strict ordering check for the bencode decoder added 2 revisions ago, as it might be messing up PEX, etc.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1093 e378c898-3ddf-0310-93e7-cc216c733640
2009-05-16 12:59:54 +00:00
rakshasa 63af7078a3 * Include locally available chunks in the "chunks seen" statistics for completed/distributed copies. Patch by Josef Drexler.
* Added 'd.get_bitfield' command for retrieving the bitfield in hex format. Patch by Thomas Rosner. (PD)

* Fixed include headers for gcc-4.4.0. Patch by 'kloeri'.

* Switched a 'long long' with 'int64_t' in xmlrpc.cc to avoid incompatible types for some systems.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1092 e378c898-3ddf-0310-93e7-cc216c733640
2009-05-14 13:07:47 +00:00
rakshasa 855bf9a781 * Enable custom throttles, both per-download or per-IP. See http://libtorrent.rakshasa.no/ticket/20 for info and instructions. Patch by Josef Drexler.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1091 e378c898-3ddf-0310-93e7-cc216c733640
2009-05-14 09:49:18 +00:00
rakshasa 05d7028f61 * Added support for using posix_fallocate on newly resized files.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1090 e378c898-3ddf-0310-93e7-cc216c733640
2009-05-13 17:25:19 +00:00
rakshasa 69d1c9700a * Fixes the code that detects which peer was sending bad data. Peers are then automatically banned after sending three bad chunks.
* Fixes a crash when parsing a malformed get_peers (or find_node) response throws an exception and fails to remove the corresponding transaction. Ticket #1622.

* Fix automatic unchoking of new peers exceeding the max upload slots of the download.

* Stops rtorrent from always creating and resizing ALL files, even those set to "off". Files will still be created, but with a size of zero, until a part of them is getting downloaded. This helps with filesystems that don't support sparse files (such as FAT, HFS+, and others).

* Fix inefficient piece distribution due to linear chunk request strategy by randomizing position every few (on average 32) chunks, see ticket #190.

* Fixes lack of return values for user-defined commands (using system.method.insert). When there are multiple commands, returns the result of the last one.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1089 e378c898-3ddf-0310-93e7-cc216c733640
2009-05-13 13:15:33 +00:00
rakshasa 3c670a7add * 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
2009-05-13 09:39:00 +00:00
rakshasa 6753b45627 * Bumped version numbers.
* Fixed inconsistent handling of d.get_base_path for single and
multi-torrents. Now both return the cached path even though the
torrent is closed and a new root directory set.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1085 e378c898-3ddf-0310-93e7-cc216c733640
2008-11-19 17:25:52 +00:00