Richard Nyberg
4e6f095c41
Cut off decimals after the first tenth percent so printf doesn't round
the percentage upwards. Ie. Display 99.9%, not 100.0%, even if we have
99.98% of the content.
19 роки тому
Richard Nyberg
db49763849
The previous commit was a bit over zealous; the block field should not be
cleared for a failed piece in the full torrent test. This also fixes a bug
where the content byte count wasn't decreased for failed pieces.
19 роки тому
Richard Nyberg
b72b6bb8ba
The code for testing content that has potentially been modified between btpd
runs was quite broken. Pieces stayed marked as ok event though the hash test
failed for pieces in modified files. Oops!
19 роки тому
Richard Nyberg
cdb471d0ac
Fix a bug from the last commit: shared messages for endgame requests could
be placed at the wrong index in the array.
19 роки тому
Richard Nyberg
9f4070eeb8
There's now one list with requests per piece instead of one per block. The
network buffers for requests are now allocated as they're needed. Before
they were allocated at the same time as their corresponding piece. This
lowers btpd's memory consumption.
19 роки тому
Richard Nyberg
6214255bbb
Safer code for net_read32 and net_write32. It may have been possible for them
to cause failure on some architectures because of unaligned fetch/write of
integers.
19 роки тому
Richard Nyberg
a1f2f9faae
Two changes to stat output:
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.
19 роки тому
Richard Nyberg
f219b47a33
Set default value of cm_alloc_size to 2MB.
19 роки тому
Richard Nyberg
1b3c4e7c05
Set its rates to zero when stopping a torrent.
19 роки тому
Richard Nyberg
4382442f11
Rewrote the README with changes for 0.8..
19 роки тому
Richard Nyberg
2d696edbb6
Changes for 0.8.
19 роки тому
Richard Nyberg
eb85993c8c
Don't allow a negative cm_alloc_size to wreak havoc.
19 роки тому
Richard Nyberg
2ee5eed062
Return possible error message in the http result. Log the error in the
tracker code.
19 роки тому
Richard Nyberg
61752ade71
Change preallocation default to 2048. 1 may be a little low.
19 роки тому
Richard Nyberg
bcac74d138
Safer type use.
19 роки тому
Richard Nyberg
b61b04f258
Fix typo.
19 роки тому
Richard Nyberg
b2271a4851
Add a note on the ACX_PTHREAD macro license.
19 роки тому
Richard Nyberg
a48375dae5
I don't quite like this file. I think I will use the trac site to keep
this kind of information instead.
19 роки тому
Richard Nyberg
88aa2eeb63
Better log message.
19 роки тому
Richard Nyberg
c577f4dbff
Better log message.
19 роки тому
Richard Nyberg
cd1164ef02
Be careful not to stop the sub struct if they haven't been started. Also
be careful so that we don't operate on a dead torrent.
19 роки тому
Richard Nyberg
9decd35436
Oops! Forgot to free some memory.
19 роки тому
Richard Nyberg
eef8a3a837
Call realpath after creating the dir. At least on linux the call to realpath
may fail if the last path component doesn't exist.
19 роки тому
Richard Nyberg
c865aa9254
Use c99 types conservatively to compile on OpenBSD. Also convert to or from
time_t via long.
19 роки тому
Richard Nyberg
9732ed1981
Glibc needs sys/file.h for flock.
19 роки тому
Richard Nyberg
b43809ba55
Mostly name changes. Add a missing include. Changed the torrent status
characters displayed by btcli.
19 роки тому
Richard Nyberg
bf75d6af1c
Glibc doesn't support locking in open. Use flock after open instead.
19 роки тому
Richard Nyberg
7dedb28137
Put the ACX_PTHREAD macro from the Autoconf macro archive in acinclude.m4.
Build btpd with pthreads.
19 роки тому
Richard Nyberg
59c62b3eb0
Change the downloaders option to max-uploads. I find it much less confusing
that way :P
19 роки тому
Richard Nyberg
31f0e727df
Add torrent_name function and use it.
19 роки тому
Richard Nyberg
c069f03a8e
btcli stat now takes file arguments to only include stats for the given
torrents.
19 роки тому
Richard Nyberg
ce06752526
Include the info hash in the tpstat structure.
19 роки тому
Richard Nyberg
19b4bf192b
o Since the torrent sub structs always exist now, we can always write all
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.
19 роки тому
Richard Nyberg
d08a4c991d
There's no need for exactly 64 bits for the upload and download count.
Make them long long instead.
19 роки тому
Richard Nyberg
e3dc78703a
Removed the http_redo hack.
19 роки тому
Richard Nyberg
926838a009
o Make the torrent sub struct exist for whole life time of the torrent.
o Better code for stopping the tracker. No more need for the http_redo hack.
19 роки тому
Richard Nyberg
2c43037a69
Fix typo. Index should be i not 1.
19 роки тому
Richard Nyberg
2550d6cb8c
Interaction with btpd is now much more like I want it. Previous work
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 :)
19 роки тому
Richard Nyberg
1a82f0c154
White space.
19 роки тому
Richard Nyberg
634df68e31
Add functions find_btpd_dir.
19 роки тому
Richard Nyberg
8d05b64fa1
Remove unused function canon_path.
19 роки тому
Richard Nyberg
273294989e
Use benc_dget_mema instead of benc_dget_mem + malloc + bcopy.
19 роки тому
Richard Nyberg
b0c4f58f10
Use strtoul to parse length of strings.
19 роки тому
Richard Nyberg
d88c65e982
Added buf_swrite.
19 роки тому
Richard Nyberg
36a68e4b76
Check for failure to allocate memory.
19 роки тому
Richard Nyberg
af64140b1f
Remove som unused code I commited by mistake. Replace integer parse code
in benc_int with a call to strtoll.
19 роки тому
Richard Nyberg
8fd51e90b3
Added description of stat output. Changed the stat output.
19 роки тому
Richard Nyberg
01c92051d5
o Changed the benc_ api to make it easier to use.
o Lot of work on the cli and its communication with btpd.
19 роки тому
Richard Nyberg
6559fcb9a4
Make the buf api safe to continue to use even if an error has occured.
19 роки тому
Richard Nyberg
38418fcd2b
Add functions read_fully and write_fully. They are simpler alternatives to
read and write on blocking sockets.
19 роки тому