diff options
author | erdgeist <> | 2007-03-05 21:14:50 +0000 |
---|---|---|
committer | erdgeist <> | 2007-03-05 21:14:50 +0000 |
commit | 175c37c3e89f179a3da82a66b06b931b24a52b98 (patch) | |
tree | c53463ca94dc75bea7abae8f1952c10040dd2c0d /trackerlogic.c | |
parent | f1359eb65262fb72bab7044b5a41db883bd05809 (diff) |
Can now handle multiple ips/ports, can BIND to udp ports but not yet handle them, now checks if event=completed comes with left=0 and drops it, if it doesnt
Diffstat (limited to 'trackerlogic.c')
-rw-r--r-- | trackerlogic.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index 3b83b77..18e8cf5 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -221,6 +221,10 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer ) { | |||
221 | } else | 221 | } else |
222 | clean_peerlist( NOW, torrent->peer_list ); | 222 | clean_peerlist( NOW, torrent->peer_list ); |
223 | 223 | ||
224 | /* Sanitize flags: Whoever claims to have completed download, must be a seeder */ | ||
225 | if( ( OT_FLAG( peer ) & ( PEER_FLAG_COMPLETED | PEER_FLAG_SEEDING ) ) == PEER_FLAG_COMPLETED ) | ||
226 | OT_FLAG( peer ) ^= PEER_FLAG_COMPLETED; | ||
227 | |||
224 | peer_pool = &torrent->peer_list->peers[0]; | 228 | peer_pool = &torrent->peer_list->peers[0]; |
225 | peer_dest = vector_find_or_insert( peer_pool, (void*)peer, sizeof( ot_peer ), OT_PEER_COMPARE_SIZE, &exactmatch ); | 229 | peer_dest = vector_find_or_insert( peer_pool, (void*)peer, sizeof( ot_peer ), OT_PEER_COMPARE_SIZE, &exactmatch ); |
226 | 230 | ||