<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    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>
    <div class="moz-cite-prefix">On 2015-02-12 10:36, Przemysław Wycisk
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAAaPewJzrBK1bTNq2Z6ks+OisKYLvqBWeVyJ27tGyXkTJJMpKg@mail.gmail.com"
      type="cite">
      <div dir="ltr">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. 
        <div>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.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sun, Feb 8, 2015 at 7:25 PM,
          Przemysław Wycisk <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:p.wycisk@livechatinc.com" target="_blank">p.wycisk@livechatinc.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>I've got problem with using erlang active http
                socket.</div>
              <div><br>
              </div>
              <div>I receive msgs like that:</div>
              <div><br>
              </div>
              <div>ok = inet:setopts(Sock,[{active, true}]),</div>
              <div><span style="white-space:pre-wrap"> </span>receive</div>
              <div><span style="white-space:pre-wrap"> </span>{http,
                Sock, {http_request, HttpMethod, {abs_path, Path},
                _HttpVersion}} -></div>
              <div><span style="white-space:pre-wrap"> </span>Headers =
                getHeaders(Sock),</div>
              <div>                        %more code</div>
              <div><br>
              </div>
              <div>and then headers like that:</div>
              <div><br>
              </div>
              <div>
                <div>getHeaders(Sock, Headers) -></div>
                <div><span style="white-space:pre-wrap"> </span>receive</div>
                <div><span style="white-space:pre-wrap"> </span>{http,
                  Sock, {http_header, _Num, 'Content-Length', _, Value}}
                  -></div>
                <div><span style="white-space:pre-wrap"> </span>NewHeaders
                  = Headers#'headers'{contentLength = Value},</div>
                <div><span style="white-space:pre-wrap"> </span>getHeaders(Sock,
                  NewHeaders);</div>
                <div><span style="white-space:pre-wrap"> </span>{http,
                  Sock, {http_header, _Num, 'Host', _, Value}} -></div>
                <div><span style="white-space:pre-wrap"> </span>NewHeaders
                  = Headers#'headers'{host = Value},</div>
                <div><span style="white-space:pre-wrap"> </span>getHeaders(Sock,
                  NewHeaders);</div>
                <div><span style="white-space:pre-wrap"> </span>{http,
                  Sock, {http_header, _Num, 'User-Agent', _, Value}}
                  -></div>
                <div><span style="white-space:pre-wrap"> </span>NewHeaders
                  = Headers#'headers'{userAgent = Value},</div>
                <div><span style="white-space:pre-wrap"> </span>getHeaders(Sock,
                  NewHeaders);</div>
                <div><span style="white-space:pre-wrap"> </span></div>
                <div><span style="white-space:pre-wrap"> %more headers
                    here</span></div>
                <div><span style="white-space:pre-wrap"> %</span></div>
                <div><span style="white-space:pre-wrap"><br>
                  </span></div>
                <div><span style="white-space:pre-wrap"> </span>{http,
                  Sock, {http_error, Error}} -></div>
                <div><span style="white-space:pre-wrap"> </span>?LOG_INFO("protocol",
                  "http returned error with reason:~p~n", [Error]),</div>
                <div><span style="white-space:pre-wrap"> </span>exit(normal);</div>
                <div><span style="white-space:pre-wrap"> </span>{http,
                  Sock, http_eoh} -></div>
                <div><span style="white-space:pre-wrap"> </span>Headers;</div>
                <div><span style="white-space:pre-wrap"> </span>{tcp_closed,
                  Sock} ->  %<a mark></div>
                <div><span style="white-space:pre-wrap"> </span>?LOG_INFO("connection",
                  "Socket ~w closed by client", [Sock]),</div>
                <div><span style="white-space:pre-wrap"> </span>exit(normal);</div>
                <div><span style="white-space:pre-wrap"> </span>_Else
                  -></div>
                <div><span style="white-space:pre-wrap"> </span>getHeaders(Sock,
                  Headers)</div>
                <div><span style="white-space:pre-wrap"> </span>end.</div>
              </div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>Normally it works fine, packets and headers are
                received from browser and everyone is happy, but there
                is a case, when a browser sends a request, and then i
                get "tcp_closed" in place where <a mark> is
                placed, in the middle of receiving headers.</div>
              <div><br>
              </div>
              <div>This behaviour is strange for me, because it never
                happens in incognito mode. That could mean that bowsers
                cache is involved in the problem, but how?</div>
              <div><br>
              </div>
              <div>Anyone had the same problem? Anyone could help? I
                would be grateful.</div>
              <div><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <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>