summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index dfff041..62c5972 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -214,7 +214,7 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer ) {
214 case 0: continue; 214 case 0: continue;
215 case 2: torrent->peer_list->seed_count[i]--; 215 case 2: torrent->peer_list->seed_count[i]--;
216 case 1: default: 216 case 1: default:
217 assert( torrent->peer_list->seed_count[i] > 0 ); 217 assert( torrent->peer_list->seed_count[i] >= 0 );
218 assert( torrent->peer_list->seed_count[i] <= torrent->peer_list->peers[i].size ); 218 assert( torrent->peer_list->seed_count[i] <= torrent->peer_list->peers[i].size );
219 return torrent; 219 return torrent;
220 } 220 }
@@ -225,7 +225,7 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer ) {
225 if( !(OT_FLAG(peer_dest) & PEER_FLAG_SEEDING ) && (OT_FLAG(peer) & PEER_FLAG_SEEDING ) ) 225 if( !(OT_FLAG(peer_dest) & PEER_FLAG_SEEDING ) && (OT_FLAG(peer) & PEER_FLAG_SEEDING ) )
226 torrent->peer_list->seed_count[0]++; 226 torrent->peer_list->seed_count[0]++;
227 227
228 assert( torrent->peer_list->seed_count[0] > 0 ); 228 assert( torrent->peer_list->seed_count[0] >= 0 );
229 assert( torrent->peer_list->seed_count[0] <= torrent->peer_list->peers[0].size ); 229 assert( torrent->peer_list->seed_count[0] <= torrent->peer_list->peers[0].size );
230 } 230 }
231 231
@@ -463,7 +463,7 @@ void remove_peer_from_torrent( ot_hash *hash, ot_peer *peer ) {
463 case 0: continue; 463 case 0: continue;
464 case 2: torrent->peer_list->seed_count[i]--; 464 case 2: torrent->peer_list->seed_count[i]--;
465 case 1: default: 465 case 1: default:
466 assert( torrent->peer_list->seed_count[i] > 0 ); 466 assert( torrent->peer_list->seed_count[i] >= 0 );
467 assert( torrent->peer_list->seed_count[i] <= torrent->peer_list->peers[i].size ); 467 assert( torrent->peer_list->seed_count[i] <= torrent->peer_list->peers[i].size );
468 return; 468 return;
469 } 469 }