[erlang-bugs] inets HTTP stream bugs

Steve Vinoski <>
Fri Feb 27 21:26:19 CET 2009


The following problems were found in R12B-5 by my colleague Matt
Evans, and he created and tested the attached patches for them.

The inets HTTP code does not handle HTTP status code 206 (Partial
Content) responses when using streaming. Handling this is required
when a server streams only part of a file (i.e., a range) and thus
returns 206 rather than 200. Without this fix, on Linux the client
would just block and eat 100% of the CPU.

The patches also include a new feature, httpc_response:user_action/4,
which passes HTTP status codes other than 200 or 206 back to the
client's receive loop for handling. This allows for the handling of
redirects, for example. This adds a user_action message to the
existing stream_start, stream, stream_end, etc. message types the
client can handle. Without this addition it doesn't seem possible for
the client to fully know what the server is doing.

hope this helps,
--steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inets_http_patches.txt.gz
Type: application/x-gzip
Size: 1277 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20090227/08b6866c/attachment.bin>


More information about the erlang-bugs mailing list