Age | Commit message (Collapse) | Author |
|
This lead to the following consequences:
* we could efficiently read from storage - if block intersects files
boundaries then we will "view" the block in the two different
bytestrings. To avoid concat we now return lazy bytestring;
* we could read block from socket without "concat" - again, for the
same reason.
The pitfail is that now we have a bit more heap object, but blocks
lifetime is very short and this shouldnt play the big difference. The
lifetime is either (socket -> storage -> unreachable) or (storage ->
socket -> unreachable) unless a lib user keep block for their own
purposes.
|
|
reason: mmap-fixed is pretty useless out of scope of bittorrent, at
least i don't think that it'll be used some time that way. Moreover we
can hide some internal stuff and simplify interface and simplify user
code. Using mmap-fixed we can provide Storage datatype with all
necessary operations needed to keep torrent content in memory of FS.
Also that seems pretty annoying to merge this 2 repos into one using git
merge(there are not so many stuff anyway), so I just did that
manually. :<
|
|
|
|
|
|
Again, the problem is that one function returns errors in two different
ways: Either and IO exceptions. It's better to just throw exception in
either case.
|
|
|
|
|
|
|
|
|
|
|
|
Also add encoding tests for torrent module.
|
|
|
|
|
|
This is a bit faster and pretty!
|
|
This allow to provide better interface.
|
|
There are several reasons for this:
* IntSet is stored in ordinary heap, while ByteStrings in pinned memory;
* Our IntSet's should be much faster 90% time. (in typical BT client)
Hovewer in worst case IntSet is slower, but difference should is not
so big. (We should measure this although)
* It's pure, tested, error-free and much more convenient.
Moreover we have kill a lot of ugly code!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|