Commit Graph

78 Commits

Author SHA1 Message Date
rakshasa f117b9dd16 * Allow loading torrents from https and ftp uri's.
* Added framework for commands on peers, but due to deficiencies in
the libtorrent API it won't be enabled yet.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@955 e378c898-3ddf-0310-93e7-cc216c733640
2007-08-16 20:08:32 +00:00
rakshasa 788b496241 * Fix the use of strlcpy.
* Allow lists as arguments in commands by using '{' and '}'. The list
will be recursed and all '$' will be called, while '~' will only be
expanded when in the first element in the list. E.g "execute =
touch,{~/tmp/,$get_client_version=}"

* Added rak::path_expand that works on char buffers.

* Fixed RequestList::calculate_pipe_size so it doesn't request too
many pieces from fast peers.

* Added 'execute_log' for logging the result of calls to 'execute'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@952 e378c898-3ddf-0310-93e7-cc216c733640
2007-08-12 13:41:50 +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 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 350bdfde7e * Allow ';' as a separator for multi-command lines. Not recognized by
the string parser, so it must be preceeded by whitespace.

* Allow escaping of newlines in the resource file.

* Cleanup of the parse_command_* commands.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@936 e378c898-3ddf-0310-93e7-cc216c733640
2007-07-17 16:24:57 +00:00
rakshasa a864d5938d * More commands moved to the new system.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@897 e378c898-3ddf-0310-93e7-cc216c733640
2007-05-01 19:00:17 +00:00
rakshasa 6691298fb4 * Added XMLRPC-C support and hooked it up to FastCGI. Calling a test
function is now possible.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@887 e378c898-3ddf-0310-93e7-cc216c733640
2007-04-09 17:28:54 +00:00
rakshasa b009734d5c * Added support for dvorak keyboard layout. Patch by matled@gmx.net.
* Moved TrackerManager::close() call to the DownloadWrapper dtor so
that tracker STOPPED request will be sent when closing a torrent.

* Fixed some portability issues with Solaris, but still some remain.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@872 e378c898-3ddf-0310-93e7-cc216c733640
2007-03-23 00:00:15 +00:00
rakshasa de3ab556e5 * Added missing includes of <algorithm> required by newer gcc
versions. Patch by falk@debian.org.

* Swapped the use of PCB::m_up.interested() with
PCB::m_down.interested(). This means that m_up.interested()/choked()
says if the remote peer is interested and if upload to it is choked,
while m_down.interested()/choked() says if local is interested and if
download from the remote peer is choked.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@862 e378c898-3ddf-0310-93e7-cc216c733640
2007-02-23 16:33:26 +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 e59b5bf7b6 * Make VariableMap handle both global and core::Download
variables. Variable now has functions for both void and
core::Download*, where the core::Download* is discarded if necessary.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@847 e378c898-3ddf-0310-93e7-cc216c733640
2007-01-17 15:18:33 +00:00
rakshasa d030c5401e * Cleanup of the auto* scripts, curl and openssl checks are now done
with pkg-config.

* Minor changes to included headers and autoconf scripts required by
Solaris.

* Added const char* to VariableMap::has.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@846 e378c898-3ddf-0310-93e7-cc216c733640
2007-01-16 17:30:13 +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 fe7adfc999 * Cleanup of TextElement.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@838 e378c898-3ddf-0310-93e7-cc216c733640
2007-01-01 06:52:56 +00:00
rakshasa c453565e8f * Added FileListIterator to the API, which allows the client to
iterate through FileList as if it consisted of directories.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@831 e378c898-3ddf-0310-93e7-cc216c733640
2006-12-25 10:54:31 +00:00
rakshasa cc44fb175d * Cleaned up hash checking, and allow resuming stopped checks.
* Fixed setting of TOS so it doesn't always set it to throughput.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@827 e378c898-3ddf-0310-93e7-cc216c733640
2006-12-18 08:24:01 +00:00
rakshasa 0c393e1cdb * Properly nul-terminate the info hash and client id in the tracker
request.

* Implemented options for read-ahead of
chunks. 'preload_min_pipelined', 'preload_min_size' and
'preload_required_rate' are used to decide when to read-ahead a chunk.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@800 e378c898-3ddf-0310-93e7-cc216c733640
2006-11-04 16:05:28 +00:00
rakshasa 9d465de7e1 * Use HashString for hash and id which contains the 20 byte array
directly, instead of using std::string.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@799 e378c898-3ddf-0310-93e7-cc216c733640
2006-10-31 11:20:31 +00:00
rakshasa eb7c0b5874 * Made FileManager::close_least_active() work when cachedTime is
before any of the open file's last touched timer.

* Display upload total, not download for both, in the download info
screen.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@787 e378c898-3ddf-0310-93e7-cc216c733640
2006-10-13 12:59:51 +00:00
rakshasa 407824c9c8 * Switch the order rak::advance_bidirectional iterates.
* When testing for mincore, cast the address pointer to (char*).

* Failure during syncing causes the download to stop, unless
flag_ignore_error is set.

* Trigger storage error signal for HashTorrent in
DownloadWrapper::receive_initial_hash.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@774 e378c898-3ddf-0310-93e7-cc216c733640
2006-09-10 03:28:09 +00:00
rakshasa b90a220e15 * Check if individual files are symlinks.
* Use the list of indirect links in EntryList when checking for
available free diskspace.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@773 e378c898-3ddf-0310-93e7-cc216c733640
2006-09-07 14:35:43 +00:00
rakshasa 66dd9a3304 * Use random, not rand, in rak::generate_random as the latter wasn't
being seeded.

* Added a flag to PeerInfo for those that are in handshake, which is
used by PeerList::connect_keep_handshake flag to decide if that
address is to be re-added to the available list when there is already
a connection in progress. This ensures that multiple ports on the same
address don't end up discarded prematurely.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@770 e378c898-3ddf-0310-93e7-cc216c733640
2006-09-01 16:33:21 +00:00
rakshasa bb0f13144b * Fixed the man page to include the latest modifications.
* Bound ^F and ^B for navigating and swapped ^P and ^N in some windows
to get correct behavior.

* Sanitized and added PeerInfo and PeerList to the API.

* HashTorrent now waits for the last outstanding chunks finish before
allowing a chunk mapping error to bork the hashing.

* Lowered the default hash_interval to 5 msec and hash_max_tries to 5.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@765 e378c898-3ddf-0310-93e7-cc216c733640
2006-08-24 23:55:33 +00:00
rakshasa 34258bcfb2 * Added various TextElement flags and replaced WindowPeerInfo with a
WindowText.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@756 e378c898-3ddf-0310-93e7-cc216c733640
2006-08-12 18:35:19 +00:00
rakshasa da0d5dbf22 * Added formatting to TextElementValue.
* Finished the download information screen, removed the redunant
entries in WindowPeerInfo.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@755 e378c898-3ddf-0310-93e7-cc216c733640
2006-08-11 15:32:49 +00:00
rakshasa 3c634730c4 * Added TextElementValue*.
* The curl perform loop wasn't properly checking the returned pointer,
which caused a segfault with libcurl 7.15.5.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@754 e378c898-3ddf-0310-93e7-cc216c733640
2006-08-10 21:24:10 +00:00
rakshasa 0b45062eb3 * Use varargs in Canvas::print.
* Added min/max size to display::Window. Added flags for windows that
should be on located at the left/bottom side of a Frame.

* Reversed print order in WindowLog*.

* Added display::TextElement and subclasses for flexible printing to a
char buffer with associated attributes. Added display::Attributes and
display::Canvas::print_attributes.

* Added display::WindowText for use with display::TextElement's.

* Added ui::ElementMenu for generic menus, and started work adding
this to ui::Download.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@751 e378c898-3ddf-0310-93e7-cc216c733640
2006-08-06 18:20:56 +00:00
rakshasa 4c9fc671be * Allow Frame's to be located in both rows and columns. Improved min
height/width for windows.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@748 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-28 00:17:54 +00:00
rakshasa fc76a11d71 * UI refactoring, added display::Frame and started cleaning up the
code.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@747 e378c898-3ddf-0310-93e7-cc216c733640
2006-07-26 21:41:09 +00:00
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 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 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 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 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 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 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 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 2863c10389 * Removed duplicate portions of some rak/ headers.
* Properly set uninterested when the peer doesn't have any more pieces
we're interested in.

* #180, the ResourceManager didn't iterate over downloads with weight
0, causing those with priority off to not to perform choking nor get
counted in the total.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@649 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-10 15:51:25 +00:00
rakshasa 6822261199 * Piece request messages didn't get read when they were the only
message in the buffer, it required an additional byte beyond the size
of the request body.

* More work on ClientInfo.

* Bound 'k' to disconnecting a peer. Consider a better key.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@647 e378c898-3ddf-0310-93e7-cc216c733640
2006-03-06 20:43:44 +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 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