From 930495a0dbd08b8e4b048c7258067444eb0d546b Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Thu, 15 Jan 2009 16:20:18 +0000 Subject: [PATCH] We sent an incorrect reply dictionary vor v6 announces --- trackerlogic.c | 4 ++-- trackerlogic.h | 4 ++-- 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 if( proto == FLAG_TCP ) { int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM; - 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 ); + 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 ); @@ -323,7 +323,7 @@ size_t remove_peer_from_torrent( ot_hash hash, ot_peer *peer, char *reply, PROTO if( proto == FLAG_TCP ) { int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM; - 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 ); + 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 ); } /* 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; typedef char ot_ip6[16]; #ifdef WANT_V6 #define OT_IP_SIZE 16 -#define PEERS6 "6" +#define PEERS_BENCODED "6:peers6" #else #define OT_IP_SIZE 4 -#define PEERS6 "" +#define PEERS_BENCODED "5:peers" #endif /* Some tracker behaviour tunable */