snowyu / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
1 stars 0 forks source link

HTTP User-Agent not send in announce #671

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install Deluge 1.3.7 together with libtorrent 1.0.1.
2. Add a torrent
3. Observe the user-agent the tracker receives when announcing.

What is the expected output? What do you see instead?
1. HTTP User-Agent of "Deluge 1.3.7" (set at deluge/core/core.py:97).
2. Server recorded no User-Agent.

What version of the product are you using? On what operating system?
libtorrent 1.0.1
Deluge 1.3.7
GCC 4.7.3 with SSP & PIE enabled.
Gentoo Linux

Please provide any additional information below.
I have verified this is not a problem when downgrading to libtorrent 0.16.17.

I verified this using a simple PHP tracker checking $_SERVER['HTTP_USER_AGENT'].

Original issue reported on code.google.com by anthonyr...@gmail.com on 27 Aug 2014 at 9:45

GoogleCodeExporter commented 9 years ago
this is because "anonymous_mode" is enabled by default.. which I'm not sure is 
a good idea

Original comment by arvid.no...@gmail.com on 28 Aug 2014 at 2:10

GoogleCodeExporter commented 9 years ago
Hello Arvid,

Thanks for the quick response. A quick read through the docs showed it stating 
that with that enabled "incoming connections will only be accepted through a 
SOCKS5 or I2P proxy", this certainly seems like something that should default 
to off for the library to be functional by default under most circumstances.

Furthermore, it seems worth noting that the client fingerprint was still 
included in the peer_id, although the user-agent was an empty string. So even 
if a person did wish to enable this, it doesn't appear to be working as the 
docs say it should.

Original comment by anthonyr...@gmail.com on 28 Aug 2014 at 5:34

GoogleCodeExporter commented 9 years ago
"incoming connections will only be accepted through a SOCKS5 or I2P proxy" - 
that's the description for force_proxy, not anonymous_mode (not in 1.0 at 
least).

When you say "client fingerprint was still included in the peer_id", are you 
sure you don't mean the client name is included in the extension handshake? I 
think that is an oversight.

Original comment by arvid.no...@gmail.com on 28 Aug 2014 at 8:54

GoogleCodeExporter commented 9 years ago
actually, I cannot reproduce including the client name in any handshake.

Original comment by arvid.no...@gmail.com on 28 Aug 2014 at 9:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It looks like the documentation needs updating then, 
docs/reference-Settings.html (I don't see a manual.rst in my 1.0.1 tarball) 
seems to have an inaccurate definition of what this setting does and its 
default value.

I'm able to consistently reproduce the issue with the peer_id including the 
fingerprint for Deluge, I imagine it's their bug to fix, so I'll leave that for 
a separate issue with them.
+----------------------+-----------------------+---------------------+
| peer_id              | user_agent            | last_seen           |
+----------------------+-----------------------+---------------------+
| -DE1370-MEY2D*0KHWdD | Deluge 1.3.7          | 2014-08-27 02:29:05 | - 
libtorrent 0.16.16
| -DE1370-l.Z~Yd-EThyW |                       | 2014-08-27 18:18:20 | - 
libtorrent 1.0.1
+----------------------+-----------------------+---------------------+

To the issue at hand, are you planning to switch anonymous_mode off by default 
in a future release, or is that something I should simply patch my local 
version for?

Original comment by anthonyr...@gmail.com on 28 Aug 2014 at 4:59

GoogleCodeExporter commented 9 years ago
yes, I have already committed the patch to disable it by default. At least in 
head of RC_1_0, the documentation says:

"anonymous_mode
defaults to false. When set to true, the client tries to hide its identity to a 
certain degree. The peer-ID will no longer include the client's fingerprint. 
The user-agent will be reset to an empty string. It will also try to not leak 
other identifying information, such as your local listen port, your IP etc.

If you're using I2P, a VPN or a proxy, it might make sense to enable anonymous 
mode."

So, it was wrong about the default (which I fixed by changing the default).

As for seeing the peer-id, are you sure deluge doesn't turn off anonymous_mode 
by default?

Original comment by arvid.no...@gmail.com on 28 Aug 2014 at 5:00

GoogleCodeExporter commented 9 years ago
Thanks for the help, glad to hear it'll be disabled in the next release.

This issue may be closed.

Original comment by anthonyr...@gmail.com on 28 Aug 2014 at 5:02

GoogleCodeExporter commented 9 years ago

Original comment by arvid.no...@gmail.com on 28 Aug 2014 at 5:22