[erlang-questions] gen_tcp and large HTTP headers

Steve Vinoski <>
Fri Jun 24 22:35:37 CEST 2011


On Fri, Jun 24, 2011 at 4:22 PM, Max Lapshin <> wrote:
> I have just thought, that proper web server should always use
> packet_decode, rather than {mode, http}.
>
> I'm currently trying to implement input of POST body as a stream and
> understood very bad thing:
> if client send second request very fast after sending first, it may
> happens so, that post body will come to
> us in the same packet with beginning of next header.

The client is broken in that case, since what you're describing is
HTTP pipelining and POST cannot be pipelined (nor can other
non-idempotent HTTP methods). The client has to wait for the POST
reply before sending the next request.

--steve



More information about the erlang-questions mailing list