rakshasa / libtorrent

libTorrent BitTorrent library
http://rtorrent.net/downloads/
GNU General Public License v2.0
885 stars 209 forks source link

"Warning message" from some trackers when a torrent isn't registered. #189

Open montoner0 opened 5 years ago

montoner0 commented 5 years ago

Some trackers send "warning message" instead of a failure when a torrent is not registered on the tracker. Looks like this:

d8:intervali3030e12:min intervali3030e5:peers6:S‹™жЊЄ15:warning message22:Torrent not registerede

The change will turn this warning into an error.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.008%) to 17.889% when pulling 39f4ec8b611ddba0926214a0be2f1610e4fd8ef2 on montoner0:master into 3a6a61a4138048134f9048aef81a52f9bf821b29 on rakshasa:master.

rakshasa commented 5 years ago

warning message: (new, optional) Similar to failure reason, but the response still gets processed normally. The warning message is shown just like an error.

I don't think it would be correct to fail the tracker reply based on words in the warning message, it should instead have a way of both processing the reply and displaying the message in the client.

montoner0 commented 5 years ago

Agree, it would be nice to have some more flexible solution. But for know, as a quick hack it should be enough. Or it would be better to register this as an issue?

kannibalox commented 11 months ago

I'm guessing the one of the reasons tracker admins were even using warning message instead of failure message was to work around rTorrent's behavior of ignoring intervals on properly-bencoded tracker failures. Merging this would mean it would go back to the "announce every 300 seconds" pattern, instead of the 3030 being requested in the response you posted. I've opened a PR here to tell libtorrent to respect min interval here https://github.com/rakshasa/libtorrent/pull/246, but even with that fix, I'm not sure it's worth playing whack-a-mole in terms of which keys are error codes and which aren't.