cmullaparthi / ibrowse

Erlang HTTP client
Other
516 stars 190 forks source link

tcp_closed error on accessing www.example.com #101

Closed parroty closed 11 years ago

parroty commented 11 years ago

Hi. I'm getting tcp_closed error on ibrowse/master when accessing some websites. Is it an expected behavior? (change?) What I can observe is the following.

Do you have any insights on avoiding the error?

Eshell V5.10.2  (abort with ^G)
1> ibrowse:start().
{ok,<0.34.0>}
3> ibrowse:send_req("http://www.example.com", [], get).
{ok,"200",
    [{"Accept-Ranges","bytes"},
     {"Cache-Control","max-age=604800"},
     {"Content-Type","text/html"},
     {"Date","Sun, 20 Oct 2013 13:58:58 GMT"},
     {"Etag","\"359670651\""},
     {"Expires","Sun, 27 Oct 2013 13:58:58 GMT"},
     {"Last-Modified","Fri, 09 Aug 2013 23:54:35 GMT"},
     {"Server","ECS (sjc/4FB4)"},
     {"X-Cache","HIT"},
     {"x-ec-custom-error","1"},
     {"Content-Length","1270"}],
    "<!doctype html>\n<html>\n<head>\n    <title>Example Domain</title>\n\n    <meta charset=\"utf-8\" />\n    <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <style type=\"text/css\">\n    body {\n        background-color: #f0f0f2;\n        margin: 0;\n        padding: 0;\n        font-family: \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n        \n    }\n    div {\n        width: 600px;\n        margin: 5em auto;\n        padding: 50px;\n        background-color: #fff;\n        border-radius: 1em;\n    }\n    a:link, a:visited {\n        color: #38488f;\n        text-decoration: none;\n    }\n    @media (max-width: 700px) {\n        body {\n            background-color: #fff;\n        }\n        div {\n            width: auto;\n            margin: 0 auto;\n            border-radius: 0;\n            padding: 1em;\n        }\n    }\n    </style>    \n</head>\n\n<body>\n<div>\n    <h1>Example Domain</h1>\n    <p>This domain is established to be used for illustrative examples in documents. You may use this\n    domain in examples without prior coordination or asking for permission.</p>\n    <p><a href=\"http://www.iana.org/domains/example\">More information...</a></p>\n</div>\n</body>\n</html>\n"}
4> 
=ERROR REPORT==== 20-Oct-2013::22:59:04 ===
** Generic server <0.43.0> terminating 
** Last message in was {tcp_closed,#Port<0.937>}
** When Server state == {state,"www.example.com",80,30000,#Ref<0.0.0.79>,
                               false,undefined,[],false,#Port<0.937>,false,[],
                               {[],[]},
                               undefined,idle,undefined,<<>>,0,0,[],undefined,
                               undefined,undefined,undefined,false,undefined,
                               undefined,<<>>,undefined,false,28691,0,
                               undefined}
** Reason for termination == 
** connection_closed
cmullaparthi commented 11 years ago

HI, can you please try the above patch and see if it fixes the problem?

parroty commented 11 years ago

Hi, thank you. It seems the [error report] becomes not occur on my environment, with 5c01b5e.

cmullaparthi commented 11 years ago

HI, any reason this has been reopened?

parroty commented 11 years ago

Sorry, I just mistakenly hit the close button, and tried to revert back to the original state. I'll be re-closing it.

lexmag commented 10 years ago

It occurs for me on master branch.

cmullaparthi commented 10 years ago

Agree. I haven't merged the changes in the issue-101 branch. Will do soon.

paladiy commented 10 years ago

Hey, @cmullaparthi ! Are you planning to merge this changes to master branch?