[erlang-bugs] httpc_manager cancel_request seems not ok

Vyacheslav Vorobyov vjache@REDACTED
Fri May 18 14:47:47 CEST 2012


Seems that me the only person who is using this functionality :). Anyway.
I have a problem with cancel request when using a httpc to get data as
a stream. My version of Erlang is R14B03, but after some digging in
freshest code on github I have found the following interesting things
in httpc_manager:

% The thing 1. . It seems it is supposed that ets table will contain
records #handler_info
do_init(ProfileName, CookiesDir) ->
...
    HandlerDbName = handler_db_name(ProfileName),
    ets:new(HandlerDbName,
	    [protected, set, named_table, {keypos, #handler_info.id}]),

   ...
.

% The thing 2. . It seems it is supposed that ets table will contain a
tuples of arity 3
handle_call({cancel_request, RequestId}, From, State) ->
    ?hcri("cancel_request", [{request_id, RequestId}]),
    case ets:lookup(State#state.handler_db, RequestId) of
	[] ->
	    ...;
	[{_, Pid, _}] ->
	    httpc_handler:cancel(RequestId, Pid, From),
	    {noreply, State#state{cancel =
				  [{RequestId, Pid, From} |
				   State#state.cancel]}}
    end;


The arity of a tuple #handler_info is slightly not 3.

-- 
Best Regargs,
     Vyacheslav



More information about the erlang-bugs mailing list