summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--opentracker.c2
-rw-r--r--ot_accesslist.c2
-rw-r--r--ot_clean.c2
-rw-r--r--ot_fullscrape.c1
-rw-r--r--ot_http.c2
-rw-r--r--ot_iovec.c2
-rw-r--r--ot_livesync.c1
-rw-r--r--ot_mutex.c2
-rw-r--r--ot_rijndael.c2
-rw-r--r--ot_stats.c24
-rw-r--r--ot_stats.h3
-rw-r--r--ot_sync.c2
-rw-r--r--ot_udp.c2
-rw-r--r--ot_vector.c2
-rw-r--r--scan_urlencoded_query.c2
-rw-r--r--trackerlogic.c2
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
49#FEATURES+=-D_DEBUG_HTTPERROR 49#FEATURES+=-D_DEBUG_HTTPERROR
50#FEATURES+=-D_DEBUG_RANDOMTORRENTS 50#FEATURES+=-D_DEBUG_RANDOMTORRENTS
51 51
52GIT_VERSION=$(shell sh -c 'command -v git >/dev/null && test -d .git && git rev-parse HEAD || echo _git_or_commit_not_found_')
53
52OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage 54OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage
53OPTS_production=-O3 55OPTS_production=-O3
54 56
55CFLAGS+=-I$(LIBOWFAT_HEADERS) -Wall -pipe -pthread -Wextra #-ansi -pedantic 57CFLAGS+=-I$(LIBOWFAT_HEADERS) -DGIT_VERSION=$(GIT_VERSION) -Wall -pipe -pthread -Wextra #-ansi -pedantic
56LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread -lz 58LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread -lz
57#LDFLAGS+=-lbsd 59#LDFLAGS+=-lbsd
58 60
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) {
806 806
807 return 0; 807 return 0;
808} 808}
809
810const 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) {
559 return 1; 559 return 1;
560 return 0; 560 return 0;
561} 561}
562
563const 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;
142void clean_init(void) { pthread_create(&thread_id, NULL, clean_worker, NULL); } 142void clean_init(void) { pthread_create(&thread_id, NULL, clean_worker, NULL); }
143 143
144void clean_deinit(void) { pthread_cancel(thread_id); } 144void clean_deinit(void) { pthread_cancel(thread_id); }
145
146const 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) {
313 313
314/* WANT_FULLSCRAPE */ 314/* WANT_FULLSCRAPE */
315#endif 315#endif
316const 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) {
760 http_senddata(sock, ws); 760 http_senddata(sock, ws);
761 return ws->reply_size; 761 return ws->reply_size;
762} 762}
763
764const 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) {
90 length += ((*iovector)[i]).iov_len; 90 length += ((*iovector)[i]).iov_len;
91 return length; 91 return length;
92} 92}
93
94const 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) {
237} 237}
238 238
239#endif 239#endif
240const 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() {
270 pthread_cond_destroy(&tasklist_being_filled); 270 pthread_cond_destroy(&tasklist_being_filled);
271 byte_zero(all_torrents, sizeof(all_torrents)); 271 byte_zero(all_torrents, sizeof(all_torrents));
272} 272}
273
274const 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[
486 rk[43]; 486 rk[43];
487 PUTU32(ct + 12, s3); 487 PUTU32(ct + 12, s3);
488} 488}
489
490const 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
476 return; 476 return;
477 re = r + 32 * OT_STATS_TMPSIZE; 477 re = r + 32 * OT_STATS_TMPSIZE;
478 } 478 }
479 r += sprintf(r, "%08ld: ", loglist->time); 479 r += sprintf(r, "%08ld: ", loglist->time);
480 r += fmt_ip6c(r, loglist->ip); 480 r += fmt_ip6c(r, loglist->ip);
481 *r++ = '\n'; 481 *r++ = '\n';
482 memcpy(r, loglist->data, loglist->size); 482 memcpy(r, loglist->data, loglist->size);
483 r += loglist->size; 483 r += loglist->size;
484 *r++ = '\n'; 484 *r++ = '\n';
@@ -518,10 +518,8 @@ static size_t stats_return_everything(char *reply) {
518 r += sprintf(r, " <completed>\n <count>%llu</count>\n </completed>\n", ot_overall_completed); 518 r += sprintf(r, " <completed>\n <count>%llu</count>\n </completed>\n", ot_overall_completed);
519 r += sprintf(r, " <connections>\n"); 519 r += sprintf(r, " <connections>\n");
520 r += sprintf(r, " <tcp>\n <accept>%llu</accept>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n </tcp>\n", 520 r += sprintf(r, " <tcp>\n <accept>%llu</accept>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n </tcp>\n",
521 ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, ot_overall_tcp_successfulscrapes); 521 ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, ot_overall_tcp_successfulscrapes);
522 r += sprintf( 522 r += sprintf(r, " <udp>\n <overall>%llu</overall>\n <connect>%llu</connect>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n <missmatch>%llu</missmatch>\n </udp>\n",
523 r,
524 " <udp>\n <overall>%llu</overall>\n <connect>%llu</connect>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n <missmatch>%llu</missmatch>\n </udp>\n",
525 ot_overall_udp_connections, ot_overall_udp_connects, ot_overall_udp_successfulannounces, ot_overall_udp_successfulscrapes, 523 ot_overall_udp_connections, ot_overall_udp_connects, ot_overall_udp_successfulannounces, ot_overall_udp_successfulscrapes,
526 ot_overall_udp_connectionidmissmatches); 524 ot_overall_udp_connectionidmissmatches);
527 r += sprintf(r, " <livesync>\n <count>%llu</count>\n </livesync>\n", ot_overall_sync_count); 525 r += sprintf(r, " <livesync>\n <count>%llu</count>\n </livesync>\n", ot_overall_sync_count);
@@ -541,14 +539,10 @@ static size_t stats_return_everything(char *reply) {
541 return r - reply; 539 return r - reply;
542} 540}
543 541
544extern 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,
545 *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,
546 *g_version_livesync_c, *g_version_rijndael_c;
547
548size_t stats_return_tracker_version(char *reply) { 542size_t stats_return_tracker_version(char *reply) {
549 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, 543#define QUOTE(name) #name
550 g_version_http_c, g_version_iovec_c, g_version_mutex_c, g_version_stats_c, g_version_udp_c, g_version_vector_c, 544#define SQUOTE(name) QUOTE(name)
551 g_version_scan_urlencoded_query_c, g_version_trackerlogic_c, g_version_livesync_c, g_version_rijndael_c); 545 return sprintf(reply, "https://erdgeist.org/gitweb/opentracker/commit/?id=" SQUOTE(GIT_VERSION) "\n");
552} 546}
553 547
554size_t return_stats_for_tracker(char *reply, int mode, int format) { 548size_t return_stats_for_tracker(char *reply, int mode, int format) {
@@ -775,5 +769,3 @@ void stats_init() {
775void stats_deinit() { 769void stats_deinit() {
776 pthread_cancel(thread_id); 770 pthread_cancel(thread_id);
777} 771}
778
779const 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);
48void stats_init(void); 48void stats_init(void);
49void stats_deinit(void); 49void stats_deinit(void);
50 50
51extern const char *g_version_rijndael_c;
52extern const char *g_version_livesync_c;
53
54#endif 51#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 ) {
170} 170}
171 171
172#endif 172#endif
173
174const 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) {
234 while (worker_count--) 234 while (worker_count--)
235 pthread_create(&thread_id, NULL, udp_worker, (void *)sock); 235 pthread_create(&thread_id, NULL, udp_worker, (void *)sock);
236} 236}
237
238const 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) {
282 if (need_fix) 282 if (need_fix)
283 vector->data = realloc(vector->data, vector->space * peer_size); 283 vector->data = realloc(vector->data, vector->space * peer_size);
284} 284}
285
286const 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) {
162 *tmp = -*tmp; 162 *tmp = -*tmp;
163 return len; 163 return len;
164} 164}
165
166const 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) {
596 /* Release mutexes */ 596 /* Release mutexes */
597 mutex_deinit(); 597 mutex_deinit();
598} 598}
599
600const char *g_version_trackerlogic_c = "$Source$: $Revision$\n";