stats for torrentst.
o btpd may be waiting for a torrent to finish so it can exit. Therefore
btpd needs to send the reply to the cli before removing the torrent.
has moved toward btpd having a library of torrent to wich one may add
or remove torrents, and where interaction on torrents are done by their
assigned number. This commit is a step back from that and it makes life
simpler and better for all :)
* Some options to btpd has changed:
--no-daemon is the old -d.
-d is now used to specify the btpd directory.
--logfile option is reintroduced.
* The ipc code has been improved on both btpd and cli sides.
* All commands have been implemented.
* Various improvements in btpd.
With this commit we're very close to 0.8 :)
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.