From 2d6b6d4da1d9732b2b02989a4374d356ff840d1b Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 26 Oct 2026 20:03:22 +0100 Subject: Replace libowfat's event waiter with our own abstraction It's with a heavy heart that I remove libowfat as my event library from opentracker. libowfat is what taught opentracker to walk and then fly. The tracker was literally standing on the shoulder of giants when I started writing it in 2006. For its time, the event abstraction was unparalleled and it has held up for many years, and it served the bittorrent community greatly. https://erdgeist.org/gitweb/opentracker/commit/?id=ad472597c569568bad0526d116b601dfcb36638c Unfortunately, it is very likely that libowfat will not be maintained anymore for the foreseeable future, it is already not easy to get its source from upstream and opentracker started receiving bug reports that I can not reasonably answer or patch. Before the project gets more dependent on the limitations of libowfat's current state, I need to teach opentracker to stand on its own feet and fly by itself. I've learned a great deal in the process and have even more respect now for what libowfat pioneered. The path for opentracker is cleared now. Ground work has already been laid in the migration process to support multi threaded http processing while keeping the aggressive reduction of syscalls alive that made the libowfat+opentracker combo so scalable. Here be some dragons, though: Even though there is a unit test suite now, the event loop's rewrite has not been battle tested yet. So you might want to hold up for a bit before jumping on the solo band wagon. What awaits at the end will be a long overdue v1.0, which will be named in honour of Felix. --- Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a373633..87225f7 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,13 @@ GIT_VERSION=`sh -c 'command -v git >/dev/null && test -d .git && git rev-parse H OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage OPTS_production=-O3 -CFLAGS+=-I$(LIBOWFAT_HEADERS) -DGIT_VERSION=$(GIT_VERSION) -Wall -pipe -pthread -Wextra -Wwrite-strings #-ansi -pedantic -LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread +CFLAGS+=-DGIT_VERSION=$(GIT_VERSION) -Wall -pipe -pthread -Wextra -Wwrite-strings #-ansi -pedantic +LDFLAGS+=-pthread + +# Only the proxy, which has not been ported since the tracker went dual stack, +# still wants libowfat. +CFLAGS_libowfat=-I$(LIBOWFAT_HEADERS) +LDFLAGS_libowfat=-L$(LIBOWFAT_LIBRARY) -lowfat BINARY =opentracker HEADERS=trackerlogic.h ot_urlencoded.h ot_batch.h ot_buf.h ot_event.h ot_fdstate.h ot_hex.h ot_ip.h ot_config.h ot_scan.h ot_socket.h ot_mutex.h ot_random.h ot_stats.h ot_vector.h ot_clean.h ot_udp.h ot_iovec.h ot_fullscrape.h ot_accesslist.h ot_http.h ot_livesync.h ot_rijndael.h @@ -84,8 +89,8 @@ all: $(BINARY) $(BINARY).debug CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) -CFLAGS_proxy = $(CFLAGS_production) -DWANT_SYNC_LIVE -CFLAGS_proxy_debug = $(CFLAGS_debug) -DWANT_SYNC_LIVE +CFLAGS_proxy = $(CFLAGS_production) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE +CFLAGS_proxy_debug = $(CFLAGS_debug) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE $(BINARY): $(OBJECTS) $(CC) -o $@ $(OBJECTS) $(LDFLAGS) @@ -93,9 +98,9 @@ $(BINARY): $(OBJECTS) $(BINARY).debug: $(OBJECTS_debug) $(CC) -o $@ $(OBJECTS_debug) $(LDFLAGS) proxy: $(OBJECTS_proxy) - $(CC) -o $@ $(OBJECTS_proxy) $(CFLAGS_production) $(LDFLAGS) + $(CC) -o $@ $(OBJECTS_proxy) $(CFLAGS_production) $(LDFLAGS) $(LDFLAGS_libowfat) proxy.debug: $(OBJECTS_proxy_debug) - $(CC) -o $@ $(OBJECTS_proxy_debug) $(LDFLAGS) + $(CC) -o $@ $(OBJECTS_proxy_debug) $(LDFLAGS) $(LDFLAGS_libowfat) $(OBJECTS): $(HEADERS) $(OBJECTS_debug): $(HEADERS) -- cgit v1.3