summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trackerlogic.c4
-rw-r--r--trackerlogic.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index 5eff5c0..d07851e 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -220,7 +220,7 @@ size_t return_peers_for_torrent( ot_torrent *torrent, size_t amount, char *reply
220 220
221 if( proto == FLAG_TCP ) { 221 if( proto == FLAG_TCP ) {
222 int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM; 222 int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM;
223 r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zde8:intervali%ie12:min intervali%ie5:peers" PEERS6 "%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 ); 223 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 );
224 } else { 224 } else {
225 *(uint32_t*)(r+0) = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM ); 225 *(uint32_t*)(r+0) = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM );
226 *(uint32_t*)(r+4) = htonl( peer_list->peer_count ); 226 *(uint32_t*)(r+4) = htonl( peer_list->peer_count );
@@ -323,7 +323,7 @@ size_t remove_peer_from_torrent( ot_hash hash, ot_peer *peer, char *reply, PROTO
323 323
324 if( proto == FLAG_TCP ) { 324 if( proto == FLAG_TCP ) {
325 int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM; 325 int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM;
326 reply_size = sprintf( reply, "d8:completei%zde10:incompletei%zde8:intervali%ie12:min intervali%ie5:peers0:e", peer_list->seed_count, peer_list->peer_count - peer_list->seed_count, erval, erval / 2 ); 326 reply_size = sprintf( reply, "d8:completei%zde10:incompletei%zde8:intervali%ie12:min intervali%ie" PEERS_BENCODED "0:e", peer_list->seed_count, peer_list->peer_count - peer_list->seed_count, erval, erval / 2 );
327 } 327 }
328 328
329 /* Handle UDP reply */ 329 /* Handle UDP reply */
diff --git a/trackerlogic.h b/trackerlogic.h
index da8f822..42cecb3 100644
--- a/trackerlogic.h
+++ b/trackerlogic.h
@@ -16,10 +16,10 @@ typedef time_t ot_time;
16typedef char ot_ip6[16]; 16typedef char ot_ip6[16];
17#ifdef WANT_V6 17#ifdef WANT_V6
18#define OT_IP_SIZE 16 18#define OT_IP_SIZE 16
19#define PEERS6 "6" 19#define PEERS_BENCODED "6:peers6"
20#else 20#else
21#define OT_IP_SIZE 4 21#define OT_IP_SIZE 4
22#define PEERS6 "" 22#define PEERS_BENCODED "5:peers"
23#endif 23#endif
24 24
25/* Some tracker behaviour tunable */ 25/* Some tracker behaviour tunable */