Manager.Torrent will be null until all metadata has been received. We can modify the code to use Manager.Bitfield instead of trying to get the info from the (non-existent) metadata.
These messages are only useful once we have the torrent metadata and know the number of pieces in the actual torrent. When in metadata mode the bitfield's length will correspond to the number of pieces in the torrent metadata, so the odds are high that an AllowedFast message will refer to an index which does not exist anyway.
Allow users to override default IConnection handlers
Conflicts: src/MonoTorrent.Tests/Common/MagnetLinkTest.cs src/MonoTorrent/Common/MagnetLink.cs
Don't notify broken trackers of Stop()
Couple mistakes, like event delegate being registered in the wrong spot,...
…ot, and a lot of repeating, unnecessary code.
Also remove the rediculously complex autoconf/automake files and use a much simpler configure/Makefile script which just does what we need.
Use WaitHandle.WaitAll () instead of the custom crap which may or may not work properly in all cases.
If a peer is downloading and one of his pieces has been successfully spread throughout the swarm, advertise another piece immediately.
We don't need to choke peers if there's no-one waiting to take the slot.
PeerExchange messages are pretty CPU heavy to process as we need to ensure we don't have duplicate peers in the list. As such, ignore them once we have enough peers.
This change allows me to wrap the lists in a ReadOnlyCollection<T> as appropriate.
To make things consistent the methods for modifying custom values should be named GetCustom, SetCustom and RemoveCustom.