summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2024-04-05 16:30:02 +0200
committerDirk Engling <erdgeist@erdgeist.org>2024-04-05 16:30:02 +0200
commit524d78d6c7552cd4c44be7cea1ccc7cdbb11b490 (patch)
treefb2de9f3255e9e3a05cf91438eeba7d5c4265251 /trackerlogic.c
parent64e25b681c4668577fa54ead3215442ad707440d (diff)
constify
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index 9d564c1..81bee94 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -45,7 +45,7 @@ void free_peerlist( ot_peerlist *peer_list ) {
45 free( peer_list ); 45 free( peer_list );
46} 46}
47 47
48void add_torrent_from_saved_state( ot_hash hash, ot_time base, size_t down_count ) { 48void add_torrent_from_saved_state( ot_hash const hash, ot_time base, size_t down_count ) {
49 int exactmatch; 49 int exactmatch;
50 ot_torrent *torrent; 50 ot_torrent *torrent;
51 ot_vector *torrents_list = mutex_bucket_lock_by_hash( hash ); 51 ot_vector *torrents_list = mutex_bucket_lock_by_hash( hash );
@@ -317,7 +317,7 @@ size_t return_peers_for_torrent( struct ot_workstruct * ws, ot_torrent *torrent,
317} 317}
318 318
319/* Fetches scrape info for a specific torrent */ 319/* Fetches scrape info for a specific torrent */
320size_t return_udp_scrape_for_torrent( ot_hash hash, char *reply ) { 320size_t return_udp_scrape_for_torrent( ot_hash const hash, char *reply ) {
321 int exactmatch, delta_torrentcount = 0; 321 int exactmatch, delta_torrentcount = 0;
322 ot_vector *torrents_list = mutex_bucket_lock_by_hash( hash ); 322 ot_vector *torrents_list = mutex_bucket_lock_by_hash( hash );
323 ot_torrent *torrent = binary_search( hash, torrents_list->data, torrents_list->size, sizeof( ot_torrent ), OT_HASH_COMPARE_SIZE, &exactmatch ); 323 ot_torrent *torrent = binary_search( hash, torrents_list->data, torrents_list->size, sizeof( ot_torrent ), OT_HASH_COMPARE_SIZE, &exactmatch );
@@ -343,17 +343,17 @@ size_t return_udp_scrape_for_torrent( ot_hash hash, char *reply ) {
343} 343}
344 344
345/* Fetches scrape info for a specific torrent */ 345/* Fetches scrape info for a specific torrent */
346size_t return_tcp_scrape_for_torrent( ot_hash *hash_list, int amount, char *reply ) { 346size_t return_tcp_scrape_for_torrent( ot_hash const *hash_list, int amount, char *reply ) {
347 char *r = reply; 347 char *r = reply;
348 int exactmatch, i; 348 int exactmatch, i;
349 349
350 r += sprintf( r, "d5:filesd" ); 350 r += sprintf( r, "d5:filesd" );
351 351
352 for( i=0; i<amount; ++i ) { 352 for( i=0; i<amount; ++i ) {
353 int delta_torrentcount = 0; 353 int delta_torrentcount = 0;
354 ot_hash *hash = hash_list + i; 354 ot_hash const *hash = hash_list + i;
355 ot_vector *torrents_list = mutex_bucket_lock_by_hash( *hash ); 355 ot_vector *torrents_list = mutex_bucket_lock_by_hash( *hash );
356 ot_torrent *torrent = binary_search( hash, torrents_list->data, torrents_list->size, sizeof( ot_torrent ), OT_HASH_COMPARE_SIZE, &exactmatch ); 356 ot_torrent *torrent = binary_search( hash, torrents_list->data, torrents_list->size, sizeof( ot_torrent ), OT_HASH_COMPARE_SIZE, &exactmatch );
357 357
358 if( exactmatch ) { 358 if( exactmatch ) {
359 if( clean_single_torrent( torrent ) ) { 359 if( clean_single_torrent( torrent ) ) {