
21 Jun
2011
21 Jun
'11
3:15 a.m.
Hello, Sorry for the delay.
Looks good, I'd love to merge this. I think the only thing we'd need modified to the simple-sendfile API is to accept a callback that's triggered each time a chunk is sent over the stream. How about:
sendfile :: Socket -> FilePath -> FileRange -> IO () -> IO ()
I will change the API soon.
I know it will hurt performance a bit, but what do you think of changing simple-sendfile to send in smaller chunks?
Since all sockets in Haskell are set as non-blocking, sendfile returns with EAGAIN even in case of small files. So, changing API does not change the current behavior. :) --Kazu