btpd/btpd — pull request #36 by brianmwaters (2012-04-03 05:04:01+00:00)
Title: Accept invalid .torrent files.

Accept .torrent files whose bencoded dictionaries are not in
alphabetical order.

As originally explained on the btpd Google group:
> I have an improperly-formatted .torrent file; specifically, the
> "announce" key comes last in the top-level dictionary -- if it were
> properly formatted, it would come first. (In a bencoded dictionary,
> the keys are supposed to be in alphabetical order.) When I try to add
> this torrent using bcli, I get an error:
> error loading '[path]' (Invalid argument).
> Clearly, the problem here is the badly-formatted .torrent file, but
> other clients handle it fine, and the .torrent file does contain all
> of the information that the daemon needs. If it were me, I would have
> btpd accept this kind of bad input, but different projects have
> different policies.

I am re-posting this pull request because I deleted my original account. The original is here: https://github.com/btpd/btpd/pull/30. If this patch is accepted, please approve this pull request and delete the old one.