AnyEvent::HTTP handling invalid chunked response

ambrus ambrus at math.bme.hu
Sat May 30 21:35:03 CEST 2015


> The limit handling is done via AnyEvent::Handle, you can set a limit 
> for
> this yourself by passing "handle_params => { rbuf_max => 
> $max_chunk_size
> }" to AnyEvent::HTTP.

Thank you, I believe that's a good partial solution.  That will make the 
HTTP request give an error if the server sends junk instead of the chunk 
size, or if the response header is unreasonably long.

But it will also make the request give an error if a very large chunk is 
read.  If the HTTP server sends a very large chunk, I think 
AnyEvent::HTTP shouldn't die, but instead read it in reasonably sized 
units, and call the body callback after each unit.  Is this possible?

-- Ambrus



More information about the anyevent mailing list