diff options
author | erdgeist <> | 2009-06-28 23:11:13 +0000 |
---|---|---|
committer | erdgeist <> | 2009-06-28 23:11:13 +0000 |
commit | 7d67d38e274ed465604117442bc4b20323c744e9 (patch) | |
tree | b664181f0ee61fe54bfd65ae942f8f62de44523e | |
parent | 877e3cfbb05f465ad18a4fdcc5d89ba59b34b629 (diff) |
Fixed an incorrect peer count in udp responses. Credits to Theron Lewis.
-rw-r--r-- | trackerlogic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index f6128fd..2f75b15 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -256,7 +256,7 @@ size_t return_peers_for_torrent( ot_torrent *torrent, size_t amount, char *reply | |||
256 | r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zde8:intervali%ie12:min intervali%ie" PEERS_BENCODED "%zd:", peer_list->seed_count, peer_list->down_count, peer_list->peer_count-peer_list->seed_count, erval, erval/2, OT_PEER_COMPARE_SIZE*amount ); | 256 | r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zde8:intervali%ie12:min intervali%ie" PEERS_BENCODED "%zd:", peer_list->seed_count, peer_list->down_count, peer_list->peer_count-peer_list->seed_count, erval, erval/2, OT_PEER_COMPARE_SIZE*amount ); |
257 | } else { | 257 | } else { |
258 | *(uint32_t*)(r+0) = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM ); | 258 | *(uint32_t*)(r+0) = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM ); |
259 | *(uint32_t*)(r+4) = htonl( peer_list->peer_count ); | 259 | *(uint32_t*)(r+4) = htonl( peer_list->peer_count - peer_list->seed_count ); |
260 | *(uint32_t*)(r+8) = htonl( peer_list->seed_count ); | 260 | *(uint32_t*)(r+8) = htonl( peer_list->seed_count ); |
261 | r += 12; | 261 | r += 12; |
262 | } | 262 | } |