question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handle invalid Uri in HttpSeeds

See original GitHub issue

Working with some torrents from archive.org I’m seeing they have an invalid absolute Uri in their torrent file. E.g. this torrent https://archive.org/download/latinmass2/latinmass2_archive.torrent has an entry for /8/items/ which throws an exception in MonoTorrent.Client.Modes.Mode.DownloadLogic.

      Unexpected main loop exception: System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at MonoTorrent.Client.Modes.Mode.DownloadLogic(Int32 counter)
   at MonoTorrent.Client.Modes.Mode.Tick(Int32 counter)
   at MonoTorrent.Client.Modes.DownloadMode.Tick(Int32 counter)
   at MonoTorrent.Client.ClientEngine.LogicTick()
   at MonoTorrent.Client.ClientEngine.<.ctor>b__77_0()
      MonoTorrent.Client.MainLoop.<>c__DisplayClass10_0.<QueueTimeout>g__Callback|0(Object state)
…     MonoTorrent.Client.MainLoop.Loop()

I could create a PR that uses Uri.TryCreate but I’m not sure if the best place to put the logic would be in the DownloadLogic to just ignore these entries, or in the torrent loading logic.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
phil-scott-78commented, Mar 31, 2021

I suspect GH ate part of your comment there when talking about the List. I was going to assume you were thinking about exposing it as a List<Uri> rather than a List<string>. I already created a PR that tidies up HTTP list with #429 but I could change this to a List<Uri> pretty easily. Doesn’t look like there would be much of a change internally, but this would obviously be a breaking change. I guess now’s the time for that if you want to go that route

0reactions
alanmcgoverncommented, Apr 1, 2021

Great stuff. I just merged that in! Thanks for taking the time to make those changes

Read more comments on GitHub >

github_iconTop Results From Across the Web

visual studio 2015 - Invalid URI error during web test run
I've managed to catch the invalid URI value in VS debugger: Generate code for the webtest (with a toolbar button) Set debugger to...
Read more >
Invalid URI: - Common causes and quick fixes
This can be caused by a variety of issues, such as invalid characters, incorrect syntax, or an incorrect port number. To resolve this...
Read more >
Receiving error Invalid URI: on the response · Issue #928
Hello, I am receiving an Invalid URI exception when process the response on /Salm2/Acs and I have gone through every configuration to understand ......
Read more >
TorrentHandle (jlibtorrent 1.2.0.16-RC2 API) - javadoc.io
Generates a magnet URI from the specified torrent. If the torrent handle is invalid, null is returned. Returns: getUploadLimit. public int getUploadLimit() ...
Read more >
SSL torrents
List of url-seed URLs used by this torrent. The URLs are expected to be properly encoded and not contain any illegal url characters....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found