| Age | Commit message (Collapse) | Author |
|
read and write on blocking sockets.
|
|
|
|
to operate on from btcli.
|
|
in tracker replies when we're stopping.
|
|
|
|
deactivate on shutdown. To not risk hanging indefinitely on unresponsive
trackers, btpd will cancel tracker requests after a while.
|
|
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.
|
|
when we decide which peers to upload to. Also fix so that we don't prefer to
upload to peers who has had a good rate but isn't uploading to us now.
|
|
old request and cancels the old request.
|
|
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.
|
|
line help with the available options.
|
|
|
|
|
|
preallocating disk space, etc. Tweaked the cm <-> net api a bit.
|
|
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.
|
|
called after removing the last request.
|
|
of rate_cmp. Also the wrong variable was passed to peer_unchoke.
s/unsigned/int where it makes sense.
|
|
|
|
dl_on_lost_peer.
Fix a type.
|
|
|
|
|
|
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.
|
|
* Move some struct and type definitions to net_types.h
* Fix ul_on_lost_peer. I must've been very tired when I wrote it :P
|
|
|
|
|
|
belongs.
|
|
It now uses the new http thread instead of forked proceses for
tracker requests.
|
|
This can potentially reduce the time the http thread keeps the post lock
and the httpq lock.
|
|
Update the copyright.
|
|
|
|
* 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.
|
|
|
|
unsigned when I wrote it :P
|
|
o Made bit field argument to has_bit const since the function
doesn't modify it.
|
|
was done per torrent.
|
|
|
|
* Add net_active flag to simplify removal of peers when shutting down the
net for a torrent.
|
|
|
|
removed in a previous commit. Fix indentation.
|
|
|
|
Tabs have been converted to spaces and trailing whitespace have been removed.
I have fixed my emacs settings now :P
|
|
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...
|