libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

Web seeds handling issues

Open glassez opened this issue 2 years ago • 10 comments

Due to the fact that libtorrent can add/remove web seeds on its own, I ran into some problems:

  1. The only reliable way to obtain updated list of web seeds is polling, which is not the best option in some scenarios (especially due the way it is getting from libtorrent). Although I can find out about the removal of some web seed, since it is accompanied by url_seed_alert alert, the addition of new one occurs without any alerts.
  2. There is no (convenient) way for application/user to distinguish 'ephemeral' web seeds.
  3. When 'ephemeral' web seeds are added (e.g. due to redirection) the original ones are removed in some cases. The problem that the 'ephemeral' web seeds aren't stored in resume data so they can be lost unexpectedly: https://github.com/arvidn/libtorrent/blob/356219bda36077329051b68ca253db9e7de1932d/src/http_seed_connection.cpp#L336-L340

And generally, is it a good idea to remove the web seeds that were originally there (coming from a torrent file, for example) or added by the user, even in case of an error? In addition, the error may be temporary, for example, due to current network problems, isn't it?

glassez avatar Feb 24 '23 18:02 glassez

Really good observations. It would make more sense to have some disabled-flag for the original web seed, rather than removing it.

And more alerts for these events too.

arvidn avatar Feb 26 '23 11:02 arvidn

Another problem I noticed: if I have some torrent with files renamed locally, libtorrent requests them from the web seed using these changed names, which is incorrect, since the web seed only knows about the original names.

glassez avatar Mar 03 '23 06:03 glassez

@glassez It's strange that I haven't seen this behavior in my 1.2.16 version. But if it does happen, it needs to be corrected. Because there can be many reasons for renaming files when downloading, but the torrent file does not change from that.

master255 avatar Mar 04 '23 00:03 master255

if I have some torrent with files renamed locally, libtorrent requests them from the web seed using these changed names

Does this happen for multi-file torrents, or just single file ones? I discovered a bug in the single-file torrent handling.

arvidn avatar Mar 05 '23 13:03 arvidn

https://github.com/arvidn/libtorrent/pull/7339

arvidn avatar Mar 05 '23 13:03 arvidn

if I have some torrent with files renamed locally, libtorrent requests them from the web seed using these changed names

Does this happen for multi-file torrents, or just single file ones? I discovered a bug in the single-file torrent handling.

As far as I remember, it was single file torrent when I noticed this problem. I do not know if multiple ones are affected.

glassez avatar Mar 05 '23 14:03 glassez

#7339

A good start. Unfortunately, I don't have the opportunity to test this with real web seeds.

Well, it remains to add an alert about new (ephemeral) web seeds. And also provide the user with something more detailed than just web seed urls, so that it will provide an idea of which web seeds are permanent and which are ephemeral.

glassez avatar Mar 06 '23 12:03 glassez

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 12 '23 18:08 stale[bot]

1

master255 avatar Aug 12 '23 21:08 master255