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 години
Richard Nyberg
771e649c41
Don't try to resolve the host if it is already given as an ip address.
преди 17 години
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 години
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 години
Richard Nyberg
568d116335
Remove a couple of forgotten debug printfs.
преди 18 години
Richard Nyberg
00e242ce2b
Add bts_filename which gets the current filename from a bt_stream.
преди 18 години
Richard Nyberg
1d7b396fc7
Some cleanup. Use names for some numeric constants.
преди 18 години
Richard Nyberg
80dcfecbe5
Rename callback type, add timeouts and and allow any http version in the
reply.
преди 18 години
Richard Nyberg
d5700c2f20
Add max(x, y) macro.
преди 18 години
Richard Nyberg
1b7bb76fb7
Add a simple http client. Since it uses libevent it's a better fit for btpd
than curl.
преди 18 години
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 години
Richard Nyberg
ff3f222885
OpenBSD doesn't have stdint.h. It'd be great if they would implement basic c99
library support some day...
преди 18 години
Richard Nyberg
f20c481b11
There's no need to fsync here, so remove the call. This should improve
write performance.
преди 18 години
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 години
Richard Nyberg
b306439636
Update for the read_whole_file -> read_file change.
преди 18 години
Richard Nyberg
3fb4e5a894
Simplify read_whole_file and rename to read_file.
преди 18 години
Richard Nyberg
45bf9f2658
Allow empty files in torrents. Create them in stat_and_adjust and let the
stream abstraction skip past them.
преди 18 години
Richard Nyberg
a781e02cd8
Add missing includes.
преди 18 години
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 години
Richard Nyberg
ba9ae40fe7
Add command to stop all active torrents. The command is sent by
'btcli stop -a'.
преди 18 години
Richard Nyberg
30601882e5
Whitespace.
преди 18 години
Richard Nyberg
00db1f1ced
Add function benc_strcmp.
преди 18 години
Richard Nyberg
ce0ef9d46b
Better message for ENOTENT.
преди 18 години
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 години
Richard Nyberg
763cbbb59f
Hook the new files to the build.
преди 18 години
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 години
Richard Nyberg
848de36107
This file contains the definitions of the constants used in the btpd
interface.
преди 18 години
Richard Nyberg
a162d34982
Moved from ../cli.
преди 18 години
Richard Nyberg
13607e007a
Remove unused function bts_hashes.
преди 18 години
Richard Nyberg
334c94db46
There is no spoon^H^H^H^Htruct metainfo. Use struct mi_file instead.
преди 18 години
Richard Nyberg
cd0eb82f20
The metainfo code provided a load -> test -> struct metainfo interface.
The metainfo struct has been replaced by functions for qeurying specific
items from the torrent. In addition, the tests of the torrent data has
been improved.
преди 18 години
Richard Nyberg
c41c08adca
Moved from ../btpd/queue.h
преди 18 години
Richard Nyberg
a27913a47d
Add functions for conversions between binary data and ascii hex.
Add function for reading a whole file.
Enable printf format checking for some functions.
преди 18 години
Richard Nyberg
203d4148e4
Add a hashtable implementation.
преди 18 години
Richard Nyberg
c9ea09b1ad
Enable printf format type checking for buf_print.
преди 18 години
Richard Nyberg
47358cf420
Add function benc_strlen.
преди 18 години
Richard Nyberg
c865aa9254
Use c99 types conservatively to compile on OpenBSD. Also convert to or from
time_t via long.
преди 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
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 години
Richard Nyberg
59bed6ca87
Added vfsync and vfopen.
преди 19 години
Richard Nyberg
b2a877537a
White space.
преди 19 години