bug in inet_drv.c

Raimo Niskanen raimo.niskanen@REDACTED
Fri Feb 21 15:35:18 CET 2003


To be fixed in the coming R9C, at least.

Thank you.

/ Raimo Niskanen, Erlang/OTP



Klacke wrote:
> Bug in inet_drv.c
> 
> flinta:common> diff  -c inet_drv.c.orig  inet_drv.c
> *** inet_drv.c.orig	Wed Feb 19 21:51:27 2003
> --- inet_drv.c	Wed Feb 19 21:51:30 2003
> ***************
> *** 1990,1995 ****
> --- 1990,1996 ----
>   	  return -1;
>   	while(n && SP(ptr)) { ptr++; n--; }
>   	if (n == 0) {
> + 	  desc->http_state++;
>   	  return http_request_message(desc, meth,
>   				      meth_ptr, meth_len,
>   				      uri_ptr, uri_len,
> 
> 
> 
> The error is in GET request on the form semi broken 0.9 requests.
> 
> # cat bad.txt
> GET /
> 
> # nc localhost 1234 < bad.txt
> ^C
> 
> while erlang runs:
> 
> s() ->
>     
>     {ok,L} = gen_tcp:listen(1234, [{packet,http}, {active, false}]),
>     io:format("After listen\n",[]),
>     {ok,S} = gen_tcp:accept(L),
>     io:format("after accept",[]),
>     R = gen_tcp:recv(S, 0),
>     io:format("First read: ~p~n", [R]),
>     R2 = gen_tcp:recv(S, 0),
>     io:format("second read: ~p~n", [R2]).
> 
> 
> The second read never returns and the fd is never closed. Bad.
> 
> 
> Enjoy
> 
> /klacke
> 
> 




More information about the erlang-questions mailing list