1
0
mirror of git://erdgeist.org/opentracker synced 2025-01-27 15:16:31 +00:00

253 Commits

Author SHA1 Message Date
Dirk Engling
be825f5759 Add support for dynamic accesslists 2022-11-24 04:20:06 +01:00
Dirk Engling
110868ec4e Fix return code check inversion introduced in last commit 2021-08-23 18:12:23 +02:00
Romain Porte
c4fc41a831 opentracker.c: check set*id return values
This commit fix the following similar warnings:

    opentracker.c:562:7: warning: ignoring return value of ‘setegid’
    declared with attribute ‘warn_unused_result’ [-Wunused-result]
    […]

The man page of these functions ask users to explicitly check the return
value in case of any error happening.
2021-08-22 14:40:31 +02:00
Dirk Engling
9a20ebe3f2 Fix typo. Thanks to Romain Porte 2021-07-27 23:15:48 +02:00
Dirk Engling
99544a1030 Handle eagain case in trywrite 2021-05-09 00:02:13 +02:00
Dirk Engling
2f228c27c2 Retry successful writes immediately 2021-04-25 13:30:24 +02:00
Dirk Engling
95f1780f0b Split huge iovecs over multiple io_batches 2021-04-24 03:25:30 +02:00
Dirk Engling
1a349bfa43 Add a handler for the EAGAIN reason code to iob_send 2021-04-21 20:14:58 +02:00
Dirk Engling
b73b3b17cc Use arc4random whereever we need strong entropy 2021-04-20 04:05:50 +02:00
Dirk Engling
616119ee22 Turn random() to nrand48 in inner loop where it is not cryptographically relevant to avoid futex storm. Thanks and credits to Bart Smienk 2021-04-20 03:48:50 +02:00
Dirk Engling
6411f1567f Remove debug code for self pipes 2018-05-26 00:28:10 +02:00
Dirk Engling
d6d4fb0668 Tell libowfat about EWOULDBLOCK conditions 2018-05-26 00:25:59 +02:00
Dirk Engling
48c9c6172b register both ends of self pipe to libowfat in order to use them 2018-01-29 17:32:22 +00:00
Dirk Engling
d4598cc930 Get rid of some warnings regarding header guards 2017-04-28 15:41:24 +02:00
erdgeist
77c13fe6ef Only kick off udp handlers, when everything is initialised 2014-10-07 00:32:07 +02:00
erdgeist
3eeb536a44 Init prng before udp code needs it. 2012-05-28 15:24:33 +00:00
erdgeist
914e0ac302 Add functionality to distribute udp to several workers 2012-04-25 05:48:16 +00:00
erdgeist
ae413a675b undo last change, it did not work well 2012-04-01 04:11:27 +00:00
erdgeist
8bf40b6717 fix tiny issue 2012-04-01 03:23:50 +00:00
erdgeist
1af67bab1d Try to act upon all udp packets at once 2012-03-31 20:01:05 +00:00
erdgeist
85df3dbc01 Open syslog connection before dropping privileges 2010-12-11 15:50:56 +00:00
erdgeist
216447492a Chomp all trailing space characters, including new lines, when parsing the config file 2010-08-18 00:43:12 +00:00
erdgeist
aae0227ee6 Load state only after initialising all structs. Thanks to Michael S. Combs for pointing out the buf 2010-08-17 01:06:22 +00:00
erdgeist
a75c824187 the keep-alive loop must not run, if no keep alive is configured or requested for connection 2010-08-09 14:20:02 +00:00
erdgeist
85e6880233 Make opentracker's user runtime configurable. Also add more debug output to aid finding problems. 2010-04-09 10:15:51 +00:00
erdgeist
a1eec929a1 Only chroot if -d option or tracker.rootdir are set 2010-04-09 09:33:39 +00:00
erdgeist
f3c0359876 Make header parsing more efficient, prepare multithreading and keep-alive. 2009-11-18 04:00:26 +00:00
erdgeist
90e7262d9d Preparing more efficient header parsing 2009-11-18 03:56:26 +00:00
erdgeist
b1bf030f92 Fixed parser error for v6 addresses 2009-11-05 20:20:48 +00:00
erdgeist
5364ea31ca Omit a warning where signed chars can't hold 0xff. Initialisen them with -1 2009-08-26 17:35:52 +00:00
erdgeist
bb770a45a6 Make accesslists thread safe. Signal handler is working in its own thread now, waiting for a signal. All other threads ignore signals. 2009-07-17 18:00:26 +00:00
erdgeist
65d7d9b89c Allow /stats to be located anywhere in your trackers path 2009-06-17 15:06:31 +00:00
erdgeist
2a94892890 Display v4 addresses in v4 mode nicer 2009-06-16 12:17:53 +00:00
erdgeist
5174c61a23 If we don't want v6, tell libowfat not to worry about it. 2009-03-18 14:49:13 +00:00
erdgeist
c7ed890222 Fix white spaces
Introduce loading tracker states with -l
Alter tracker state to a human readable form
2009-03-17 23:57:20 +00:00
erdgeist
9297967f85 Add a stat option the count bucket stalls
Add an iterator for all torrents. It's slower but for stats it's okay.
Move some stats collection stuff to the new iterator. More to come.
Start a "report all stats" page.
Start fixing the code to identify "busy" networks.
Add the concept of hosts allowed to proxy.
Add a parser for the X-Forwarded-For: HTTP header.
Clean up HTTP Header handling code. (Remove some left overs of now vanished sync code).
2009-03-04 14:35:21 +00:00
erdgeist
72a1564ca1 Value of off is not used, so don't calculate it 2009-03-03 01:24:02 +00:00
erdgeist
ff3c0feab5 Add workaround to openbsd's broken v6 API 2009-02-10 14:49:38 +00:00
erdgeist
2d3718151d Fix a pointer arithmetic issue leading to incorrect peer data being copied. Allocate correct size for debugbuffer. Expect exact values on find keywords, not only prefix match. 2009-01-16 04:17:22 +00:00
erdgeist
0b875273d4 Remove debug message 2009-01-16 02:28:54 +00:00
erdgeist
f12fa4c362 Use a self pipe to wake from io_wait when a thread finished his work. 2009-01-16 02:26:50 +00:00
erdgeist
66c906d5d3 Add comments, rename our struct http_data h to cookie, all clientsockets to sock, all size_t from socket_recvs to byte_count. Make signal handler set default handler for the second SIGINT 2009-01-15 23:01:36 +00:00
erdgeist
02b3abbab6 Make v4 and v6 modes v4/v6-ONLY 2009-01-15 16:20:47 +00:00
erdgeist
131211b4da V6 2009-01-13 22:41:17 +00:00
erdgeist
779d6c235f * http and udp routines now use thread local buffers passed in workstruct containers. In other words they do not use static_buffer anymore and are considered to be thread safe.
* the new workstruct also introduces a well defined buffer and result passing path
* a new function scan_find_keywords is a wrapper around scan_urlencoded_query that maps keys in url to values passed in an array of ot_keywords structs
* this new function cleans up much of url parameter parsing work, where read_ptr and write_ptr have been introduced rather than the confusing char *c, *data variables
* I now use memcmp instead of byte_diff to allow compiler to optimize constant size string compares
* got rid of UTORRENT_1600_WORKAROUND
* livesync_ticker is now only called from one (currently main) thread to avoid race conditions
2009-01-05 18:05:39 +00:00
erdgeist
8bdc0d73f6 Make opentracker ANSI C again. 2009-01-03 03:25:37 +00:00
erdgeist
2df09905f5 * opentracker now drops permissions in correct order and really chroots() if ran as root
* lock passing between add_peer_to_torrent and return_peers_for_torrent is now avoided by providing a more general add_peer_to_torrent_and_return_peers function that can be used with NULL parameters to not return any peers (in sync case)
* in order to keep a fast overview how many torrents opentracker maintains, every mutex_bucket_unlock operation expects an additional integer parameter that tells ot_mutex.c how many torrents have been added or removed. A function mutex_get_torrent_count has been introduced.
2009-01-02 08:57:53 +00:00
erdgeist
5c99e50e25 minoe white space 2009-01-01 17:44:04 +00:00
erdgeist
c6947b160f Handle program end more politely 2008-12-07 03:50:51 +00:00
erdgeist
ad8c9ee1ef Avoid cast warning on 64bit machines 2008-12-06 20:21:15 +00:00