Browse Source

Fixed an incorrect peer count in udp responses. Credits to Theron Lewis.

master
Dirk Engling 13 years ago
parent
commit
0c0a4533b7
  1. 4
      trackerlogic.c

4
trackerlogic.c

@ -256,7 +256,7 @@ size_t return_peers_for_torrent( ot_torrent *torrent, size_t amount, char *reply
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 );
} else {
*(uint32_t*)(r+0) = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM );
*(uint32_t*)(r+4) = htonl( peer_list->peer_count );
*(uint32_t*)(r+4) = htonl( peer_list->peer_count - peer_list->seed_count );
*(uint32_t*)(r+8) = htonl( peer_list->seed_count );
r += 12;
}
@ -438,4 +438,4 @@ void trackerlogic_deinit( void ) {
mutex_deinit( );
}
const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.130 $\n";
const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.131 $\n";

Loading…
Cancel
Save