From 55b050f18e604da77910a7ad576879b24634c3dd Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Fri, 18 Feb 2011 00:43:39 +0000 Subject: [PATCH] Clear utp_failed flag upon seeing an announcement for ut_holepunch. --- libtransmission/peer-msgs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 028f1823a..8f829021a 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -939,6 +939,13 @@ parseLtepHandshake( tr_peermsgs * msgs, msgs->ut_metadata_id = (uint8_t) i; dbgmsg( msgs, "msgs->ut_metadata_id is %d", (int)msgs->ut_metadata_id ); } + if( tr_bencDictFindInt( sub, "ut_holepunch", &i ) ) { + /* Mysterious µTorrent extension that we don't grok. However, + it implies support for µTP, so use it to indicate that. */ + tr_peerMgrSetUtpFailed( msgs->torrent, + tr_peerIoGetAddress( msgs->peer->io, NULL ), + FALSE ); + } } /* look for metainfo size (BEP 9) */