anchor.diff:  -export([free_proc/1]).
   -export([ask_geoman/2]).
   -export([id_to_name/5]).
  +-export([lookup/1]).
  +-export([lookup_ets/1]).
   -endif.
   
   -define(LOG_FILE, "logs").
  
positive.code: worker(Tid, Todo) ->
      case ets:lookup(Tid, Todo) of
          [{_, Sock}] ->
              case gen_tcp:recv(Sock, 0, 4000) of
                  {ok, {http_request, 'GET', {abs_path, Path}, _}} ->
                      case Path of
                          "/api/ip/get/" ++ IP ->
                              {Code, Json} = lookup(IP),
                              Response = http_response(Code, Json),
                              inet:setopts(Sock, {send_timeout, 4000}),
                              gen_tcp:send(Sock, Response);
                          _ -> pass
                      end;
  
negative.code:     register(?GEO_MANAGER, GeoMan),
      lists:map(fun worker_init/1, lists:seq(0, Procs-1)),
      spawn(?MODULE, snapshot, []),
      {ok, LSock} = gen_tcp:listen(Port, [{active, false}, {packet, http}]),
      loop(LSock, Procs),
      never_get_here.
  
  %% ======== Internal Functions ======== %%
  
  