anchor.diff:  -include("couch_db.hrl").
   -include("../ibrowse/ibrowse.hrl").
   
  --record (state, {
  +-record (remote, {
       conn = nil,
       reqid = nil,
  +    complete = false,
       count = 0,
       reply_to = nil,
  -    rows = queue:new(),
  -    complete = false
  +    rows = queue:new()
  +}).
  +
  +-record (local, {
  +    changes_from = nil,
  +    changes_pid = nil,
  +    complete = false,
  +    count = 0,
  +    reply_to = nil,
  +    rows = queue:new()
   }).
   
   start(Url, Options) ->
  
positive.code: maybe_stream_next(_Complete, _Count, Id) ->
      ?LOG_DEBUG("~p reqid ~p not streaming", [?MODULE, Id]),
      ok.
  
  start_http_request(RawUrl) ->
      Url = ibrowse_lib:parse_url(RawUrl),
  
negative.code:         {noreply, State}
      end;
  
  handle_info({ibrowse_async_response_end, Id}, #remote{reqid=Id} = State) ->
      ?LOG_DEBUG("got ibrowse_async_response_end ~p", [State#remote.reply_to]),
      case State of
      #remote{reply_to=nil} ->
          {noreply, State#remote{complete=true}};
      #remote{count=0, reply_to=From}->
          gen_server:reply(From, complete),
          {stop, normal, State}
      end;
  
  handle_info({'EXIT', From, normal}, #local{changes_pid=From} = State) ->
      if State#local.reply_to =/= nil ->
          gen_server:reply(State#local.reply_to, complete),
          {stop, normal, State};
      true ->
          {noreply, State#local{complete=true}}
      end;
  handle_info({'EXIT', From, Reason}, #local{changes_pid=From} = State) ->
      ?LOG_ERROR("changes_pid died with reason ~p", [Reason]),
      {stop, changes_pid_died, State};
  
  handle_info(Msg, State) ->
      ?LOG_INFO("unexpected message ~p", [Msg]),
      {noreply, State}.
  
  terminate(_Reason, #remote{conn=Pid}) when is_pid(Pid) ->
      catch ibrowse:stop_worker_process(Pid),
      ok;
  terminate(_Reason, _State) ->
  