Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  http client bug while getting zero-length response

Guest
Posted: Tue Feb 27, 2007 2:43 pm Reply with quote
Guest
Hello everyone.

I've just found a bug in inets http-client (or somewhere in chunk decode
routines). It is reproduced when a remote http-server sends zero-length
response:


goryachev@goryachev:~% erl
Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.5.3 (abort with ^G)
1> http:request(get, {"http://www.goryachev.org/", []}, [], []).

=INFO REPORT==== 27-Feb-2007::17:04:20 ===
The inets application was not started. Has now been started as a temporary application.
{error,session_remotly_closed}
2>
=ERROR REPORT==== 27-Feb-2007::17:05:36 ===
** Generic server <0.41.0> terminating
** Last message in was {tcp_closed,#Port<0.114>}
** When Server state == {state,
{request,
#Ref<0.0.0.68>,
<0.29.0>,
0,
http,
{"www.goryachev.org",80},
"/",
[],
get,
{http_request_h,
undefined,
"keep-alive",
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
"www.goryachev.org",
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
[],
undefined,
undefined,
undefined,
undefined,
"0",
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
[]},
{[],[]},
{http_options,infinity,true,[],undefined,false},
"http://www.goryachev.org/",
[],
none,
[]},
{tcp_session,
{{"www.goryachev.org",80},<0.41.0>},
false,
http,
#Port<0.114>,
1},
{"HTTP/1.1",200,"OK"},
{http_response_h,
undefined,
"keep-alive",
"Tue, 27 Feb 2007 14:03:13 GMT",
undefined,
undefined,
"chunked",
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
"nginx/0.5.11",
"Accept-Encoding, Cookie",
undefined,
undefined,
undefined,
undefined,
"-1",
undefined,
undefined,
undefined,
"text/html; charset=utf-8",
undefined,
undefined,
[]},
undefined,
{http_chunk,
decode_data,
[0,
<<"\r\n">>,
{nolimit,
<<>>,
0,
nolimit,
{200,
{request,
#Ref<0.0.0.68>,
<0.29.0>,
0,
http,
{"www.goryachev.org",80},
"/",
[],
get,
{http_request_h,
undefined,
"keep-alive",
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
"www.goryachev.org",
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
[],
undefined,
undefined,
undefined,
undefined,
"0",
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
[]},
{[],[]},
{http_options,infinity,true,[],undefined,false},
"http://www.goryachev.org/",
[],
none,
[]}}}]},
{[],[]},
new,
[],
nolimit,
nolimit,
{options,{undefined,[]},0,2,2,disabled,enabled,false},
{timers,[],undefined}}
** Reason for termination ==
** session_remotly_closed


This behaviour could be worked around using timeout param (i.e. {timeout, 10000}).



--
Igor Goryachev
Yandex development team.
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist
Guest
Posted: Fri Mar 02, 2007 8:11 am Reply with quote
Guest
Thanks for the bug report.
We'll take a look at it as soon as possible.

Regards,
Gunilla, Erlang/OTP team

Igor Goryachev wrote:
> Hello everyone.
>
> I've just found a bug in inets http-client (or somewhere in chunk decode
> routines). It is reproduced when a remote http-server sends zero-length
> response:
>
>
> goryachev@goryachev:~% erl
> Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0] [hipe] [kernel-poll:false]
>
> Eshell V5.5.3 (abort with ^G)
> 1> http:request(get, {"http://www.goryachev.org/", []}, [], []).
>
> =INFO REPORT==== 27-Feb-2007::17:04:20 ===
> The inets application was not started. Has now been started as a temporary application.
> {error,session_remotly_closed}
> 2>
> =ERROR REPORT==== 27-Feb-2007::17:05:36 ===
> ** Generic server <0.41.0> terminating
> ** Last message in was {tcp_closed,#Port<0.114>}
> ** When Server state == {state,
> {request,
> #Ref<0.0.0.68>,
> <0.29.0>,
> 0,
> http,
> {"www.goryachev.org",80},
> "/",
> [],
> get,
> {http_request_h,
> undefined,
> "keep-alive",
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> "www.goryachev.org",
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> [],
> undefined,
> undefined,
> undefined,
> undefined,
> "0",
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> []},
> {[],[]},
> {http_options,infinity,true,[],undefined,false},
> "http://www.goryachev.org/",
> [],
> none,
> []},
> {tcp_session,
> {{"www.goryachev.org",80},<0.41.0>},
> false,
> http,
> #Port<0.114>,
> 1},
> {"HTTP/1.1",200,"OK"},
> {http_response_h,
> undefined,
> "keep-alive",
> "Tue, 27 Feb 2007 14:03:13 GMT",
> undefined,
> undefined,
> "chunked",
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> "nginx/0.5.11",
> "Accept-Encoding, Cookie",
> undefined,
> undefined,
> undefined,
> undefined,
> "-1",
> undefined,
> undefined,
> undefined,
> "text/html; charset=utf-8",
> undefined,
> undefined,
> []},
> undefined,
> {http_chunk,
> decode_data,
> [0,
> <<"\r\n">>,
> {nolimit,
> <<>>,
> 0,
> nolimit,
> {200,
> {request,
> #Ref<0.0.0.68>,
> <0.29.0>,
> 0,
> http,
> {"www.goryachev.org",80},
> "/",
> [],
> get,
> {http_request_h,
> undefined,
> "keep-alive",
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> "www.goryachev.org",
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> [],
> undefined,
> undefined,
> undefined,
> undefined,
> "0",
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> undefined,
> []},
> {[],[]},
> {http_options,infinity,true,[],undefined,false},
> "http://www.goryachev.org/",
> [],
> none,
> []}}}]},
> {[],[]},
> new,
> [],
> nolimit,
> nolimit,
> {options,{undefined,[]},0,2,2,disabled,enabled,false},
> {timers,[],undefined}}
> ** Reason for termination ==
> ** session_remotly_closed
>
>
> This behaviour could be worked around using timeout param (i.e. {timeout, 10000}).
>
>
>

_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist
Guest
Posted: Tue Mar 06, 2007 10:29 am Reply with quote
Guest
This bug has now been fixed in the coming version of Inets, 4.7.11.

Regards,
Gunilla, Erlang/OTP team


Igor Goryachev wrote:
> Hello everyone.
>
> I've just found a bug in inets http-client (or somewhere in chunk decode
> routines). It is reproduced when a remote http-server sends zero-length
> response:
>
>
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist
Guest
Posted: Tue Mar 06, 2007 10:52 am Reply with quote
Guest
Gunilla Arendt <gunilla@erix.ericsson.se> writes:

> This bug has now been fixed in the coming version of Inets, 4.7.11.

Thanks a lot.


--
Igor Goryachev
Yandex development team.
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum