cmullaparthi/ibrowse — Issue #61: Error when stopping ibrowe
Author: cmullaparthi
Created: 2012-01-31 05:12:36+00:00
State: open

Following error reported by Sergey Samokhi.

I found that when calling the following function:

```erlang
test() ->
ibrowse:start(),
ibrowse:send_req("http://google.com/", [], get),
ibrowse:stop().
```

ibrowse:stop() causes an error

```erlang

=ERROR REPORT==== 31-Jan-2012::01:34:41 ===
** Generic server <0.160.0> terminating
** Last message in was stop
** When Server state == {state,<0.158.0>,36883,"google.com",80,10,10,1,
undefined}
** Reason for termination ==
** {function_clause,[{ibrowse_lb,'-handle_call/3-fun-0-',
[{<0.161.0>,0,0},[]],
[{file,"src/ibrowse_lb.erl"},{line,115}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{ets,do_foldl,4,[{file,"ets.erl"},{line,198}]},
{ets,foldl,3,[{file,"ets.erl"},{line,187}]},
{ibrowse_lb,handle_call,3,
[{file,"src/ibrowse_lb.erl"},{line,115}]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,578}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]}

=ERROR REPORT==== 31-Jan-2012::01:34:41 ===
** Generic server ibrowse terminating
** Last message in was stop
** When Server state == {state,false}
** Reason for termination ==
** {{case_clause,
{'EXIT',
{{function_clause,
[{ibrowse_lb,'-handle_call/3-fun-0-',
[{<0.161.0>,0,0},[]],
[{file,"src/ibrowse_lb.erl"},{line,115}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{ets,do_foldl,4,[{file,"ets.erl"},{line,198}]},
{ets,foldl,3,[{file,"ets.erl"},{line,187}]},
{ibrowse_lb,handle_call,3,
[{file,"src/ibrowse_lb.erl"},{line,115}]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,578}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]},
{gen_server,call,[<0.160.0>,stop]}}}},
[{ibrowse_lb,stop,1,[{file,"src/ibrowse_lb.erl"},{line,93}]},
{ibrowse,'-handle_call/3-fun-0-',2,[{file,"src/ibrowse.erl"},{line,820}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{ets,do_foldl,4,[{file,"ets.erl"},{line,198}]},
{ets,foldl,3,[{file,"ets.erl"},{line,187}]},
{ibrowse,handle_call,3,[{file,"src/ibrowse.erl"},{line,819}]},
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,578}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
{'EXIT',
{{{case_clause,
{'EXIT',
{{function_clause,
[{ibrowse_lb,'-handle_call/3-fun-0-',
[{<0.161.0>,0,0},[]],
[{file,"src/ibrowse_lb.erl"},{line,115}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{ets,do_foldl,4,[{file,"ets.erl"},{line,198}]},
{ets,foldl,3,[{file,"ets.erl"},{line,187}]},
{ibrowse_lb,handle_call,3,
[{file,"src/ibrowse_lb.erl"},{line,115}]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,578}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]},
{gen_server,call,[<0.160.0>,stop]}}}},
[{ibrowse_lb,stop,1,[{file,"src/ibrowse_lb.erl"},{line,93}]},
{ibrowse,'-handle_call/3-fun-0-',2,
[{file,"src/ibrowse.erl"},{line,820}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{ets,do_foldl,4,[{file,"ets.erl"},{line,198}]},
{ets,foldl,3,[{file,"ets.erl"},{line,187}]},
{ibrowse,handle_call,3,
[{file,"src/ibrowse.erl"},{line,819}]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,578}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]},
{gen_server,call,[ibrowse,stop]}}}
```