anchor.diff:      {A, B, C, D} = inet:parse_ipv4_address(IP),
       Key = (A bsl 16) + (B bsl 8) + C,
       case ets:lookup(?IPS_TABLE, Key) of
  -        [{_, Value}] ->
  +        [{_, Val}] ->
               L = 255 - D,
               <<_:2, ISP:10, Country:8, Province:12, City:16,
  -              County:16, _:L, X:1, _:D>> = Value,
  +              County:16, _:L, X:1, _:D>> = Val,
               case X of
                   1 ->
                       Geo = id_to_name(ISP, Country, Province, City, County),
                       {200, format([IP | Geo])};
                   0 ->
                       case ets:lookup(?IPS_TABLE, (Key bsl 8) + D) of
  -                        [{_, Value2}] ->
  +                        [{_, Val2}] ->
                               <<_:2, ISP2:10, Country2:8, Province2:12, 
  -                              City2:16, County2:16>> = Value2,
  +                              City2:16, County2:16>> = Val2,
                               Geo2 = id_to_name(ISP2, Country2, Province2,
                                                 City2, County2),
                               {200, format([IP | Geo2])};
  
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: -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").
  