[erlang-bugs] httpc_manager cancel_request seems not ok

Micael Karlberg micael.karlberg@REDACTED
Mon May 21 18:55:29 CEST 2012


Hi,

You are correct. This is indeed a bug. Thanks for pointing it out.
I will try to have a fix in R15B02.

Regards,
	/BMK

On 05/18/2012 02:47 PM, Vyacheslav Vorobyov wrote:
> 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.
>



More information about the erlang-bugs mailing list