Commit Graph

75 Commits

Author SHA1 Message Date
rakshasa b3fc488e5f * Initial work on a global chunk manager for controlling memory usage,
and checking if enough disk space is available for MS_ASYNC to be safe.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@743 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-19 00:42:23 +00:00
rakshasa 52bf80d704 * 'I' key set the download to ignore the start/stop_try commands.
* Added options for timeout_sync/safe_sync and max_chunks_queued.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@739 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-07 22:19:20 +00:00
rakshasa 082cbb6cc5 * Added "key_layout" option with support for azerty.
* Delayed the hash done signal.

* Allow quick hash checks that only handles invalid chunks.

* Show failed counter for peers.

* Updated the man page.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@737 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-05 20:12:01 +00:00
rakshasa d35bef6791 * Expand the path when unlinking the tied file.
* Use DownloadWrapper* to identify hashing chunks, rather than the
info hash.

* When hashing fails, retry the most common blocks.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@729 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-24 23:48:26 +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
rakshasa d2fc993514 * Changed the usage of rand() to random() as we only seed the latter.
* Added corrupt_file, an utility to corrupt files to test chunk
hashing.

* Added "start_tied" option, and don't clear "tied_to_file" when
*_untied are called.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@725 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-19 13:01:24 +00:00
rakshasa beeea9fd3e * Handshake was setting wrong bitfield size.
* Cleanup of Block classes.

* Added brackets to error message from the OpenSSL test.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@713 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-06 21:16:55 +00:00
rakshasa 146c104eb3 * Added "stop_on_ratio" option and display the ratio. Patch by Josef
Drexler, public domain.

* Made autogen.sh detect glibtoolize.

* Don't resume torrents that are marked as completed yet the initial
hash check returns failed chunks.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@704 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-27 23:35:20 +00:00
rakshasa 932296ce52 * Added "close_low_diskspace" option that closes active downloads on
filesystems with less space left than what was passed as the
argument. Patch by Josef Drexler, public domain.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@703 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-25 19:44:13 +00:00
rakshasa 65f3dda9ab * Added 'close_untied' option.
* Remove redundant BitField::update calls now that updating
Bitfield::m_set gets handled properly in hash_resume_load.

* Fixed the error message when trying to lock non-existant session
directories.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@687 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-12 01:07:21 +00:00
rakshasa 6d07bf3540 * Added 'view_filter_on' option that triggers filtering of a download
after an event.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@685 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-08 23:42:03 +00:00
rakshasa 2b420e95a0 * A seperate variable for hashing state, now properly restarts hashing
after restart.

* Stop a torrent and show a message when it finishes the final
hash-check and finds some chunks incomplete. This prevents full disk
from causing a torrent to go into an infinit loop of re-downloading
the data.

* Moved various slots from core::Manager to core::DownloadList.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@679 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-01 18:53:21 +00:00
rakshasa 236f689efc * Moved various download related calls from core::Manager to
core::DownloadList, added a slot map for hash done.

* Enabled the complete/incomplete views.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@677 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-28 23:21:32 +00:00
rakshasa 02a0510439 * Changed ViewSort::less(...) to operator().
* Added a "last changed" paramter to ViewManager::sort(...) which is
checked, if the ViewDownloads's last_changed timer was poked withing
that timeframe it won't update.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@676 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-27 21:38:02 +00:00
rakshasa 8ae5e51a0f * Change :rtorrent:state to an integer.
* Split up DownloadList::insert to get proper ordering of slot map
calls and variable initialization.

* Added filtering to ViewDownloads.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@675 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-26 21:23:37 +00:00
rakshasa c5c9a1ddae * Added the framework for a download scheduler.
* Added "state_changed" variable to downloads that returns the last
time the download called DownloadList::pause/resume.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@674 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-25 19:33:53 +00:00
rakshasa 19179bd160 * Fixed mismatched delete/delete[] in torrent::Bitfield::resize.
* Added 'view_sort_current', changed 'view_sort' to sort according to
what was defined by the former option.

* 'view_sort_*' now takes a list of sorting options which are applied
in order.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@673 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-24 23:22:57 +00:00
rakshasa 598455a5df * The curl bind address was being set by set_local_address(...), urgh.
* Made IPv6 stuff configurable.

* Improved the view stuff.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@672 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-23 23:17:05 +00:00
rakshasa 11c842308a * Added VariableBool.
* Added views for downloads, that can be sorted.

* Added options "view_add", "view_sort" and "view_new".


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@671 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-22 23:16:08 +00:00
rakshasa c4256079ae * New non-template VariableStringSlot and VariableValueSlot.
* Support B, K, M and G in options.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@670 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-20 20:03:03 +00:00
rakshasa 3fa08503bb * Clear the DelegatorChunk's when clearing Delegator, so it doesn't
throw on some obscure bug. Not going to be looking for this one anyway
as there is a rewrite scheduled.

* Added "tos = default|lowdelay|throughput|reliability|mincost" option.

* Made EntryList::value_type a pointer, fixed so FileMeta is
initialized and path set before Download::open().


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@662 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-03 20:58:10 +00:00
rakshasa f0d31900b7 * Added combined Object::has_key and Object::is_* functions.
* Re-added 'tracker_dump' option which takes a filename.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@661 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-01 22:06:57 +00:00
rakshasa d9d27139d1 * Fixed an overflow in rak::partial_queue, and added some exceptions.
* Changed to configure script so --disable-mincore must be called
explicitly to disable it.

* API and core::Download cleanup.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@660 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-31 23:02:39 +00:00
rakshasa 59a23ea9ed * Added torrent::FileList to the API.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@659 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-30 17:57:57 +00:00
rakshasa 8ea6f78e21 * Cache the current ceiling in rak::partial_queue.
* Added "enable_trackers=yes|no" option that can turn on/off the use
of trackers on all torrents.

* Cleanup of the API, including a new TrackerList class.

* When requesting from seeders, either continue a chunk another seeder
started or try a new one. This means seeders don't end up downloading
non-rare chunks.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@658 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-28 21:04:07 +00:00
rakshasa 17d66c4a2f * Moved Bencode stream functions to object_stream.h and the Bencode
class to object.h.

* torrent::download_add(...) now takes an torrent::Object*.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@653 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-20 21:03:42 +00:00
rakshasa 86a3f868df * Added "send_buffer_size" and "receive_buffer_size" options that set
the socket SND/RCBBUF sizes.

* Added slot for connection filtering.

* Added closing torrents with ^K and did some cleanup of the torrent
state code.

* Moved various socket setup to HandshakeManager.

* Added a baseline for the uploaded amount that resets every time the
torrent restarts, thereby sending only the amount uploaded since the
last restart.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@652 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-18 00:55:50 +00:00
rakshasa 571fe8b2f4 * Changed to using sockaddr* in libtorrent's api.
* Prepared SocketManager for inclusion in the api.

* From <nornagon@gmail.com>: bound some control keys in text input.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@650 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-15 16:22:40 +00:00
rakshasa a6a0c25fbc * More rak::socket_address cleanup, made listening port seperate from
local address and use port 0 when listening port is closed.

* Added "port_open" option which allows the user to not open any
listening port.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@644 e378c898-3ddf-0310-93e7-cc216c733640
2006-02-24 21:32:36 +00:00
rakshasa e3571f249c * Added "upload_total_clear" option that clears the total upload
counter when loading session torrents.

* Use the TrackerInfo pointer (to be renamed) as an identifier for
downloads, rather than the hash.

* Partially converted to using a new wrapper for sockaddr, which will
allow IPv6.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@642 e378c898-3ddf-0310-93e7-cc216c733640
2006-02-21 20:58:47 +00:00
rakshasa 4dea195340 * Expand ~ in paths, all uses should be covered.
* Moved option file parsing to VariableMap and added "import" and
"try_import" options for loading option files.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@636 e378c898-3ddf-0310-93e7-cc216c733640
2006-02-11 15:34:53 +00:00
rakshasa e5c5f7ecb1 * Remove stale lock files if it is held by the same hostname and the
pid is not running.

* Added rak::timer::from_seconds(uint32_t) and converted all uses to
this to avoid overflows etc.

* For each cycle through the tracker list without any successfull
connections, increase the timeout by 20 seconds.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@635 e378c898-3ddf-0310-93e7-cc216c733640
2006-02-09 19:18:26 +00:00
rakshasa 126bb511b8 * Applied patch from Diego 'Flameeyes' Petteno <flameeyes@gentoo.org>
that adds the "unused" attribute to some function parameters and minor
cleanups of configure.ac.

* Added inttypes.h to command_scheduler.h.

* Bumped to version 0.8.5/0.4.5.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@634 e378c898-3ddf-0310-93e7-cc216c733640
2006-02-05 01:43:38 +00:00
rakshasa 68502367ec * Don't show ETA on finished and stopped torrents.
* Added percentage completed to active unfinished torrents.

* Re-enabled different seeding and leeching priorities.

* Make a temporary container in AvailableList::insert(AddressList*)
when doing std::set_differernce. AvailableList's std::vector would
resize and cause invalidated iterators to be used.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@630 e378c898-3ddf-0310-93e7-cc216c733640
2006-02-04 19:18:41 +00:00
rakshasa d06ecda46a * Added "working_directory" option that calls chdir.
* Added "session_on_completion" option which saves the session torrent
when a download finishes.

* Handle SIGTERM gracefully, saving session torrents etc.

* Implemented session directory lockfile, use "session_lock" option to
disable.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@629 e378c898-3ddf-0310-93e7-cc216c733640
2006-02-01 12:11:09 +00:00
rakshasa 6f44f8f920 * Make DownloadStore::save(...) validate the new file by loading the
bencoded data.

* Make it safe to remove torrents that are selected.

* Delete the rtorrent and libtorrent sections when loading non-session
torrents.

* Added ^O to change a torrent's root dir, ^P to set a variable.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@628 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-27 20:16:52 +00:00
rakshasa c89ae513ef * Allow clock time for command scheduler interval and start time using
the format "hh:mm:ss".


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@627 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-25 21:23:46 +00:00
rakshasa 825985b8ef * Bind udp and http tracker requests to the bind address.
* Allow the torrent's priority to be changed with '+'.

* More work on the variables thing.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@625 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-23 19:24:45 +00:00
rakshasa 52636178d1 * Moved hash and torrent size checking to initialize so it will be
caught when loading a torrent.

* Added VariableMap to core::Download and started moving various
settings.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@624 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-19 17:13:25 +00:00
rakshasa e8cd37ea3a * Set SO_REUSEADDR for the listening socket.
* Moved several settings to use the new variables and made the parser
better.

* Use "-O2" rather than "-O3".


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@623 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-17 17:23:32 +00:00
rakshasa 4028ab2295 * New code for handling options/variables which used bencode and can
redirect get/set operations.

* Fixed(?) a bug in RequestList::downloading(...) that could cause a
segfault when pieces in the canceled list start downloading.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@622 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-13 03:26:46 +00:00
rakshasa b25af84ee8 * Bumping the copyright year to 2006.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@621 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-10 00:46:50 +00:00
rakshasa f32c15878a * Fixed the log redraw which didn't happen as the display's scheduler
didn't get re-added to the task scheduler until a new event happened.

* Added redraw delay interval of 100ms, consider 50ms.

* Removed exceptions from core::DownloadStore::save.

* Added load, load_run, tied_stop and tied_remove to man-page.

* Cleaned up the command/option instances, move them to Control.

* PCB::load_up_chunk grabbed the errno from m_downChunk, not m_upChunk.

* Various string operations were moved to rak/string_manip.h.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@617 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-06 21:14:49 +00:00
rakshasa 4431fd1652 * Fixed a regression that threw an exception for torrents with
empty directories.

* When receiving zero length pieces, remove them from the request list.

* Send the interested state before any requests as some clients,
BitTornado 0.7.14 and uTorrent 0.3.0, disconnect if a request has been
received while uninterested.

* WITH_POSIX_FALLOCATE configure macro should check against "yes", not
"no".

* The new priority queue would cause arg torrents to load before
session torrents in some cases. Fixed to perform the session torrent
tasks before loading arg torrents.

* Allow '*' wildcard in filenames when loading torrents.

* Added load, load_run, stop_tied and remove_tied settings which can
be used to scan a directory for new/removed torrents. These torrents
are tied to the lifetime of the torrent file.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@616 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-03 21:43:01 +00:00
rakshasa 5a8a402745 * Minor cleanup in rtorrent.
* Changing priorities of closed torrents caused a crash due to empty
ChunkSelector, fixed.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@615 e378c898-3ddf-0310-93e7-cc216c733640
2005-12-22 03:55:43 +00:00
rakshasa 4e8e5a18df * Clear the download rate when finishing a torrent.
* Fixed torrent::set_{bind,local}_address(...) so they update
correctly.

* Tweaked the time left display, show minutes instead of seconds.

* Add earlier check on validity of the socket address of
incoming/outgoing connection.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@610 e378c898-3ddf-0310-93e7-cc216c733640
2005-12-18 23:49:00 +00:00
rakshasa e45f05ee98 * Added command scheduler, currently it only calls option handler.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@609 e378c898-3ddf-0310-93e7-cc216c733640
2005-12-17 02:50:10 +00:00
rakshasa ba7d61b532 * Fixed a buffer overflow when writting to the output buffer. This
would in some rare occasions cause memory to be corrupted. leading to
a crash.

* Added option for setting the http proxy and proccess's umask.

* Save the total uploaded for downloads between sessions.

* Moved from sigc++ to my own lightweight slot class for the task
scheduler. This saves some 5-600kb when compiled with debugging
symbols, 1-200kb without.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@605 e378c898-3ddf-0310-93e7-cc216c733640
2005-12-05 07:59:29 +00:00
rakshasa 98a8fc8638 * Improved error handling for settings. LibTorrent now consistently
throws torrent::input_error and rtorrent catches those and prints good
error messages.

* torrent::set_{bind,local}_address now accepts dns addresses.

* Fixed bug that caused multiple instances of the setting
up/download_rate to change the relative rate, rather than constant.

* Minor change to the way PCB decides to not request more pieces.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@601 e378c898-3ddf-0310-93e7-cc216c733640
2005-11-24 17:21:32 +00:00
rakshasa 89e69adb7a * Added interface for changing download priority.
* More throttle fiddling.

* Pop the currently uploaded piece from the send list.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@591 e378c898-3ddf-0310-93e7-cc216c733640
2005-11-01 19:42:07 +00:00