anchor.diff:                              error
                       end
               end
  -    end.
  -
  -do_net_copy_bytes(FH, Sock) ->
  -    case file:read(FH, 1024*1024) of
  -        {ok, Bin} ->
  -            ok = gen_tcp:send(Sock, Bin),
  -            do_net_copy_bytes(FH, Sock);
  -        eof ->
  -            ok
  -    end.
  -
  -do_net_server_delete_migration_only(Sock, File, DataDir) ->
  -    case sanitize_file_string(File) of
  -        ok ->
  -            do_net_server_delete_migration_only2(Sock, File, DataDir);
  -        _ ->
  -            ok = gen_tcp:send(Sock, <<"ERROR BAD-ARG\n">>)
  -    end.
  -
  -do_net_server_delete_migration_only2(Sock, File, DataDir) ->
  -    {_, Path} = machi_util:make_data_filename(DataDir, File),
  -    case file:delete(Path) of
  -        ok ->
  -            ok = gen_tcp:send(Sock, "OK\n");
  -        {error, enoent} ->
  -            ok = gen_tcp:send(Sock, "ERROR NO-SUCH-FILE\n");
  -        _ ->
  -            ok = gen_tcp:send(Sock, "ERROR\n")
  -    end.
  -
  -do_net_server_truncate_hackityhack(Sock, File, DataDir) ->
  -    case sanitize_file_string(File) of
  -        ok ->
  -            do_net_server_truncate_hackityhack2(Sock, File, DataDir);
  -        _ ->
  -            ok = gen_tcp:send(Sock, <<"ERROR BAD-ARG\n">>)
  -    end.
  -
  -do_net_server_truncate_hackityhack2(Sock, File, DataDir) ->
  -    {_, Path} = machi_util:make_data_filename(DataDir, File),
  -    case file:open(Path, [read, write, binary, raw]) of
  -        {ok, FH} ->
  -            try
  -                {ok, ?MINIMUM_OFFSET} = file:position(FH, ?MINIMUM_OFFSET),
  -                ok = file:truncate(FH),
  -                ok = gen_tcp:send(Sock, "OK\n")
  -            after
  -                file:close(FH)
  -            end;
  -        {error, enoent} ->
  -            ok = gen_tcp:send(Sock, "ERROR NO-SUCH-FILE\n");
  -        _ ->
  -            ok = gen_tcp:send(Sock, "ERROR\n")
       end.
   
   write_server_get_pid(Prefix, DataDir, LinkPid) ->
  
positive.code:             ok = gen_tcp:send(Sock, <<"HTTP/1.0 499 TIMEOUT\r\n\r\n">>)
      end.
  
  http_server_hack_get(Sock, _G, _FluName, MyURI, S) ->
      DataDir = S#state.data_dir,
      {Wedged_p, CurrentEpochId} = ets:lookup_element(S#state.etstab, epoch, 2),
      EpochID = <<"unused">>,
      NoSuchFileFun = fun(Sck) ->
                              ok = gen_tcp:send(Sck, "HTTP/1.0 455 NOT-WRITTEN\r\n\r\n")
                      end,
      BadIoFun = fun(Sck) ->
                              ok = gen_tcp:send(Sck, "HTTP/1.0 466 BAD-IO\r\n\r\n")
                 end,
      DoItFun = fun(FH, Offset, Len) ->
                        case file:pread(FH, Offset, Len) of
                            {ok, Bytes} when byte_size(Bytes) == Len ->
                                Hdrs = io_lib:format("HTTP/1.0 200 OK\r\nContent-Length: ~w\r\n\r\n", [Len]),
                                gen_tcp:send(Sock, [Hdrs, Bytes]);
                            {ok, Bytes} ->
                                machi_util:verb("ok read but wanted ~p  got ~p: ~p @ offset ~p\n",
                                    [Len, size(Bytes), Bytes, Offset]),
                                ok = gen_tcp:send(Sock, "HTTP/1.0 455 PARTIAL-READ\r\n\r\n");
                            eof ->
                                ok = gen_tcp:send(Sock, "HTTP/1.0 455 NOT-WRITTEN\r\n\r\n");
                            _Else2 ->
                                machi_util:verb("Else2 ~p ~p ~P\n",
                                                [Offset, Len, _Else2, 20]),
                                ok = gen_tcp:send(Sock, "HTTP/1.0 466 ERROR BAD-READ\r\n\r\n")
                        end
                end,
      [File, OptsBin] = binary:split(MyURI, <<"?">>),
      Opts = split_uri_options(OptsBin),
      OffsetHex = machi_util:int_to_hexstr(proplists:get_value(offset, Opts), 64),
      LenHex = machi_util:int_to_hexstr(proplists:get_value(size, Opts), 32),
      do_net_server_readwrite_common2(Sock, OffsetHex, LenHex, File, DataDir,
                                      [read, binary, raw], DoItFun,
                                      EpochID, Wedged_p, CurrentEpochId,
                                      NoSuchFileFun, BadIoFun).
  
  http_harvest_headers(Sock) ->
      ok = inet:setopts(Sock, [{packet, httph}]),
  
negative.code: -define(EpochIDSpace, ((4*2)+(20*2))).          % hexencodingwhee!
  -define(CSumSpace, ((1*2)+(20*2))).             % hexencodingwhee!
  
  net_server_loop(Sock, S) ->
      case gen_tcp:recv(Sock, 0, ?SERVER_CMD_READ_TIMEOUT) of
          {ok, Bin} ->
  