diff options
Diffstat (limited to 'trackerlogic.c')
| -rw-r--r-- | trackerlogic.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index d8a2f9b..db1d787 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
| @@ -13,26 +13,26 @@ | |||
| 13 | /* Libowfat */ | 13 | /* Libowfat */ |
| 14 | #include "io.h" | 14 | #include "io.h" |
| 15 | #include "iob.h" | 15 | #include "iob.h" |
| 16 | #include "ip6.h" | ||
| 17 | 16 | ||
| 18 | /* Opentracker */ | 17 | /* Opentracker */ |
| 19 | #include "ot_accesslist.h" | 18 | #include "ot_accesslist.h" |
| 20 | #include "ot_clean.h" | 19 | #include "ot_clean.h" |
| 21 | #include "ot_fullscrape.h" | 20 | #include "ot_fullscrape.h" |
| 22 | #include "ot_http.h" | 21 | #include "ot_http.h" |
| 22 | #include "ot_ip.h" | ||
| 23 | #include "ot_livesync.h" | 23 | #include "ot_livesync.h" |
| 24 | #include "ot_mutex.h" | 24 | #include "ot_mutex.h" |
| 25 | #include "ot_random.h" | 25 | #include "ot_random.h" |
| 26 | #include "ot_stats.h" | 26 | #include "ot_stats.h" |
| 27 | #include "ot_vector.h" | ||
| 28 | #include "ot_udp.h" | 27 | #include "ot_udp.h" |
| 28 | #include "ot_vector.h" | ||
| 29 | #include "trackerlogic.h" | 29 | #include "trackerlogic.h" |
| 30 | 30 | ||
| 31 | /* Forward declaration */ | 31 | /* Forward declaration */ |
| 32 | size_t return_peers_for_torrent(struct ot_workstruct *ws, ot_torrent *torrent, size_t amount, char *reply, PROTO_FLAG proto); | 32 | size_t return_peers_for_torrent(struct ot_workstruct *ws, ot_torrent *torrent, size_t amount, char *reply, PROTO_FLAG proto); |
| 33 | 33 | ||
| 34 | void free_peerlist(ot_peerlist *peer_list) { | 34 | void free_peerlist(ot_peerlist *peer_list) { |
| 35 | if (peer_list->peers.data) { | 35 | if (peer_list && peer_list->peers.data) { |
| 36 | if (OT_PEERLIST_HASBUCKETS(peer_list)) | 36 | if (OT_PEERLIST_HASBUCKETS(peer_list)) |
| 37 | vector_clean_list((ot_vector *)peer_list->peers.data, peer_list->peers.size); | 37 | vector_clean_list((ot_vector *)peer_list->peers.data, peer_list->peers.size); |
| 38 | else | 38 | else |
| @@ -511,7 +511,7 @@ void iterate_all_torrents(int (*for_each)(ot_torrent *torrent, uintptr_t data), | |||
| 511 | 511 | ||
| 512 | ot_peer *peer_from_peer6(ot_peer6 *peer, size_t *peer_size) { | 512 | ot_peer *peer_from_peer6(ot_peer6 *peer, size_t *peer_size) { |
| 513 | ot_ip6 *ip = (ot_ip6 *)peer; | 513 | ot_ip6 *ip = (ot_ip6 *)peer; |
| 514 | if (!ip6_isv4mapped(ip)) { | 514 | if (!ip_is_v4mapped(ip)) { |
| 515 | *peer_size = OT_PEER_SIZE6; | 515 | *peer_size = OT_PEER_SIZE6; |
| 516 | return (ot_peer *)peer; | 516 | return (ot_peer *)peer; |
| 517 | } | 517 | } |
| @@ -521,7 +521,7 @@ ot_peer *peer_from_peer6(ot_peer6 *peer, size_t *peer_size) { | |||
| 521 | 521 | ||
| 522 | size_t peer_size_from_peer6(ot_peer6 *peer) { | 522 | size_t peer_size_from_peer6(ot_peer6 *peer) { |
| 523 | ot_ip6 *ip = (ot_ip6 *)peer; | 523 | ot_ip6 *ip = (ot_ip6 *)peer; |
| 524 | if (!ip6_isv4mapped(ip)) | 524 | if (!ip_is_v4mapped(ip)) |
| 525 | return OT_PEER_SIZE6; | 525 | return OT_PEER_SIZE6; |
| 526 | return OT_PEER_SIZE4; | 526 | return OT_PEER_SIZE4; |
| 527 | } | 527 | } |
