Modified patch from savrus and nicm.
Allows adding multiple torrents from one 'btcli add' command.
Also made minor improvements to add code.
Closes GH-9
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.
It sorts by name instead of number (should probably add options for sorting).
It now also takes torrents to list as optional arguments. Added ratio to
btcli stat display. Changed the help text for both commands. Some code shuffle
and other tweaks.
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.
add - adds a torrent to btpd's library
del - removes a torrent from btpd's library
start - activates a torrent from the library
stop - deactivates an active torrent
tget - get data from torrents
tget obsoletes stat and list.
Commands for setting values and query other data will be
added later.
1. Show the number of torrents with tracker errors on the total status line.
2. Show the torrent status character on the status line instead of the name
line. This only has effect when the '-i' flag is given.
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 :)
Each piece must have at least one byte for their block bit array,
or they will collide causing great confusion in btpd. The calculation
was done wrong so this could happen for small torrents (blocks / piece < 8).
policy_subr.c:
* Add test for correctness.
* Add missing call to cm_on_piece_full in cm_new_piece.