You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be nice to have something to support range requests more conveniently.
There's two cases here:
general content, some filter or helper ToMessage instance that does the right thing (including setting the response code, length and range headers, stripping of content-md5 etc).
send file, it should be easy enough to support single-range range requests because SendFile supports offset and count.
The text was updated successfully, but these errors were encountered:
I can support both single-range and multi-range requests with SendFile.
It turns out that lazy ByteStrings are a bit of an issue. It seems that something is holding onto a reference to the original Response, so even though I attempt to carve out the request byterange(s) from the body in a GC friendly way -- you can still force the whole lazy ByteString into RAM by requesting the last byte.
I have a feeling that fixing this will require some significant changes to happstack-server, such as changing the Response body to be wrapped in an IORef, or something else not so good.
My inclination is to punt on this for now and instead focus my time on hyperdrive where it should be easy to do it right.
If limited support for byteranges that only worked with SendFile responses would be useful for hackage-server, I'd be willing to carve out and support just the subset of functionality that hackage-server needs for now.
If someone wants to try to fix the lazy ByteString space leak, uncomment this test:
Would be nice to have something to support range requests more conveniently.
There's two cases here:
ToMessage
instance that does the right thing (including setting the response code, length and range headers, stripping of content-md5 etc).The text was updated successfully, but these errors were encountered: