From d922389c9dbda68eb0472194c82c22d70e131314 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 24 Jan 2008 17:16:20 +0000 Subject: [PATCH] #613: fix handshake error with libtorrent / mainline peers --- NEWS | 4 ++++ libtransmission/peer-msgs.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 214bb4172..518004d46 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ NEWS file for Transmission + Leopard: Group dividers + Use the file icon as the per-torrent action button +1.03 (2008/xx/yy) +- All Platforms: + + Fix handshake bug with peers that support LTEP + 1.02 (2008/01/22) - All Platforms: + Fix 1.00 bug that choked some models of routers diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 3c484b2bd..fa2bd63a8 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -849,10 +849,11 @@ parseLtepHandshake( tr_peermsgs * msgs, int len, struct evbuffer * inbuf ) : ENCRYPTION_PREFERENCE_NO; /* check supported messages for utorrent pex */ + msgs->peerSupportsPex = 0; if(( sub = tr_bencDictFindType( &val, "m", TYPE_DICT ))) { if(( sub = tr_bencDictFindType( sub, "ut_pex", TYPE_INT ))) { - msgs->peerSupportsPex = 1; msgs->ut_pex_id = (uint8_t) sub->val.i; + msgs->peerSupportsPex = msgs->ut_pex_id == 0 ? 0 : 1; dbgmsg( msgs, "msgs->ut_pex is %d", (int)msgs->ut_pex_id ); } }