anchor.diff:      Body = lists:nthtail(H + 3, Resp),
       case string:tokens(Resp, "\r\n") of
           ["HTTP/1.1 201" ++ _|_] ->
  -            {ok, Body};
  +            {ok, list_to_binary(Body)};
           ["HTTP/1.1 " ++ Code|_] ->
  -            {error, list_to_integer(string:sub_word(Code, 1, 32)), Body};
  +            {error, {list_to_integer(string:sub_word(Code, 1, 32)), Body}};
           _ ->
               {error, invalid_response}
       end.
  
positive.code:     send_body(Socket, IO).
  
  -spec read_response(port()) ->
      {'error', 'invalid_response'} | {'ok', [_]} | {'error', integer(), [_]}.
  read_response(Socket) ->
      {ok, RBin} = recv_all(Socket),
      Resp = binary_to_list(RBin),
  
negative.code: -export([http_put/3]).
  
  -include_lib("kernel/include/file.hrl").
  -include("ddfs.hrl").
  
  -define(CONNECT_TIMEOUT, 60000).
  -define(BUFFER_SIZE, 8192).
  
  -spec http_put(path(), nonempty_string(), integer()) ->
                        {'ok', binary()} | {'error', term()}.
  http_put(SrcPath, DstUrl, Timeout) ->
      % We use a middleman process to prevent messages received after timeout
      % reaching the original caller.
  