anchor.diff:  -define(WAIT_FOR_SOCKET_CLOSE_TIMEOUT, 200).
   -define(SERVER, ?MODULE).
   
  --record(state, {owner, url, parser, sid = nil, rid = nil}).
  +-record(state, {owner,
  +                url,
  +                parser,
  +                sid = nil,
  +                rid = nil,
  +                requests = 0}).
   
   %%%===================================================================
   %%% API
  
positive.code:                 children = [#xmlelement{name = <<"presence">>,
                                     attrs = [{<<"type">>, <<"unavailable">>},
                                              {<<"xmlns">>, <<"jabber:client">>}]}]};
  wrap_elem(Element, #state{sid = Sid, rid=Rid}) ->
      #xmlelement{name = <<"body">>,
              attrs = common_attrs(Rid, Sid),
              children = [Element]}.
  
  common_attrs(Rid) ->
      [{<<"rid">>, pack_rid(Rid)},
  
negative.code:     {noreply, State#state{parser = NewParser}}.
  
  %% Handle async HTTP request replies.
  handle_info({http_reply, {_StatusAndReason, _Hdrs, Body}, Transport}, S) ->
      NS = handle_data(Body, S#state{requests = S#state.requests - 1}),
      NNS = case NS#state.requests == 0 of
          true ->
              send(Transport, empty_body(NS), NS);
          false ->
              NS
      end,
      {noreply, NNS};
  handle_info(_, State) ->
      {noreply, State}.
  
  