Commit Graph

284 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 e8a8fc7e1a * Minor fixes before release.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@740 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-08 22:04:12 +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 63311270c9 * Adding the compiled man page.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@738 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-05 21:09:36 +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 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 9f2f427e9d * Fixed the transitions between skipping and downloading pieces.
* Added Object::merge_recursive.

* Save and set the chunks done count for closed torrents.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@733 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-30 01:02:41 +00:00
rakshasa 4b79a7c47f * Fixed the hashing so it properly starts and stops. When
DownloadList::pause is called it clears the "hashing" variable.

* Added convenience functions for retriving torrent::Object key's of
specific types.

* Iterate to the first visible transfer in the chunks seen view. Patch
by Josef Drexler.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@732 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-28 22:50:58 +00:00
rakshasa ee353bfc9f * Bound 'U' for clearing "tied_to_file".
* Fixed transfer list to mark peers that sent bad data once the chunk
has successfully passed the hash check.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@731 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-26 23:55:54 +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 8be667e935 * When a chunk hash fails, copy the data to buffers and try again.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@728 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-23 00:14:44 +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 f1c9188d55 * Compare the block data downloaded by a non-leader with the current
and mark the block transfer if they do not match.

* Erase handshakes in DownloadMain::stop() rather than
Manager::cleanup_download(). This was causing exceptions in PeerList.

* Add 1000ns to the timeout when polling to avoid rounding errors
messing up scheduling.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@724 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-17 23:46:00 +00:00
rakshasa c95eb62802 * Second part of reworking how multiple downloads of the same chunk is
handled.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@721 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-15 00:46:13 +00:00
rakshasa b3b4acaad8 * Added view of blocks in transfer list view.
* Show chunks with only queued transfers with an underscore in chunks
seen view. Patch by Josef Drexler, public domain.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@719 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-12 22:34:41 +00:00
rakshasa 38f0cdbce2 * Added blocks to transfer list view.
* Minor modifications to the Block API.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@718 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-12 19:20:51 +00:00
rakshasa 1e54882da4 * Reverse the color of currently downloading chunks in chunks
seen. Patch by Josef Drexler, public domain.

* Moving various stuff from Delegator to TransferList.

* Added checks in HandshakeManager::receive_* to check for invalid
handshakes.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@716 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-11 18:22:30 +00:00
rakshasa f0d94bc938 * Added TransferList to the API.
* Added transfer list view, bound to the 'u' key.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@715 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-09 22:59:47 +00:00
rakshasa ffb820f536 * Moved PeerConnectionBase::m_downTransfer into RequestList.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@714 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-08 18:45:51 +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 d0f6719e50 * Added pageup/down to chunks seen and file list. Patch by Josef
Drexler, all future patches to lib/rtorrent will be under public
domain.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@712 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-04 23:37:39 +00:00
rakshasa 46dd41e956 * Moved defininiton of priority enum to torrent/common.h.
* Properly return the size of the Block.

* Bumped to 0.10.0/0.6.0.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@711 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-04 20:53:04 +00:00
rakshasa 18cd5342df * Moved Delegator over to using the new Block classes.
* Fixed alignment of the ratio display.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@710 e378c898-3ddf-0310-93e7-cc216c733640
2006-06-04 14:17:23 +00:00
rakshasa c573c8a9bc * Starting work on persitant storage of peer info.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@707 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-31 16:05:09 +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 aaaf5d9a5d * core::DownloadList::receive_hash_done(...) now handles failed
initial hash checks properly, rather than throwing an exception.

* Explicitly allocate Bitfield::m_data and dis-associate it from the
size. This will allow us to store m_size and m_set without the
underlying bitfield.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@700 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-23 17:26:38 +00:00
rakshasa e4c5c80688 * Bumping version to 0.9.3/0.5.3.
* Ignore wrong type for "peers" in tracker requests as some trackers
send a dictionary when empty.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@697 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-23 07:36:58 +00:00
rakshasa 770d205b9a * Some views were using uninitialized bool for reversing.
* Possibly hash_done gets called while a download is closed.

* Consider putting chunk release before receive_chunkdone.

* Don't use getopt to check for flags as that re-orders the left-over
arguments.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@696 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-21 00:11:07 +00:00
rakshasa 271e8e6ccf * Bumping the version numbers.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@693 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-19 16:54:42 +00:00
rakshasa 14418244fb * Reordered the ChunkList::sync_* code to work around a gcc-3.3 bug.
* torrent::TrackerList::send_completed() was being called before the
download was resumed, thus it never got sent.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@692 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-18 19:35:27 +00:00
rakshasa ba4a1927ff * Set the hash failed flag before DownloadList::hash_clear closes the
torrent, so the hashing queue doesn't re-open it.

* Randomized the starting position in chunk selector.

* Added man page entry for send/receive buffer size.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@689 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-15 17:55:11 +00:00
rakshasa d4706da4d5 * Removed core::HashQueue, using the "hashing" view and a function in
core::Manager instead.

* Added a new :rtorrent:hashing state so we can distinguish between
initial hashing and manual rehashes. The former is cleared if the
download is paused.

* Added a hash failed flag to core::Download. This is used to skip
entries in the hashing view that either failed to open or are in the
process of being erased from DownloadList.

* torrent::Bitfield::unset was incrementing, rather than decrementing,
the m_set counter.

* Replaced all torrent::internal_error's in rtorrent with
torrent::client_error.

* ^D now checks :rtorrent:state to decide whetever to stop or erase a
download. Downloads queued for hashing will now stop rather than be
deleted.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@688 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-13 00:18:50 +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 a851264787 * Added '-n' flag that disables loading of ~/.rtorrent.rc.
* Re-added priority change when a download finishes.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@686 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-09 20:50:07 +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 8387dbde6f * Clear the resume bitfield when resuming an incomplete download. This
will force rehashing if the program dies in a messy way.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@682 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-04 13:43:59 +00:00
rakshasa 0620ea88a7 * Added man page entries for view_* and session_save.
* Moved around resume save so it doesn't bork on completed last hash
check.

* torrent::Download::hash_resume_clear() no longer removes priority
and mtime information, only the bitfield.

* Added a quick hack that allows libtorrent to split large files. The
parameter needs to be set in the source, no API available yet.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@681 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-03 18:59:07 +00:00
rakshasa f01289ef12 * Do session save on exit from the main loop, and moved around
hash_resume_save.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@680 e378c898-3ddf-0310-93e7-cc216c733640
2006-05-02 19:57:35 +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 fff7838f13 * Moved various Download related stuff from core::Manager to
core::DownloadList.

* SVN didn't properly commit changes to view.h, fixed.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@678 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-29 20:27:04 +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