o Since we only use the mtime and size field of the stat struct for resume
info, we now use a struct with only those two fields. This reduces stack
usage.
running.
* Added --downloaders and --max-peers options and hopefully usefull defaults.
Because curl uses fd_sets it's important to keep the numbers of fds used
below FD_SETSIZE. I will probably move the curl stuff to it's own process
to get rid of that limitation.
* Added to the help text.
the resume file and content aren't synchronized. Save the resumefile
every 15 seconds for torrents we're downloading. This way we don't have
to redownload much content because of crash or whatnot. Not that btpd would
crash :)
Also, as there were probably no point in fsync'ing the content when we closed
the write stream, that is not done anymore.
* Added fast resume support. A resume file is loaded when a torrent is started
and saved when it's stopped or done. If no resume file is found or the file
information doesn't match whats on disk, the content is tested for existing
pieces.
* cm_prealloc now can allocate several adjacent pieces to the given piece.
This further reduces fragmentation. How many pieces are allocated at a
time is controlled by cm_alloc_size which can be set by the user with
the --prealloc option.
* Some changes were also made to the torrent api.
separate. Improve the bts_seek so that it only calls close or lseek if
necessary. Otherwise it's a nop. Hide bts_seek and instead make the offset
explicit in calls to bts_get or bts_put.
as cancelled, or possibly ok or failed if the request had come that far.
Now cancelled requests are silently discarded and doesn't execute the
callback. This makes the http api easier to use. Updated the tracker code
for the new http semantics.
* Added a thread and api for http requests. The thread uses the curl multi
interface and will be used by the tracker code. The tracker code currently
use forked processes to do its bidding.
o Unhook cli_if.c from build temporarily. It needs to be fixed.
o Torrent meta data is now kept in subdirectories to $BTPD_HOME/library.
o Added some very incomplete life cycle logic for torrents.
pieces we and blocks we have, it'll do the writing and reading from disk
and test pieces against their hashes.
This is only a dummy implementation of the api. I'll flesh it out in
subsequent commits.
and net_del_torrent does the opposite (surprise!).
* Some code shuffle has been done to separate net_ and dl_ from torrent_
but there's still much to be done.
* Removed a couple of dead vars from struct torrent.
* Renamed the policy* files to upload* and download*.
* The upload (un)choker is now global instead of per torrent. The algorithm
is not yet implemented however.
To be continued...
* The peer rates are now only updated when data transfer is enabled
in the corresponding direction. They are also computed differently
from before. The rates are computed in the bw callback once a second.
This facilitates later improvements in the choke algorithm.
message when we no longer have any pending requests. This fixes a bug
where two uniterest messages were sent to a peer that was no longer
wanted in endgame.