[erlang-questions] 8k limit on gen_tcp:recv?

Bob Ippolito <>
Thu Mar 11 00:48:17 CET 2010

Since this is definitely not clear in the question, the code would
look something like this:

    inet:setopts(Socket, [{packet, http}]),
    case gen_tcp:recv(Socket, 0, ?IDLE_TIMEOUT) of
        {ok, {http_request, Method, Path, Version}} ->
            headers(Socket, {Method, Path, Version}, [], Body, 0)

Rachel - how about providing a reproducible test case and making it an
issue in the mochiweb project? There might be some continuation
response from recv that mochiweb doesn't currently expect to receive.


On Wed, Mar 10, 2010 at 3:40 PM, Rachel Willmer <> wrote:
> I've been debugging a problem whereby couchdb rejects a URL longer than 8k.
> At first, I thought it was an already known limitation in mochiweb
> (the stack is couchdb/mochiweb/erlang).
> But with large amounts of ioformat debugging, I've pinned it down to a
> call from mochiweb to gen_tcp:recv which fails on this long URL.
> Is this a known limitation in erlang's gen_tcp:recv?
> Rachel
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:

More information about the erlang-questions mailing list