diff options
Diffstat (limited to 'trackerlogic.c')
| -rw-r--r-- | trackerlogic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index 59e9643..d8a2f9b 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include "ot_http.h" | 22 | #include "ot_http.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_stats.h" | 26 | #include "ot_stats.h" |
| 26 | #include "ot_vector.h" | 27 | #include "ot_vector.h" |
| 27 | #include "ot_udp.h" | 28 | #include "ot_udp.h" |
| @@ -536,8 +537,8 @@ void trackerlogic_add_random_torrents(size_t amount) { | |||
| 536 | ws.hash = (ot_hash *)ws.inbuf; | 537 | ws.hash = (ot_hash *)ws.inbuf; |
| 537 | 538 | ||
| 538 | while (amount--) { | 539 | while (amount--) { |
| 539 | arc4random_buf(ws.hash, sizeof(ot_hash)); | 540 | random_bytes(ws.hash, sizeof(ot_hash)); |
| 540 | arc4random_buf(&ws.peer, sizeof(ws.peer)); | 541 | random_bytes(&ws.peer, sizeof(ws.peer)); |
| 541 | 542 | ||
| 542 | OT_PEERFLAG(ws.peer) &= PEER_FLAG_SEEDING | PEER_FLAG_COMPLETED | PEER_FLAG_STOPPED; | 543 | OT_PEERFLAG(ws.peer) &= PEER_FLAG_SEEDING | PEER_FLAG_COMPLETED | PEER_FLAG_STOPPED; |
| 543 | 544 | ||
| @@ -555,7 +556,7 @@ void exerr(char *message) { | |||
| 555 | } | 556 | } |
| 556 | 557 | ||
| 557 | void trackerlogic_init(void) { | 558 | void trackerlogic_init(void) { |
| 558 | g_tracker_id = random(); | 559 | g_tracker_id = random_uint32(); |
| 559 | 560 | ||
| 560 | if (!g_stats_path) | 561 | if (!g_stats_path) |
| 561 | g_stats_path = "stats"; | 562 | g_stats_path = "stats"; |
