diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-07 00:06:27 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-07 00:06:27 +0200 |
commit | b7b84bdec4c94c459ea67b44b829c495d6144312 (patch) | |
tree | ba5c8f503e8a5d1705f08aaadacf2cd7975f4cc0 /ot_vector.c | |
parent | db28465e0c8b30cb7d5e4e9636d4b7a10793656c (diff) |
Number of reported removed peers was too high, correct it by size of peer
Diffstat (limited to 'ot_vector.c')
-rw-r--r-- | ot_vector.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ot_vector.c b/ot_vector.c index 36b326a..479e832 100644 --- a/ot_vector.c +++ b/ot_vector.c | |||
@@ -157,8 +157,8 @@ void vector_remove_torrent( ot_vector *vector, ot_torrent *match ) { | |||
157 | 157 | ||
158 | /* If this is being called after a unsuccessful malloc() for peer_list | 158 | /* If this is being called after a unsuccessful malloc() for peer_list |
159 | in add_peer_to_torrent, match->peer_list actually might be NULL */ | 159 | in add_peer_to_torrent, match->peer_list actually might be NULL */ |
160 | if( match->peer_list6) free_peerlist( match->peer_list6 ); | 160 | free_peerlist( match->peer_list6 ); |
161 | if( match->peer_list4) free_peerlist( match->peer_list4 ); | 161 | free_peerlist( match->peer_list4 ); |
162 | 162 | ||
163 | memmove( match, match + 1, sizeof(ot_torrent) * ( end - match - 1 ) ); | 163 | memmove( match, match + 1, sizeof(ot_torrent) * ( end - match - 1 ) ); |
164 | if( ( --vector->size * OT_VECTOR_SHRINK_THRESH < vector->space ) && ( vector->space >= OT_VECTOR_SHRINK_RATIO * OT_VECTOR_MIN_MEMBERS ) ) { | 164 | if( ( --vector->size * OT_VECTOR_SHRINK_THRESH < vector->space ) && ( vector->space >= OT_VECTOR_SHRINK_RATIO * OT_VECTOR_MIN_MEMBERS ) ) { |