You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/12/13 23:01:28 UTC

[GitHub] nickva edited a comment on issue #1810: Requests return 400 Bad Request when URL length exceeds 1460 characters

nickva edited a comment on issue #1810: Requests return 400 Bad Request when URL length exceeds 1460 characters
URL: https://github.com/apache/couchdb/issues/1810#issuecomment-447152497
 
 
   Hi @dianabarsan,
   
   Thank you for the bug report and excellent analysis.
   
   You're absolutely correct, `chttpd.server_option = [{recbuf, undefined}]).` ends up not setting recbuf value, which means Erlang userland buffer gets a default value of 1460 (when recbuf is set so is the userland buffer).
   
   This buffer size limit combined with a long-standing bug in Erlang's `{packet, http}` parser ends crashing the socket receive code with an `emsgsize` error.
   
   It's not possible to set the buffer size in mochiweb current, so I will make a PR request to fix that.
   
   Notice:
   
   ```
   30> f(), SockInfo = fun(S) -> inet:getopts(S, [recbuf, buffer]) end, {ok, LS} = gen_tcp:listen(0, [{recbuf, 8192}]), LRes = SockInfo(LS).
   {ok,[{recbuf,8192},{buffer,8192}]}
   ```
   
   ```
   31> f(), SockInfo = fun(S) -> inet:getopts(S, [recbuf, buffer]) end, {ok, LS} = gen_tcp:listen(0, []), LRes = SockInfo(LS).
   {ok,[{recbuf,131072},{buffer,1460}]}
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services