Browse Source

if copying seeders from behind, use compare_size to advance pointer

master
Dirk Engling 9 months ago
parent
commit
db28465e0c
  1. 2
      trackerlogic.c

2
trackerlogic.c

@ -215,7 +215,7 @@ static size_t return_peers_all( ot_peerlist *peer_list, size_t peer_size, char *
size_t peer_count = bucket_list[bucket].size; size_t peer_count = bucket_list[bucket].size;
while( peer_count-- ) { while( peer_count-- ) {
if( OT_PEERFLAG_D(peers, peer_size) & PEER_FLAG_SEEDING ) { if( OT_PEERFLAG_D(peers, peer_size) & PEER_FLAG_SEEDING ) {
r_end -= peer_size; r_end -= compare_size;
memcpy( r_end, peers, compare_size); memcpy( r_end, peers, compare_size);
} else { } else {
memcpy( reply, peers, compare_size ); memcpy( reply, peers, compare_size );

Loading…
Cancel
Save