Passive
{ok, {http_response, Version, Status, Phrase}}
{ok, {http_request, Mth, Uri, Version}}
{ok, {http_header, Bit, Name, IValue, Value}}
{ok, http_eoh}
{error, {http_error, Line}}
Active
{http_response, S, Version, Status, Phrase}
{http_request, S, Meth, Uri, Version}
{http_header, S, Bit, Name, Code, Value}
{http_eoh, S}
{http_error, S, Line}
Change the "gen_tcp:recv()" to "receive" and it's mostly done.
I don't have a patch, because I just modified it to use active mode,
whereas a real patch would give the developer the option of which mode
to use. But let me know if you have any questions.
Steven
PS Oh and BTW, apparently the Erlang developers are planning on
changing the form of the active messages, so anyone who uses active
mode should be aware of that when the next version comes out.
...To make programming easier, a socket where the peer closed and this was detected while in {active, false} mode, will still generate the message {tcp_closed,Socket} when set to {active, once} or {active, true} mode...So, I tried these lines: