MAY

18

Tue

Author:EMINARCISSUS

被拍砖0次,接着砸!

新版1.92不再有需要修改web.c的情况,但是对于六维BT,还是需要修改libtransmission/metainfo.c(1.80版本以前是:libtransmission/tracker.c)中,

out += tr_snprintf( out, 4, “%%%02X”, (unsigned int)*in++ );

这句中的大写X改成小写x就ok了,改成:

out += tr_snprintf( out, 4, “%%%02x”, (unsigned int)*in++ );

北邮人BT是个好地方呀。

transmission是一个在linux下比较流行的bt客户端,gtk界面,支持daemon,并有方便的web前端和第三方的客户端。

transmission在大约1.50版的时候开始声明支持ipv6了,但是实际使用过程中却发现连接到byrbt的tracker时,服务端见到的ip是v4的ip,即使在/etc/hosts文件中指定了tracker的v6地址也一样。

google到了transmission的trac上有讨论这个问题(1,2)。似乎是transmission在对byrbt这样的v4/v6双栈的tracker时只解析v4地址,不解析v6地址。

trac里原文:

Brief explanation for posterity and those out of the loop: In libTransmission (pre-1.60?, that’s the plan anyway) “torrent” and “tracker” are used interchangeably. With the addition of IPv6 support, the two concepts need to be separated. This is a fairly major refactoring job. For 1.5x and in trunk currently, IPv6 DNS resolution in libcurl (the library we use for tracker communication) is disabled to prevent breakage of trackers with AAAA and A records on the same hostname (notably, TPB). For those of you coming here from #1937, the curl option to disable IPv6 “DNS resolution” apparently also causes curl to bail if given an explicit IPv6 tracker address (such as http://[::1]/announce), so that bug is the same as this one.

解决的办法很简单,修改源码里libtransmission/web.c,找到 curl_easy_setopt( easy, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );一行,将CURL_IPRESOLVE_V4修改为CURL_IPRESOLVE_V6,然后正常编译安装即可。如果同时需要使用v4的 tracker,可以把这部分修改成CURL_IPRESOLVE_WHATEVER。

实际使用效果甚好。原本都是做种很久后才有零星的ipv6的peer连接,现在连上tracker后不久就能得到ipv6的peer了。

转载自:http://yegle.net/2009/04/27/transmission-ipv6-support/

smiley