[erlang-questions] Are you using {packet, http} ?

Sverker Eriksson sverker@REDACTED
Mon Jul 14 16:20:53 CEST 2008

A message from the OTP team:

There is an undocumented socket packet mode that provides HTTP parsing. 
We are planning to make this packet mode official and possibly also 
change the format of the tuples returned in this mode. One current big 
user is the web server Yaws. We would like to know of other applications 
using this HTTP mode and what kind of impact such an incompatible change 
would have.

A socket using {packet, http} returns tuples like this in *passive* mode:

{ok, {http_request, ...}}
{ok, {http_response, ...}}
{ok, {http_header, ...}}

and tuples like this in *active* mode:

{http_request, Socket, ...}
{http_response, Socket, ...}
{http_header, Socket, ...}

The proposed change would only affect the active mode like this:

{http, Socket, {http_request, ...}}
{http, Socket, {http_response, ...}}
{http, Socket, {http_header, ...}}

The purpose is to make the inner tuples look the same regardless of how 
they were received. This would simplify both the implementation and the 
documentation as well as any applications using both receive modes. 
Applications only using http in passive mode (like Yaws) will not be 

Am I stirring up any worried http-users out there?

/Sverker, Erlang/OTP Ericsson

More information about the erlang-questions mailing list