Richard Nyberg
b854501973
Fix for missing AI_ADDRCONFIG.
16 jaren geleden
Richard Nyberg
2947896074
Test that the clock is working at start and test for evloop errors.
16 jaren geleden
Richard Nyberg
50a313570f
Update build scripts for recent btpd changes. Also use only one makefile.
16 jaren geleden
Richard Nyberg
eb421cc586
Btpd now uses evloop, it's own event loop, instead of libevent.
16 jaren geleden
Richard Nyberg
4457c1268a
Let btpd remove torrent data by itself instead of calling rm.
16 jaren geleden
Richard Nyberg
b5d78b066a
Make the http client independent of events and use my iobuf.
16 jaren geleden
Richard Nyberg
3af2b0c0ac
Make iobuf more useful for io and use better names in its api.
16 jaren geleden
Richard Nyberg
b4be0683e6
Add code to connect to host given by its hostname.
16 jaren geleden
Richard Nyberg
a34d4da755
Add a thread for performing asynchronous getaddrinfo's.
16 jaren geleden
Richard Nyberg
42c2605dcb
Bring back the old thread callback code.
16 jaren geleden
Richard Nyberg
1a10f0fb76
Fix type mismatches in a couple of printf statements.
16 jaren geleden
Richard Nyberg
ff76e2bf6c
Add libraries in the correct place.
18 jaren geleden
Richard Nyberg
9a08fda26e
Create the peer id and random seed based on the host name, port and
the time of the initialization in seconds and microseconds.
18 jaren geleden
Richard Nyberg
2886768d30
Clean up the #include sections in the btpd files. Most common headers and
all btpd headers are included through btpd.h.
18 jaren geleden
Richard Nyberg
24c2c1cd4a
#include order.
18 jaren geleden
Richard Nyberg
630f11d18b
I had missed a check for tracker errors. When a torrent is stopping it's
supposed to stop if it can't contact the tracker in STOP_ERRORS tries.
18 jaren geleden
Richard Nyberg
84ae36cd2b
Only keep one block of outgoing data in memory.
18 jaren geleden
Richard Nyberg
796e706974
Update the info files regularly. Before they were only updated when a torrent
stopped.
18 jaren geleden
Richard Nyberg
3c59bb01e2
Set torrent deletion flag as parameter to torrent_stop. Update torrent info
in torrent_stop rather than torrent_kill. The data doesn't change but there
may be some time between the two events.
18 jaren geleden
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.
18 jaren geleden
Richard Nyberg
c8ab530c95
Some code for udp trackers. Not done yet, so it isn't hooked to the build.
18 jaren geleden
Richard Nyberg
564fe5afe1
Some better logging.
18 jaren geleden
Richard Nyberg
372cec7b53
Some clean up of the values sent for tget answers. Send values that makes
sense instead of errors. Fix wrong type for IPC_TVAL_CSIZE, reported by
Arnaud Bergeron.
18 jaren geleden
Richard Nyberg
02733b16ec
Get rid of tp->relpath.
18 jaren geleden
Richard Nyberg
e117d81cf3
Only trigger error handling if an error actually occured. :P
18 jaren geleden
Richard Nyberg
8d7898d728
o Make errors when reading or writing torrent data non fatal. Instead of
killing btpd, only the troublesome torrent will be stopped.
o Some code shuffle.
18 jaren geleden
Richard Nyberg
d00d1fc36a
Call peer_on_no_reqs at the appropriate time.
18 jaren geleden
Richard Nyberg
12c3181b65
Add an option to specify the ip the tracker should distribute for this peer.
19 jaren geleden
Richard Nyberg
eeb9d252e1
Fix bug in get_op. Increase the tracker error counter, and reduce the timeout
for trying the next url, for url's that we can't use. The timeout is in this
case just there to keep btpd from busy looping on a bad url.
19 jaren geleden
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.
19 jaren geleden
Richard Nyberg
8c5200b568
Instead of immediately reading all data a peer requests into outgoing net
buffers, we put placeholder buffers on the list and fill them as they are
needed. At most 4 blocks will be filled per peer we upload to. This number
should probably be made tunable or be based on SO_SNDBUF or something.
Anyway, this should lower btpd's memory usage if one has many uploads.
19 jaren geleden
Richard Nyberg
acc03a93e2
Must call next_url if the current url cannot be requested.
19 jaren geleden
Richard Nyberg
3bb3d2c074
Initialize the interval variable even when we don't read its value from the
tracker reply.
19 jaren geleden
Richard Nyberg
db7f22db73
Avoid unnecessary operations on tracker stop. Use STOP_ERRORS constant
for the number of tracker errors to tolerate when we're stopping.
19 jaren geleden
Richard Nyberg
ebef96d5f8
Missed this file in the last commit. Simplify some interfaces by polling
for state changes when appropriate instead of being called directly at any
time.
19 jaren geleden
Richard Nyberg
95e83bb247
Make the content code unthreaded and remove the no longer needed inter
thread messaging code. Also simplify some interfaces by polling for
state changes when appropriate instead of being called directly at any
time.
19 jaren geleden
Richard Nyberg
abe4001938
Add initialization of evdns.
19 jaren geleden
Richard Nyberg
fb64d693f1
Now that btpd doesn't use select, we don't need to limit fd's to FD_SETSIZE
unless libevent uses the select method.
19 jaren geleden
Richard Nyberg
4466a515e7
Remove calls to the already removed old http code.
19 jaren geleden
Richard Nyberg
03c3b7ec49
Split the tracker code into a generic part and a http specific part. This
allows me to add code for other types of trackers.
Remove the curl interface glue, since I use my own http client now. The curl
code was my main reason for using threads, so I'm a large step closer to make
btpd unthreaded again.
19 jaren geleden
Richard Nyberg
f939819e28
No parenthesis needed around a string value.
19 jaren geleden
Richard Nyberg
4f1d44297a
Don't really know why I did setlocale. Get rid of it since I want the CTYPE
to be standard.
19 jaren geleden
Richard Nyberg
1a17b22bb3
Don't call mkdirs unnecessarily. Note that this code is only needed because
the content code shuts down btpd on errors. When that is fixed this code can
be removed.
19 jaren geleden
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.
19 jaren geleden
Richard Nyberg
110b1d7e22
Always update the tlib info when a torrent is stopped. Some code shuffle.
19 jaren geleden
Richard Nyberg
25788505fa
Forgot to free some memory. Remove some broken code; it wasn't needed
yet anyway. glibc doesn't have the d_namlen field in struct dirent, so
we'll have to use strlen instead.
19 jaren geleden
Richard Nyberg
b0b50e29b6
Create all files of a torrent at startup.
19 jaren geleden
Richard Nyberg
0b9d19de09
Add missing include.
19 jaren geleden
Richard Nyberg
11f7e1ce1f
Safer way to initialize the address.
19 jaren geleden
Richard Nyberg
45bf9f2658
Allow empty files in torrents. Create them in stat_and_adjust and let the
stream abstraction skip past them.
19 jaren geleden