summaryrefslogtreecommitdiff
path: root/trackerlogic.h
diff options
context:
space:
mode:
Diffstat (limited to 'trackerlogic.h')
-rw-r--r--trackerlogic.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/trackerlogic.h b/trackerlogic.h
index 75e98d2..34cee3b 100644
--- a/trackerlogic.h
+++ b/trackerlogic.h
@@ -73,7 +73,6 @@ static const uint8_t PEER_FLAG_LEECHING = 0x00;
73#define OT_PEERFLAG(peer) (((uint8_t*)(peer))[6]) 73#define OT_PEERFLAG(peer) (((uint8_t*)(peer))[6])
74#define OT_PEERTIME(peer) (((uint8_t*)(peer))[7]) 74#define OT_PEERTIME(peer) (((uint8_t*)(peer))[7])
75 75
76#define OT_PEER_COMPARE_SIZE ((size_t)6)
77#define OT_HASH_COMPARE_SIZE (sizeof(ot_hash)) 76#define OT_HASH_COMPARE_SIZE (sizeof(ot_hash))
78 77
79struct ot_peerlist; 78struct ot_peerlist;
@@ -111,17 +110,17 @@ struct ot_peerlist {
111#define WANT_SYNC_PARAM( param ) 110#define WANT_SYNC_PARAM( param )
112#endif 111#endif
113 112
114int trackerlogic_init( const char * const serverdir ); 113void trackerlogic_init( );
115void trackerlogic_deinit( void ); 114void trackerlogic_deinit( void );
116void exerr( char * message ); 115void exerr( char * message );
117 116
118/* add_peer_to_torrent does only release the torrent bucket if from_sync is set, 117/* add_peer_to_torrent does only release the torrent bucket if from_sync is set,
119 otherwise it is released in return_peers_for_torrent */ 118 otherwise it is released in return_peers_for_torrent */
120size_t return_peers_for_torrent( ot_torrent *torrent, size_t amount, char *reply, PROTO_FLAG proto ); 119#define add_peer_to_torrent(hash,peer,proto) add_peer_to_torrent_and_return_peers(hash,peer,proto,0,NULL)
121ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer WANT_SYNC_PARAM( int from_sync ) ); 120size_t add_peer_to_torrent_and_return_peers( ot_hash *hash, ot_peer *peer, PROTO_FLAG proto, size_t amount, char * reply );
122size_t remove_peer_from_torrent( ot_hash *hash, ot_peer *peer, char *reply, PROTO_FLAG proto ); 121size_t remove_peer_from_torrent( ot_hash *hash, ot_peer *peer, char *reply, PROTO_FLAG proto );
123size_t return_tcp_scrape_for_torrent( ot_hash *hash, int amount, char *reply ); 122size_t return_tcp_scrape_for_torrent( ot_hash *hash, int amount, char *reply );
124size_t return_udp_scrape_for_torrent( ot_hash *hash, char *reply ); 123size_t return_udp_scrape_for_torrent( ot_hash *hash, char *reply );
125 124
126/* Helper, before it moves to its own object */ 125/* Helper, before it moves to its own object */
127void free_peerlist( ot_peerlist *peer_list ); 126void free_peerlist( ot_peerlist *peer_list );