summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index 52c8c18..9705bd6 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -10,9 +10,6 @@
10#include <stdlib.h> 10#include <stdlib.h>
11#include <string.h> 11#include <string.h>
12 12
13/* Libowfat */
14#include "io.h"
15#include "iob.h"
16 13
17/* Opentracker */ 14/* Opentracker */
18#include "ot_accesslist.h" 15#include "ot_accesslist.h"
@@ -384,7 +381,7 @@ size_t return_peers_for_torrent(struct ot_workstruct *ws, ot_torrent *torrent, s
384size_t return_udp_scrape_for_torrent(ot_hash const hash, char *reply) { 381size_t return_udp_scrape_for_torrent(ot_hash const hash, char *reply) {
385 int exactmatch, delta_torrentcount = 0; 382 int exactmatch, delta_torrentcount = 0;
386 ot_vector *torrents_list = mutex_bucket_lock_by_hash(hash); 383 ot_vector *torrents_list = mutex_bucket_lock_by_hash(hash);
387 ot_torrent *torrent = binary_search(hash, torrents_list->data, torrents_list->size, sizeof(ot_torrent), OT_HASH_COMPARE_SIZE, &exactmatch); 384 ot_torrent *torrent = vector_binary_search(hash, torrents_list->data, torrents_list->size, sizeof(ot_torrent), OT_HASH_COMPARE_SIZE, &exactmatch);
388 385
389 if (!exactmatch) { 386 if (!exactmatch) {
390 memset(reply, 0, 12); 387 memset(reply, 0, 12);
@@ -417,7 +414,7 @@ size_t return_tcp_scrape_for_torrent(ot_hash const *hash_list, size_t amount, ch
417 int delta_torrentcount = 0; 414 int delta_torrentcount = 0;
418 ot_hash const *hash = hash_list + i; 415 ot_hash const *hash = hash_list + i;
419 ot_vector *torrents_list = mutex_bucket_lock_by_hash(*hash); 416 ot_vector *torrents_list = mutex_bucket_lock_by_hash(*hash);
420 ot_torrent *torrent = binary_search(hash, torrents_list->data, torrents_list->size, sizeof(ot_torrent), OT_HASH_COMPARE_SIZE, &exactmatch); 417 ot_torrent *torrent = vector_binary_search(hash, torrents_list->data, torrents_list->size, sizeof(ot_torrent), OT_HASH_COMPARE_SIZE, &exactmatch);
421 418
422 if (exactmatch) { 419 if (exactmatch) {
423 if (clean_single_torrent(torrent)) { 420 if (clean_single_torrent(torrent)) {
@@ -446,7 +443,7 @@ static ot_peerlist dummy_list;
446size_t remove_peer_from_torrent(PROTO_FLAG proto, struct ot_workstruct *ws) { 443size_t remove_peer_from_torrent(PROTO_FLAG proto, struct ot_workstruct *ws) {
447 int exactmatch; 444 int exactmatch;
448 ot_vector *torrents_list = mutex_bucket_lock_by_hash(*ws->hash); 445 ot_vector *torrents_list = mutex_bucket_lock_by_hash(*ws->hash);
449 ot_torrent *torrent = binary_search(ws->hash, torrents_list->data, torrents_list->size, sizeof(ot_torrent), OT_HASH_COMPARE_SIZE, &exactmatch); 446 ot_torrent *torrent = vector_binary_search(ws->hash, torrents_list->data, torrents_list->size, sizeof(ot_torrent), OT_HASH_COMPARE_SIZE, &exactmatch);
450 ot_peerlist *peer_list = &dummy_list; 447 ot_peerlist *peer_list = &dummy_list;
451 size_t peer_size; /* initialized in next line */ 448 size_t peer_size; /* initialized in next line */
452 ot_peer const *peer_src = peer_from_peer6(&ws->peer, &peer_size); 449 ot_peer const *peer_src = peer_from_peer6(&ws->peer, &peer_size);
@@ -550,7 +547,7 @@ void trackerlogic_add_random_torrents(size_t amount) {
550} 547}
551#endif 548#endif
552 549
553void exerr(char *message) { 550void exerr(const char *message) {
554 fprintf(stderr, "%s\n", message); 551 fprintf(stderr, "%s\n", message);
555 exit(111); 552 exit(111);
556} 553}