From d3985b00b5fb272f6d8bb8ba8ac50b493c40082d Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 16 Apr 2024 16:18:53 +0200 Subject: [PATCH] Remove CVS version tags, they did not work anymore after moving to git --- Makefile | 4 +++- opentracker.c | 2 -- ot_accesslist.c | 2 -- ot_clean.c | 2 -- ot_fullscrape.c | 1 - ot_http.c | 2 -- ot_iovec.c | 2 -- ot_livesync.c | 1 - ot_mutex.c | 2 -- ot_rijndael.c | 2 -- ot_stats.c | 24 ++++++++---------------- ot_stats.h | 3 --- ot_sync.c | 2 -- ot_udp.c | 2 -- ot_vector.c | 2 -- scan_urlencoded_query.c | 2 -- trackerlogic.c | 2 -- 17 files changed, 11 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index 6f9a82b..a224845 100644 --- a/Makefile +++ b/Makefile @@ -49,10 +49,12 @@ FEATURES+=-DWANT_FULLSCRAPE #FEATURES+=-D_DEBUG_HTTPERROR #FEATURES+=-D_DEBUG_RANDOMTORRENTS +GIT_VERSION=$(shell sh -c 'command -v git >/dev/null && test -d .git && git rev-parse HEAD || echo _git_or_commit_not_found_') + OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage OPTS_production=-O3 -CFLAGS+=-I$(LIBOWFAT_HEADERS) -Wall -pipe -pthread -Wextra #-ansi -pedantic +CFLAGS+=-I$(LIBOWFAT_HEADERS) -DGIT_VERSION=$(GIT_VERSION) -Wall -pipe -pthread -Wextra #-ansi -pedantic LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread -lz #LDFLAGS+=-lbsd diff --git a/opentracker.c b/opentracker.c index 497b48d..14e9989 100644 --- a/opentracker.c +++ b/opentracker.c @@ -806,5 +806,3 @@ int main(int argc, char **argv) { return 0; } - -const char *g_version_opentracker_c = "$Source$: $Revision$\n"; diff --git a/ot_accesslist.c b/ot_accesslist.c index c26e14a..4b88c40 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c @@ -559,5 +559,3 @@ int accesslist_is_blessed(ot_ip6 ip, ot_permissions permissions) { return 1; return 0; } - -const char *g_version_accesslist_c = "$Source$: $Revision$\n"; diff --git a/ot_clean.c b/ot_clean.c index 2506cc1..291b847 100644 --- a/ot_clean.c +++ b/ot_clean.c @@ -142,5 +142,3 @@ static pthread_t thread_id; void clean_init(void) { pthread_create(&thread_id, NULL, clean_worker, NULL); } void clean_deinit(void) { pthread_cancel(thread_id); } - -const char *g_version_clean_c = "$Source$: $Revision$\n"; diff --git a/ot_fullscrape.c b/ot_fullscrape.c index d299ed9..aed2ad9 100644 --- a/ot_fullscrape.c +++ b/ot_fullscrape.c @@ -313,4 +313,3 @@ static void fullscrape_make_gzip(int taskid, ot_tasktype mode) { /* WANT_FULLSCRAPE */ #endif -const char *g_version_fullscrape_c = "$Source$: $Revision$\n"; diff --git a/ot_http.c b/ot_http.c index d825426..46390fe 100644 --- a/ot_http.c +++ b/ot_http.c @@ -760,5 +760,3 @@ ssize_t http_handle_request(const int64 sock, struct ot_workstruct *ws) { http_senddata(sock, ws); return ws->reply_size; } - -const char *g_version_http_c = "$Source$: $Revision$\n"; diff --git a/ot_iovec.c b/ot_iovec.c index 9fb30cc..8e94c52 100644 --- a/ot_iovec.c +++ b/ot_iovec.c @@ -90,5 +90,3 @@ size_t iovec_length(const int *iovec_entries, const struct iovec **iovector) { length += ((*iovector)[i]).iov_len; return length; } - -const char *g_version_iovec_c = "$Source$: $Revision$\n"; diff --git a/ot_livesync.c b/ot_livesync.c index 246317b..269b8d8 100644 --- a/ot_livesync.c +++ b/ot_livesync.c @@ -237,4 +237,3 @@ static void *livesync_worker(void *args) { } #endif -const char *g_version_livesync_c = "$Source$: $Revision$\n"; diff --git a/ot_mutex.c b/ot_mutex.c index 1aa2783..3011987 100644 --- a/ot_mutex.c +++ b/ot_mutex.c @@ -270,5 +270,3 @@ void mutex_deinit() { pthread_cond_destroy(&tasklist_being_filled); byte_zero(all_torrents, sizeof(all_torrents)); } - -const char *g_version_mutex_c = "$Source$: $Revision$\n"; diff --git a/ot_rijndael.c b/ot_rijndael.c index f468e2f..3f36bde 100644 --- a/ot_rijndael.c +++ b/ot_rijndael.c @@ -486,5 +486,3 @@ void rijndaelEncrypt128(const uint32_t rk[44], const uint8_t pt[16], uint8_t ct[ rk[43]; PUTU32(ct + 12, s3); } - -const char *g_version_rijndael_c = "$Source$: $Revision$\n"; diff --git a/ot_stats.c b/ot_stats.c index fa456c3..158884f 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -476,9 +476,9 @@ static void stats_return_fulllog(int *iovec_entries, struct iovec **iovector, ch return; re = r + 32 * OT_STATS_TMPSIZE; } - r += sprintf(r, "%08ld: ", loglist->time); - r += fmt_ip6c(r, loglist->ip); - *r++ = '\n'; + r += sprintf(r, "%08ld: ", loglist->time); + r += fmt_ip6c(r, loglist->ip); + *r++ = '\n'; memcpy(r, loglist->data, loglist->size); r += loglist->size; *r++ = '\n'; @@ -518,10 +518,8 @@ static size_t stats_return_everything(char *reply) { r += sprintf(r, " \n %llu\n \n", ot_overall_completed); r += sprintf(r, " \n"); r += sprintf(r, " \n %llu\n %llu\n %llu\n \n", - ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, ot_overall_tcp_successfulscrapes); - r += sprintf( - r, - " \n %llu\n %llu\n %llu\n %llu\n %llu\n \n", + ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, ot_overall_tcp_successfulscrapes); + r += sprintf(r, " \n %llu\n %llu\n %llu\n %llu\n %llu\n \n", ot_overall_udp_connections, ot_overall_udp_connects, ot_overall_udp_successfulannounces, ot_overall_udp_successfulscrapes, ot_overall_udp_connectionidmissmatches); r += sprintf(r, " \n %llu\n \n", ot_overall_sync_count); @@ -541,14 +539,10 @@ static size_t stats_return_everything(char *reply) { return r - reply; } -extern const char *g_version_opentracker_c, *g_version_accesslist_c, *g_version_clean_c, *g_version_fullscrape_c, *g_version_http_c, *g_version_iovec_c, - *g_version_mutex_c, *g_version_stats_c, *g_version_udp_c, *g_version_vector_c, *g_version_scan_urlencoded_query_c, *g_version_trackerlogic_c, - *g_version_livesync_c, *g_version_rijndael_c; - size_t stats_return_tracker_version(char *reply) { - return sprintf(reply, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s", g_version_opentracker_c, g_version_accesslist_c, g_version_clean_c, g_version_fullscrape_c, - g_version_http_c, g_version_iovec_c, g_version_mutex_c, g_version_stats_c, g_version_udp_c, g_version_vector_c, - g_version_scan_urlencoded_query_c, g_version_trackerlogic_c, g_version_livesync_c, g_version_rijndael_c); +#define QUOTE(name) #name +#define SQUOTE(name) QUOTE(name) + return sprintf(reply, "https://erdgeist.org/gitweb/opentracker/commit/?id=" SQUOTE(GIT_VERSION) "\n"); } size_t return_stats_for_tracker(char *reply, int mode, int format) { @@ -775,5 +769,3 @@ void stats_init() { void stats_deinit() { pthread_cancel(thread_id); } - -const char *g_version_stats_c = "$Source$: $Revision$\n"; diff --git a/ot_stats.h b/ot_stats.h index a354c19..4f75049 100644 --- a/ot_stats.h +++ b/ot_stats.h @@ -48,7 +48,4 @@ size_t stats_return_tracker_version(char *reply); void stats_init(void); void stats_deinit(void); -extern const char *g_version_rijndael_c; -extern const char *g_version_livesync_c; - #endif diff --git a/ot_sync.c b/ot_sync.c index 259d4de..293acf3 100644 --- a/ot_sync.c +++ b/ot_sync.c @@ -170,5 +170,3 @@ void sync_deliver( int64 socket ) { } #endif - -const char *g_version_sync_c = "$Source$: $Revision$\n"; diff --git a/ot_udp.c b/ot_udp.c index 912c7e4..97ccd38 100644 --- a/ot_udp.c +++ b/ot_udp.c @@ -234,5 +234,3 @@ void udp_init(int64 sock, unsigned int worker_count) { while (worker_count--) pthread_create(&thread_id, NULL, udp_worker, (void *)sock); } - -const char *g_version_udp_c = "$Source$: $Revision$\n"; diff --git a/ot_vector.c b/ot_vector.c index 744306f..2bc07b5 100644 --- a/ot_vector.c +++ b/ot_vector.c @@ -282,5 +282,3 @@ void vector_fixup_peers(ot_vector *vector, size_t peer_size) { if (need_fix) vector->data = realloc(vector->data, vector->space * peer_size); } - -const char *g_version_vector_c = "$Source$: $Revision$\n"; diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c index 2d3599d..38d544a 100644 --- a/scan_urlencoded_query.c +++ b/scan_urlencoded_query.c @@ -162,5 +162,3 @@ ssize_t scan_fixed_int(char *data, size_t len, int *tmp) { *tmp = -*tmp; return len; } - -const char *g_version_scan_urlencoded_query_c = "$Source$: $Revision$\n"; diff --git a/trackerlogic.c b/trackerlogic.c index 6cc239e..04df544 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -596,5 +596,3 @@ void trackerlogic_deinit(void) { /* Release mutexes */ mutex_deinit(); } - -const char *g_version_trackerlogic_c = "$Source$: $Revision$\n";