anchor.diff:           terminate/2, code_change/3]).
   
   -define(FLU_PC, machi_proxy_flu1_client).
  +-define(TIMEOUT, 2*1000).
   
   -record(state, {
             members_dict    :: p_srvr_dict(),
  
positive.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  handle_call2({append_chunk_extra, Prefix, Chunk, ChunkExtra}, _From, S) ->
      {reply, sorry_dude, S}.
  
  update_proj(#state{proj=undefined}=S) ->
      update_proj2(1, S);
  
negative.code: 
  update_proj2(Count, #state{bad_proj=BadProj, proxies_dict=ProxiesDict}=S) ->
      Timeout = 2*1000,
      Parent = self(),
      Proxies = orddict:to_list(ProxiesDict),
      Worker = spawn(
                 fun() ->
                    PidsMons =
                        [spawn_monitor(fun() ->
                                        exit(catch ?FLU_PC:read_latest_projection(
                                                         Proxy, private, Timeout))
                                        end) || {_K, Proxy} <- Proxies],
                    Rs = gather_worker_statuses(PidsMons, Timeout*2),
                    Parent ! {res, self(), Rs},
                    exit(normal)
                 end),
      Rs = receive {res, Worker, Results} -> Results
           after Timeout*2 -> []
           end,
      %% TODO: There's a possible bug here when running multiple independent
      %% Machi clusters/chains.  If our chain used to be [a,b], but our
      %% sysadmin has changed our cluster to be [a] and a completely seprate
      %% cluster with [b], and if b is reusing the address & port number,
      %% then it is possible that choose_best_projs() can incorrectly choose
      %% b's projection.
      case choose_best_proj(Rs) of
          P when P >= BadProj ->
              #projection_v1{epoch_number=Epoch, epoch_csum=CSum,
                             members_dict=NewMembersDict} = P,
              io:format(user, "~s: proj ~P\n", [?MODULE, P, 10]),
              EpochID = {Epoch, CSum},
              ?FLU_PC:stop_proxies(ProxiesDict),
              NewProxiesDict = ?FLU_PC:start_proxies(NewMembersDict),
              S#state{bad_proj=undefined, proj=P, epoch_id=EpochID,
                      members_dict=NewMembersDict, proxies_dict=NewProxiesDict};
          _ ->
              timer:sleep(10 + (Count * 20)),
              update_proj2(Count + 1, S)
  