<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I would guess that you get a
{tcp_error, Socket, emsgsize} message, which you ignore in your
_Else clause.<br>
<br>
About packets being rejected even though {packet_size,0} is
default. I would consider this a documentation bug maybe. I don't
think we want to change the default behavior to be vulnerable
agains DoS attacks with insane long http lines in need of buffer
space.<br>
<br>
/Sverker, Erlang/OTP<br>
<br>
<br>
<br>
On 02/18/2015 03:57 PM, Zandra Hird wrote:<br>
</div>
<blockquote cite="mid:54E4A874.8000401@erlang.org" type="cite">Hi,
<br>
<br>
It might have to do with some internal buffer limitation (see doc
<a class="moz-txt-link-freetext" href="http://www.erlang.org/doc/man/inet.html">http://www.erlang.org/doc/man/inet.html</a>), so you can try to set
packet_size to big enough to handle the large cookie header and
see if it helps.
<br>
<br>
/ Zandra
<br>
<br>
<br>
On 2015-02-12 10:36, Przemysław Wycisk wrote:
<br>
<blockquote type="cite">The reason of that behaviour was option
packet_size on socket. Default set of this option ({packet_size,
0}) should mean no size (line size in http) limit shouldn't it?,
but packets were dropped because of large cookie header.
<br>
I consider it as a bug, and also i think that if line size limit
in http socket occurs i should get http_error instead of
tcp_closed, it's quite confusing.
<br>
<br>
On Sun, Feb 8, 2015 at 7:25 PM, Przemysław Wycisk
<<a class="moz-txt-link-abbreviated" href="mailto:p.wycisk@livechatinc.com">p.wycisk@livechatinc.com</a>
<a class="moz-txt-link-rfc2396E" href="mailto:p.wycisk@livechatinc.com"><mailto:p.wycisk@livechatinc.com></a>> wrote:
<br>
<br>
I've got problem with using erlang active http socket.
<br>
<br>
I receive msgs like that:
<br>
<br>
ok = inet:setopts(Sock,[{active, true}]),
<br>
receive
<br>
{http, Sock, {http_request, HttpMethod, {abs_path, Path},
<br>
_HttpVersion}} ->
<br>
Headers = getHeaders(Sock),
<br>
%more code
<br>
<br>
and then headers like that:
<br>
<br>
getHeaders(Sock, Headers) ->
<br>
receive
<br>
{http, Sock, {http_header, _Num, 'Content-Length', _,
Value}} ->
<br>
NewHeaders = Headers#'headers'{contentLength = Value},
<br>
getHeaders(Sock, NewHeaders);
<br>
{http, Sock, {http_header, _Num, 'Host', _, Value}} ->
<br>
NewHeaders = Headers#'headers'{host = Value},
<br>
getHeaders(Sock, NewHeaders);
<br>
{http, Sock, {http_header, _Num, 'User-Agent', _, Value}}
->
<br>
NewHeaders = Headers#'headers'{userAgent = Value},
<br>
getHeaders(Sock, NewHeaders);
<br>
%more headers here
<br>
%
<br>
<br>
{http, Sock, {http_error, Error}} ->
<br>
?LOG_INFO("protocol", "http returned error with
reason:~p~n",
<br>
[Error]),
<br>
exit(normal);
<br>
{http, Sock, http_eoh} ->
<br>
Headers;
<br>
{tcp_closed, Sock} -> %<a mark>
<br>
?LOG_INFO("connection", "Socket ~w closed by client",
[Sock]),
<br>
exit(normal);
<br>
_Else ->
<br>
getHeaders(Sock, Headers)
<br>
end.
<br>
<br>
<br>
Normally it works fine, packets and headers are received
from
<br>
browser and everyone is happy, but there is a case, when a
browser
<br>
sends a request, and then i get "tcp_closed" in place where
<a
<br>
mark> is placed, in the middle of receiving headers.
<br>
<br>
This behaviour is strange for me, because it never happens
in
<br>
incognito mode. That could mean that bowsers cache is
involved in
<br>
the problem, but how?
<br>
<br>
Anyone had the same problem? Anyone could help? I would be
grateful.
<br>
<br>
<br>
<br>
<br>
_______________________________________________
<br>
erlang-questions mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
<br>
</blockquote>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>