[web-devel] http-enumerator : Issue with chunked encoding and rawBody

Erik de Castro Lopo mle+hs at mega-nerd.com
Mon Oct 17 12:28:03 CEST 2011


Erik de Castro Lopo wrote:

> The problem seems to be with the "Nothing -> x" case. As an
> experiment I replaced that last line with:
> 
>                 Nothing -> joinI $ chunkedEnumeratee $$ x
> 
> which solves the hang/timeout, but means the data received by the
> client is no longer chunked even though the header says it should
> be. I therefore think I need something like:
> 
>                 Nothing -> joinI $ chunkedPassthuEnumeratee $$ x
> 
> which requires a new Enumeratee that reads chunked data and passes
> it on still chunked. Basically something with a signature like this:
> 
>     chunkedPassthruEnumeratee :: MonadIO m =>
>         Enumeratee S.ByteString S.ByteString m a
> 
> Does this make sense or am I missing a much easier way to do this?

Hmm, the solution seems to be as simple as:


                Nothing -> joinI $ (\k -> return k) $$ x

I'll raise an issue on github.

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the web-devel mailing list