Commit Graph

170 Commits

Author SHA1 Message Date
rakshasa 7600a51039 * Fix potential buffer overflows in case snprintf buffer is too
small. Patch by Josef Drexler.

* Added 'view.persistance' command that makes downloads inserted into
that view persist across sessions. Only call on user-created views.

* Added 'ratio.*' commands that call the 'group.seeding.ratio.*'
equivalents.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1080 e378c898-3ddf-0310-93e7-cc216c733640
2008-11-16 07:54:45 +00:00
rakshasa de8a11c4fd * Added 'system.method.get', 'ui.current_view.set' and 'group.insert'
commands.

* Enabled different ratio settings for different groups of
downloads.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1079 e378c898-3ddf-0310-93e7-cc216c733640
2008-11-10 18:52:36 +00:00
rakshasa 66a2af991a * Added groups and started reworking the ratio handling.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1078 e378c898-3ddf-0310-93e7-cc216c733640
2008-11-09 16:20:57 +00:00
rakshasa 5166253190 * Added 'argument.?' commands that passing of arguments to commands
created with 'system.method.insert'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1077 e378c898-3ddf-0310-93e7-cc216c733640
2008-11-09 12:56:10 +00:00
rakshasa ca9d0b1773 * Added string, value and bool types to 'system.method.insert' for
storing variables.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1076 e378c898-3ddf-0310-93e7-cc216c733640
2008-11-07 16:01:18 +00:00
rakshasa 5648cf7dd0 * Added 'event.download.inserted_{new,session}' that are triggered
when a new or a session torrent is added. Ticket #1516.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1075 e378c898-3ddf-0310-93e7-cc216c733640
2008-10-28 17:59:40 +00:00
rakshasa 29ba4ff4bc * Enforce an http transfer timeout when libcurl fails to honor
it. Also set a 5-minute timeout for (previously unlimited) torrent
transfers and fixes the argument type for curl_easy_setopt values.

* Allows bandwidth throttles to work without floating point support.

* Adds a d.add_peer=host[:port] command to manually add a peer (not
for torrents marked "private"), port is 6881 by default.

* Allows banning the selected peer with "B". No unbanning is possible
yet.

All the above patches were written by Josef Drexler.

* Differentiate between commands that have no target, and those that
take generic targets, when using XMLRPC.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1073 e378c898-3ddf-0310-93e7-cc216c733640
2008-10-22 13:23:48 +00:00
rakshasa db4ba9fe68 * Cleaned up obsolete scheduler framework.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1071 e378c898-3ddf-0310-93e7-cc216c733640
2008-10-04 10:06:47 +00:00
rakshasa 07b9616ef6 * Use user-modifiable commands instead of slots for the 'on_*' events.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1070 e378c898-3ddf-0310-93e7-cc216c733640
2008-10-01 14:19:51 +00:00
rakshasa 5a700f34d9 * Fix a slight memory leak in peer exchanges. Patch by Josef Drexler.
* Fixed mix-up in version numbers causing an incompatibility for .so
libraries. Patch by Josef Drexler for ticket #1333.

* Fix excessive HAVE messages being sent after handshake when download
has been active for a while. Patch by Josef Drexler for ticket #1372.

* Make --enable-ipv6 not break DHT on Mac OS X. Patch by Josef Drexler
for ticket #1359.
 
* Fix crash when contacting tracker. Patch by Josef Drexler for ticket
#1272.

* Fix stopping downloads not working properly. Patch by Josef Drexler
for ticket #1335.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1062 e378c898-3ddf-0310-93e7-cc216c733640
2008-07-05 12:13:12 +00:00
rakshasa 41088740bd * Added dummy scheduler commands.
* Add/remove downloads from the 'active' view on resume/pause.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1051 e378c898-3ddf-0310-93e7-cc216c733640
2008-04-11 18:03:27 +00:00
rakshasa aab493caad * Used different ncurses calls in the file list so that UTF8 filenames
should show up properly.

* More cleanup of Views.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1050 e378c898-3ddf-0310-93e7-cc216c733640
2008-04-02 17:11:44 +00:00
rakshasa e8e5ef337b * Made pause/resume trigger on insertion into the started queue.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1047 e378c898-3ddf-0310-93e7-cc216c733640
2008-03-24 19:30:56 +00:00
rakshasa 8fbaca61b1 * Refactoring to change the DownloadList events to commands.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1046 e378c898-3ddf-0310-93e7-cc216c733640
2008-03-23 12:16:18 +00:00
rakshasa 7062935724 * Replaced View sort code with commands.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1044 e378c898-3ddf-0310-93e7-cc216c733640
2008-03-18 09:11:59 +00:00
rakshasa f9ff1cf5ac * Changed view_filter to use boolean commands instead of custom
functors.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1042 e378c898-3ddf-0310-93e7-cc216c733640
2008-03-16 13:55:40 +00:00
rakshasa 77a7d13b39 * Automatically prune the file status cache every day.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1025 e378c898-3ddf-0310-93e7-cc216c733640
2008-01-01 14:13:14 +00:00
rakshasa ce64ea89b1 * Properly use d.set_directory_base when
* Added get_{up,down}_{rate,total}.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1023 e378c898-3ddf-0310-93e7-cc216c733640
2007-12-30 04:43:05 +00:00
rakshasa 7b053b969e * Refactoring utils::Directory.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1022 e378c898-3ddf-0310-93e7-cc216c733640
2007-12-23 19:12:23 +00:00
rakshasa 51e27e29c8 * Properly clean up SCGI on exceptions so it deletes the socket
file. Found by Josef Drexler.

* Handle mtime properly in resume_save.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1020 e378c898-3ddf-0310-93e7-cc216c733640
2007-12-16 08:25:57 +00:00
rakshasa f05dd5b152 * Added support for DHT. Patch by Josef Drexler, public domain as per
prior agreement.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1013 e378c898-3ddf-0310-93e7-cc216c733640
2007-11-28 15:00:13 +00:00
rakshasa 61098513c6 * Cycle the order in which downloads are handled during ticks to
ensure resource usage gets spread out over time.

* Changed element_file_list.cc to use te_command.

* File commands on file list iterators will be called on the File
pointed to.

* Fixed some sigc++ 2.1 compile errors.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@992 e378c898-3ddf-0310-93e7-cc216c733640
2007-10-21 04:27:49 +00:00
rakshasa 81782e2e9f * Set "encryption=allow_incoming,prefer_plaintext,enable_retry" by
default.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@977 e378c898-3ddf-0310-93e7-cc216c733640
2007-09-07 21:02:15 +00:00
rakshasa c6a43429a2 * Added support for XMLRPC_TYPE_BASE64.
* Added 'load_raw*' commands for loading torrents directly from the
data passed through the first argument.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@964 e378c898-3ddf-0310-93e7-cc216c733640
2007-08-24 12:30:29 +00:00
rakshasa 85d14f0e96 * Cleaned up the 'umask' command and renamed 'working_directory' to
'cwd'.

* Added 'd.{get,set}_custom[1-5]' for user scripts.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@963 e378c898-3ddf-0310-93e7-cc216c733640
2007-08-23 21:21:11 +00:00
rakshasa 0390b7ec00 * Added 'f.multicall' and 't.multicall', and renamed 'call_download'
to 'd.multicall'.

* Cleanup of 'rpc/parse_commands.h'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@961 e378c898-3ddf-0310-93e7-cc216c733640
2007-08-20 21:29:59 +00:00
rakshasa ded9e12ff1 * Added 'get_pid', 'get/set_name' and 'cat' command.
* SocketFd::open_local() should use SOCK_STREAM, not SOCK_DGRAM.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@959 e378c898-3ddf-0310-93e7-cc216c733640
2007-08-20 01:38:38 +00:00
rakshasa ef794b8eda * Added a default low_diskspace check for 500MB.
* Properly catch the exceptions being thrown by the 'in_*' events.

* Expand ~ in ExecFile.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@950 e378c898-3ddf-0310-93e7-cc216c733640
2007-08-07 15:14:57 +00:00
rakshasa ac92b56f37 * Added 'get_d_ratio', 'view_list', 'get_d_tracker_focus',
'get_d_tracker_size', etc.

* Added tracker commands.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@945 e378c898-3ddf-0310-93e7-cc216c733640
2007-07-29 16:59:34 +00:00
rakshasa 1232cd44cb * Properly catch exceptions from commands called from DownloadFactory.
* The print command was not properly adding the final nul char to the
buffer.

* Added 'get_d_name' command.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@944 e378c898-3ddf-0310-93e7-cc216c733640
2007-07-24 23:12:42 +00:00
rakshasa 535db16850 * Bumping copyright year to 2007.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@938 e378c898-3ddf-0310-93e7-cc216c733640
2007-07-19 21:29:34 +00:00
rakshasa e6e7e8a384 * Added "d_delete_tied" command.
* Moved CommandScheduler into src/rpc.

* Fixed a bug in the "download_list" command.

* Partial cleanup of the tracker list.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@924 e378c898-3ddf-0310-93e7-cc216c733640
2007-06-24 20:25:44 +00:00
rakshasa e9db89e6d6 * Put both global and download specific commands in a single
CommandMap.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@914 e378c898-3ddf-0310-93e7-cc216c733640
2007-06-17 03:14:38 +00:00
rakshasa 297b4b5f1d * Renamed VariableMap to CommandMap.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@913 e378c898-3ddf-0310-93e7-cc216c733640
2007-06-16 17:46:06 +00:00
rakshasa f8f2f80960 * Moved the rest of the helper functions from VariableMap to
parse_commands.h.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@912 e378c898-3ddf-0310-93e7-cc216c733640
2007-06-16 17:22:39 +00:00
rakshasa d33d283293 * Last of the old commands moved.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@903 e378c898-3ddf-0310-93e7-cc216c733640
2007-05-18 20:34:31 +00:00
rakshasa 032bae7030 * Removed old non-download set/get functions from VariableMap.
* Added forgotten command_download.cc file.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@900 e378c898-3ddf-0310-93e7-cc216c733640
2007-05-11 22:47:15 +00:00
rakshasa 7077aba019 * More cleanup of commands, including some optimization by avoiding
some heap allocations.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@893 e378c898-3ddf-0310-93e7-cc216c733640
2007-04-18 15:15:06 +00:00
rakshasa 81637ff5a0 * Converting various variables to the new command version.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@891 e378c898-3ddf-0310-93e7-cc216c733640
2007-04-17 14:57:56 +00:00
rakshasa ee6eae6c84 * Working on new infrastructure for parseing commands. It now passes a
list instead of a string when calling a multi-parameter command, which
handles escaped spaces, commas and quotes correctly.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@877 e378c898-3ddf-0310-93e7-cc216c733640
2007-03-25 18:03:07 +00:00
rakshasa 3ef8384c38 * Set allowed encodings for tracker and http requests.
* Fixed two valgrind errors in the ChokeManager code.

* Added 'seeding' view on key 8. Remeber to fix the man page.

* Fixed an exception being thrown in ChokeManager::cycle(...) due to a
missing range check on the number of unchokes we do.

* Moved choke/queued state to a new ChokeManagerNode class.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@869 e378c898-3ddf-0310-93e7-cc216c733640
2007-03-16 23:22:51 +00:00
rakshasa 1d1b5710fa * Added "create_link" and "delete_link" options for creating and
deleting symbolic links to downloads.

* Added "on_*" options for calling commands on state changes.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@849 e378c898-3ddf-0310-93e7-cc216c733640
2007-01-20 19:42:22 +00:00
rakshasa e122cc928a * Removed the SocketFile dtor which contained an obsolete check of
is_open().

* Added multi-line parser to VariableMap and replaced the various
calls to process_command in main.cc with a single call.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@845 e378c898-3ddf-0310-93e7-cc216c733640
2007-01-13 12:20:22 +00:00
rakshasa c1ac4a2319 * Cleaned up and moved FileManager to the API. It now only keeps track
of open files, which makes the dynamic opening/closing of files much
more efficient if very many large torrents are open.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@843 e378c898-3ddf-0310-93e7-cc216c733640
2007-01-09 11:52:59 +00:00
rakshasa de744ad11d * Converted VariableMap and ViewManager to using const char* as the
key, since they are never changed nor added from outside. This cut the
stripped binary size by 50KB.

* Use a shared have piece queue for each download. Each connection has
a time-stamp for the last have message they sent, which is checked
against the queue. This also avoids the race condition where some
peers would get incomplete views of our bitfield due to lost have
messages during handshake.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@839 e378c898-3ddf-0310-93e7-cc216c733640
2007-01-01 14:57:10 +00:00
rakshasa aab31e5ea5 * Added path match depth to torrent::File which can be used to quickly
determine the common root directory of two adjecent files.

* Cleaned up RC4 class.

* Fixed --with-openssl so it accepts user-supplied paths.

* Call abort instead of exit when receiving a SIGSEGV or SIGBUS.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@829 e378c898-3ddf-0310-93e7-cc216c733640
2006-12-21 16:27:48 +00:00
rakshasa 66bb95a26c * Select the proper encoding for a torrent's name so that multi-file
torrents get the right root directory.

* Properly clean up after catching a storage_error in
EntryList::open().

* Added a funtion to torrent::Download for syncing chunks to disk, and
made torrent::resume_save_progress(...) use it.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@736 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-04 22:48:43 +00:00
rakshasa c957d1b4d1 * Properly invalidate BlockTransfer's in Block so they get deleted.
* Added is_active flag to TrackerManager and don't reset the
up/download baseline in Download::start() when a request is queued.

* Remove the "started" filter in hashing view, so it starts hashing
stopped torrents.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@735 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-03 00:18:48 +00:00
rakshasa 26ffe74744 * Moved the resume code out of DownloadWrapper and made it use the
public API. The client can now use the various calls provided or
implement its own.

* 'U' now deletes the tied file in addition to clearing 'tied_to_file.

* Bound left arrow in chunks seen to return to peer list. Patch by
Josef Drexler.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@734 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-01 20:31:07 +00:00
rakshasa 70eacfe738 * Reworked how hashing is queued, state must 1 and removed the
set_hash_failed hacks when closing, etc.

* Changed the attributes of blocks in transfer view.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@727 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-21 22:14:10 +00:00