[Mono-dev] Bug In MonoTorrent

Alan McGovern alan.mcgovern at gmail.com
Thu Oct 12 13:52:42 EDT 2006

> Hi,
> I tried the MonoTorrent library and found a bug preventing if from working with large torrents or files.
> The torrent contained a file with > 3GB size (Linux DVD image):
> System.IO.IOException was unhandled
>   Message="An attempt was made to move the file pointer before the beginning of the file.\r\n"
>   Source="mscorlib"
>   StackTrace:
>        at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
>        at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin)
>        at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
>        at MonoTorrent.Client.FileManager.Read(Byte[] buffer, Int32 bufferOffset, Int64 offset, Int32 count)
>        at MonoTorrent.Client.FileManager.GetHash(Int32 pieceIndex)
>        at MonoTorrent.Client.TorrentManager.HashCheck(Object state)
>        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
>        at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
> Also some functions like e.g. torrent.DownloadSpeed () seem to be pretty complicated to get right in terms of multithreading use.
> Happy Hacking
> Andreas

I only just noticed the bug today as i wasnt subscribed to the mono dev
list. As you can see, i'm now subscribed ;) Also, the bug is fixed in the
latest SVN. Just had to change an int to a long. The int was overflowing
with an torrent above 2 gigs in size.

Also, about the DownloadSpeed() and UploadSpeed() methods. I have a few
ideas for simplifying that. As it is, that's the first thing that came to my
mind when i had to monitor download speed, but i agree with you 100%. Its
too complicated and multithread un-safe.

Any other bugs, feel free to give me a shout. If anyone wants to start
coding for the library, feel free :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061012/b19c5d8e/attachment.html 

More information about the Mono-devel-list mailing list