Marq Schneider
2fd1f7c34e
Add optional label to be associated with torrent.
If none given, use announce URL as label.
Torrents added with previous versions of btpd will show up as "bad torrent entry"
Closes GH-26
12 years ago
Brian M. Waters
382ccb7485
Accept invalid .torrent files.
Accept .torrent files whose bencoded dictionaries are not in
alphabetical order.
12 years ago
Marq Schneider
a6328070d9
Added ARRAY_COUNT() macro to get number of elements in const arrays.
14 years ago
Marq Schneider
64060294ab
Allow changing the upload and download rates at runtime.
This adds a 'rate' command to modify the up and download
rates on the fly.
Closes GH-10
14 years ago
Marq Schneider
fd18baa9e6
Implement start all (btcli start -a) functionality.
Closes GH-7
14 years ago
Marq Schneider
b1d891c7b1
Don't set a maximum file size. read_file will use the file size.
There was a hard-coded 2MB file size limit on the .torrent files.
Set the limit to 0 so read_file() will use the actual file size.
Closes GH-14
14 years ago
Marq Schneider
1b22c92d46
Applied patches from OpenBSD to fix addrinfo and HTTP.
Applied OpenBSD patches from Nicholas Marriott.
Closes GH-12
14 years ago
Richard Nyberg
e5332f1aa9
Hashtable tweaks.
o Added ability to set the ratio items:buckets.
o One can remove items while iterating.
o _htbl_tov now allocates the result array, _htbl_fillv acts as the old
_htbl_tov did.
16 years ago
Richard Nyberg
a32c7814cc
Show tracker counts in btcli stat.
The counts are for "reachable" trackers, ie. trackers that haven't
timed out or been disabled for one reason or other.
16 years ago
Richard Nyberg
438881f16f
Improve the torrent stop and btpd shutdown sequences.
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.
16 years ago
Richard Nyberg
7b8644dcc1
Provide own implementation of asprintf if it's missing.
16 years ago
Richard Nyberg
df5fc31ea8
Remove unnecessary include.
16 years ago
Richard Nyberg
06bd2a1a21
On solaris bcopy and some other useful functions are declared in strings.h.
16 years ago
Richard Nyberg
50a313570f
Update build scripts for recent btpd changes. Also use only one makefile.
16 years ago
Richard Nyberg
b5d78b066a
Make the http client independent of events and use my iobuf.
16 years ago
Richard Nyberg
3af2b0c0ac
Make iobuf more useful for io and use better names in its api.
16 years ago
Richard Nyberg
186113e4ee
Add the function memfind. It'll be used by iobuf.
16 years ago
Richard Nyberg
340fbf4737
The "Host" HTTP header should be placed as early as possible and also include
the port number.
17 years ago
Richard Nyberg
1758597e3e
Recognize both the CRLF sequence and single LF characters as line terminators.
17 years ago
Richard Nyberg
8f4fde49ee
Fix bug in benc_length. benc_first shouldn't be used here since it returns
NULL on empty lists or dictionaries. This could cause crashes.
Reported by Robert Jonsson.
17 years ago
Richard Nyberg
7c2b7b656e
Fix problem introduced in r345. A call to http_get could cause the
callback to be called before http_get returned.
17 years ago
Richard Nyberg
771e649c41
Don't try to resolve the host if it is already given as an ip address.
17 years ago
Richard Nyberg
9bd0fc6cdc
o Rename net_(write|read)32 to (enc|dec)_be32. Add similar functions for 64
bits as well. Implement them in libmisc instead of in btpd.
o Change resume file format and related APIs. The resume files are now memory
mapped.
17 years ago
Richard Nyberg
352ed70600
Update the build scripts for the following events:
o Some new source files.
o Inclusion of libevent.
o Removal of curl and pthreads dependencies.
18 years ago
Richard Nyberg
568d116335
Remove a couple of forgotten debug printfs.
18 years ago
Richard Nyberg
00e242ce2b
Add bts_filename which gets the current filename from a bt_stream.
18 years ago
Richard Nyberg
1d7b396fc7
Some cleanup. Use names for some numeric constants.
18 years ago
Richard Nyberg
80dcfecbe5
Rename callback type, add timeouts and and allow any http version in the
reply.
18 years ago
Richard Nyberg
d5700c2f20
Add max(x, y) macro.
18 years ago
Richard Nyberg
1b7bb76fb7
Add a simple http client. Since it uses libevent it's a better fit for btpd
than curl.
18 years ago
Richard Nyberg
cd8a3d5ecd
Make mkdirs behave more like 'mkdir -p' and make btpd create the directory
hierarchy to a specified torrent content directory if neccessary.
18 years ago
Richard Nyberg
ff3f222885
OpenBSD doesn't have stdint.h. It'd be great if they would implement basic c99
library support some day...
18 years ago
Richard Nyberg
f20c481b11
There's no need to fsync here, so remove the call. This should improve
write performance.
18 years ago
Richard Nyberg
29495ab53b
Add and use the function make_abs_path. realpath didn't fit my needs.
make_abs_path doesn't need the directories to actually exist in the
file system.
18 years ago
Richard Nyberg
b306439636
Update for the read_whole_file -> read_file change.
18 years ago
Richard Nyberg
3fb4e5a894
Simplify read_whole_file and rename to read_file.
18 years ago
Richard Nyberg
45bf9f2658
Allow empty files in torrents. Create them in stat_and_adjust and let the
stream abstraction skip past them.
18 years ago
Richard Nyberg
a781e02cd8
Add missing includes.
18 years ago
Richard Nyberg
e652eefa26
Add value queries for total amount up- and downloaded. Use the cached values
for torrent size and amount gotten when the torrent isn't active.
18 years ago
Richard Nyberg
ba9ae40fe7
Add command to stop all active torrents. The command is sent by
'btcli stop -a'.
18 years ago
Richard Nyberg
30601882e5
Whitespace.
18 years ago
Richard Nyberg
00db1f1ced
Add function benc_strcmp.
18 years ago
Richard Nyberg
ce0ef9d46b
Better message for ENOTENT.
18 years ago
Richard Nyberg
a5ae3e120f
Some changes to the iobuf interface. Remove a debug assert from btpd_if.c and
make it act properly on iobuf errors.
18 years ago
Richard Nyberg
763cbbb59f
Hook the new files to the build.
18 years ago
Richard Nyberg
8695ecdf18
Pointers to different things need not be represented in the same way.
Use the fact that we only can store structs in the table to make the
complex pointer use safe. Unfortunately the equal and hash functions
need to take void * arguments.
18 years ago
Richard Nyberg
848de36107
This file contains the definitions of the constants used in the btpd
interface.
18 years ago
Richard Nyberg
a162d34982
Moved from ../cli.
18 years ago
Richard Nyberg
13607e007a
Remove unused function bts_hashes.
18 years ago
Richard Nyberg
334c94db46
There is no spoon^H^H^H^Htruct metainfo. Use struct mi_file instead.
18 years ago