anchor.diff:          "OAuth " ++ oauth:header_params_encode(OAuthParams)}].
   
   
  -do_redirect(Worker, Code, Headers, #httpdb{url = Url} = HttpDb, Params, Cb) ->
  -    release_worker(Worker, HttpDb),
  +do_redirect(_Worker, Code, Headers, #httpdb{url = Url} = HttpDb, Params, _Cb) ->
       RedirectUrl = redirect_url(Headers, Url),
       {HttpDb2, Params2} = after_redirect(RedirectUrl, Code, HttpDb, Params),
  -    send_req(HttpDb2, Params2, Cb).
  +    throw({retry, HttpDb2, Params2}).
   
   
   redirect_url(RespHeaders, OrigUrl) ->
  
positive.code:     end,
      Response = ibrowse:send_req_direct(
          Worker, Url, Headers2, Method, Body, IbrowseOptions, Timeout),
      {Worker, Response}.
  
  
  process_response({error, sel_conn_closed}, _Worker, HttpDb, Params, Callback) ->
      send_req(HttpDb, Params, Callback);
  
  process_response({error, {'EXIT', {normal, _}}}, _Worker, HttpDb, Params, Cb) ->
      % ibrowse worker terminated because remote peer closed the socket
      % -> not an error
      send_req(HttpDb, Params, Cb);
  
  process_response({ibrowse_req_id, ReqId}, Worker, HttpDb, Params, Callback) ->
      process_stream_response(ReqId, Worker, HttpDb, Params, Callback);
  
  process_response({ok, Code, Headers, Body}, Worker, HttpDb, Params, Callback) ->
      release_worker(Worker, HttpDb),
      case list_to_integer(Code) of
      Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500) ->
          EJson = case Body of
  
negative.code:             ibrowse:stream_next(ReqId),
              try
                  Ret = Callback(Ok, Headers, StreamDataFun),
                  Ret
              catch
                  throw:{maybe_retry_req, Err} ->
                      maybe_retry(Err, Worker, HttpDb, Params)
              end;
          R when R =:= 301 ; R =:= 302 ; R =:= 303 ->
              do_redirect(Worker, R, Headers, HttpDb, Params, Callback);
  