From fe42e456b4734bd8746e328e6074b757408bdb22 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 25 Jul 2011 20:46:56 +0000 Subject: [PATCH] (trunk libT) during the extended handshake, don't send the "m" dict if it doesn't have any entries. --- libtransmission/torrent-magnet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtransmission/torrent-magnet.c b/libtransmission/torrent-magnet.c index e9d17d8d6..c73a0c8f9 100644 --- a/libtransmission/torrent-magnet.c +++ b/libtransmission/torrent-magnet.c @@ -327,6 +327,8 @@ tr_torrentGetNextMetadataRequest( tr_torrent * tor, time_t now, int * setme_piec m = tor->incompleteMetadata; +fprintf( stderr, "%s:%d m %p a %d b %d\n", __FILE__, __LINE__, m, (m?( m->piecesNeededCount > 0 ):-1), (m?( m->piecesNeeded[0].requestedAt + MIN_REPEAT_INTERVAL_SECS < now ):-1) ); + if( ( m != NULL ) && ( m->piecesNeededCount > 0 ) && ( m->piecesNeeded[0].requestedAt + MIN_REPEAT_INTERVAL_SECS < now ) )