about summary refs log tree commit diff
path: root/btpd/torrent.h
AgeCommit message (Collapse)Author
2009-01-26Improve the torrent stop and btpd shutdown sequences.Richard Nyberg
Torrents are now considered stopped and may be restarted even if the stop event haven't been sent the trackers yet. The same holds for the del and add commands. A btpd process in shutdown mode that only have stopped torrents, but is still sending the stop event to trackers, will release resources that would block a new btpd to start. It will the silently exit when it's finished with the trackers. This also makes the timeout parameter for shutdown unnecessary.
2009-01-26Rethink the tracker client code somewhat.Richard Nyberg
btpd now uses all tiers in parallel, so a torrent with two tiers will essentially be treated by btpd as a torrent with two trackers to send each event to. This is not quite what the multitrackes standard says, but it's much easier to implement reasonable behaviour this way. btpd is going to report the number of good trackers for a torrent instead of the number of errors, but for now just report zero errors.
2007-05-18Set torrent deletion flag as parameter to torrent_stop. Update torrent infoRichard Nyberg
in torrent_stop rather than torrent_kill. The data doesn't change but there may be some time between the two events.
2007-02-24Get rid of tp->relpath.Richard Nyberg
2007-02-24o Make errors when reading or writing torrent data non fatal. Instead ofRichard Nyberg
killing btpd, only the troublesome torrent will be stopped. o Some code shuffle.
2006-11-03Make the content code unthreaded and remove the no longer needed interRichard Nyberg
thread messaging code. Also simplify some interfaces by polling for state changes when appropriate instead of being called directly at any time.
2006-10-08Make the del command work for active torrents too.Richard Nyberg
2006-09-13btpd now has a library of torrents indexed by number and info hash.Richard Nyberg
The add and del commands adds or removes torrents from this library. The start and stop commands are used to active or deactivate torrents. Also, a mechanism for qeurying data on torrents has been added. It's only used by the btcli list and stat commands yet though. btcli has been split into different files for each command. Both btpd and btcli now use misc/btpd_if.h for all ipc definitions. Misc changes: - struct metainfo is gone. Use the new mi_* functions. - Add printf format type checking where appropriate.
2006-02-09Add torrent_name function and use it. Richard Nyberg
2006-02-08Interaction with btpd is now much more like I want it. Previous workRichard Nyberg
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 :)
2006-02-05Each torrent now gets a number. This number is used to select which torrentRichard Nyberg
to operate on from btcli.
2006-02-01Torrents can now be deactivated and btpd will wait for all torrents toRichard Nyberg
deactivate on shutdown. To not risk hanging indefinitely on unresponsive trackers, btpd will cancel tracker requests after a while.
2006-01-22* Implemented the full cm_ life cycle.Richard Nyberg
* 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.
2006-01-09* Move the network related parts of the torrent struct to a sub struct.Richard Nyberg
* 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
2006-01-09Rename tp->cp to tp->cm.Richard Nyberg
2006-01-09Better tracker code. Mostly done but needs a little more work.Richard Nyberg
It now uses the new http thread instead of forked proceses for tracker requests.
2006-01-04o Use the new cm_* content api.Richard Nyberg
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.
2005-12-02* Some code shuffle and removal of dead code.Richard Nyberg
* Add net_active flag to simplify removal of peers when shutting down the net for a torrent.
2005-12-01Rates should be unsigned long. Compute total, torrent and peer rates.Richard Nyberg
2005-11-30The mega whitespace patch.Richard Nyberg
Tabs have been converted to spaces and trailing whitespace have been removed. I have fixed my emacs settings now :P
2005-11-30* Added net_(add|del)_torrent. net_add_torrent enables p2p for a torrentRichard Nyberg
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.
2005-11-29* Removed the heartbeat and btpd_seconds. Note that this breaks the tracker.Richard Nyberg
* 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...
2005-11-07Step one of many to make the sub systems more modular. This commit getsRichard Nyberg
rid of the global btpd struct. Some fields in the struct got a corresponding global variable whereas some was made static and moved to a module. The bandwidht algorithm also got tweaked. It now tries to fire the event at specific times. This was to make the code simpler. It'll probably have to be tweaked again :P First step to make btpd run from a directory where it'll keep the log, socket, configuration, data on the known torrents, etc. Btpd now uses flock on the pidfile instead of connecting to the socket in order to be reasonably sure that no other btpd runs in the same directory.
2005-09-20* Allocate request messages on piece creation. The request objects canRichard Nyberg
be shared by several peers. At least in end game. * Link blocks with the peers we are loading them from and vice versa. * Limit the number of requests / peer in end game too. * Improve end game by using some sort of round robin for block requests.
2005-07-20Rework the download algorithm. This isn't tested yet, but it compilesRichard Nyberg
so it must be bug free :)
2005-07-17* Better interface between the net and peer code.Richard Nyberg
The net code now calls the peer code when it has read a full message. This has mostly involved moving code from net.c to peer.c. * Added torrent_piece_size helper function.
2005-06-28Rename TAILQ to BTPDQ to avoid macro redefinition,Richard Nyberg
which may happen if some other header includes sys/queue.h.
2005-06-24Import btpd-0.1.Richard Nyberg
git-svn-id: file:///home/rnyberg/svngit/btpd/releases/0.1@1 76a1f634-46fa-0310-9943-bd1476092a85