浏览代码

Connection now has whole responsibility of cleanup

HTTP connection process now manages both scenarios
requiring cleaning up of the load balancer's ets table;
instead of this being owned by both the conn and lb.
pull/123/head
benjaminplee 10 年前
父节点
当前提交
13b4f6de25
共有 2 个文件被更改,包括 1 次插入12 次删除
  1. +1
    -0
      src/ibrowse_http_client.erl
  2. +0
    -12
      src/ibrowse_lb.erl

+ 1
- 0
src/ibrowse_http_client.erl 查看文件

@ -266,6 +266,7 @@ handle_info(Info, State) ->
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
terminate(_Reason, State) -> terminate(_Reason, State) ->
do_close(State), do_close(State),
shutting_down(State),
ok. ok.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------

+ 0
- 12
src/ibrowse_lb.erl 查看文件

@ -167,18 +167,6 @@ handle_cast(_Msg, State) ->
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
handle_info({'EXIT', Parent, _Reason}, #state{parent_pid = Parent} = State) -> handle_info({'EXIT', Parent, _Reason}, #state{parent_pid = Parent} = State) ->
{stop, normal, State}; {stop, normal, State};
handle_info({'EXIT', _Pid, _Reason}, #state{ets_tid = undefined} = State) ->
{noreply, State};
handle_info({'EXIT', Pid, _Reason}, #state{ets_tid = Tid} = State) ->
ets:match_delete(Tid, {{'_', Pid}, '_'}),
case ets:info(Tid, size) of
0 ->
ets:delete(Tid),
{noreply, State#state{ets_tid = undefined}, 10000};
_ ->
{noreply, State}
end;
handle_info({trace, Bool}, #state{ets_tid = undefined} = State) -> handle_info({trace, Bool}, #state{ets_tid = undefined} = State) ->
put(my_trace_flag, Bool), put(my_trace_flag, Bool),
{noreply, State}; {noreply, State};

正在加载...
取消
保存