Commit Graph

265 Commits

Author SHA1 Message Date
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
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 2f6b5affd1 * Disconnect incoming connections early if the download is full. Patch
by Josef Drexler, public domain.

* Check if bitfield or have messages has been received before when
getting a bitfield message. This fixes an exception on
PC::using_counter() not begin false.

* Added a switch to disable the use of ncursesw, instead using ncurses.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@669 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-13 21:11:42 +00:00
rakshasa 7ad18cdac2 * Added missing files in rtorrent/Makefile.am.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@666 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-06 17:51:17 +00:00
rakshasa dc1f6d4f23 * Minor BSD portability fixes.
* Added torrent::TrackerList::{set_,}key() and made rtorrent save the
key between sessions.

* Added import option to the man page.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@665 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-06 16:40:25 +00:00
rakshasa 8a8cfe5e3d * Made torrent::Piece part of the api.
* Made libtorrent locale agnostic.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@664 e378c898-3ddf-0310-93e7-cc216c733640
2006-04-05 21:09:15 +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 a811f53301 * Applied a patch from josef that cleand up the chunks seen window.
* More work on rarity-first chunk selection.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@657 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-25 20:20:52 +00:00
rakshasa b3051db2b2 * Used the peer's option field when writing the handshake header
causing some peers to disconnect.

* Added rak::partial_priority class for efficient caching of chunks
indices based on rarity.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@656 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-24 21:24:24 +00:00
rakshasa f953c8935e * Added the rarity of chunks to ChunkStatistics, only non-complete
peers. This will be even more lazy and only do this when needed.

* 'i' key in the download view will show rarity of pieces.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@655 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-22 21:13:34 +00:00
rakshasa 14475fd4c1 * Moved Listen to ConnectionManager and use a single port rather than
cache it in each download.

* Set classic locale on various streams.

* Added ChunkStatistic class that will keep track of the number of
each chunk, and how many seeders there are.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@654 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-21 20:37:00 +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 1c55348d45 * Moved {bind,local}_address() to ConnectionManager.
* Various other API cleanups.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@651 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-15 23:25:19 +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