anchor.diff:      send_file_body_parts_read(Socket, Parts, Filename);
   send_file_body_parts(plain, Socket, Parts, Filename) ->
       case use_sendfile() of
  -        erlang ->
  -            send_file_body_parts_sendfile(Socket, Parts, Filename);
  -        yaws ->
  -            send_file_body_parts_sendfile_yaws(Socket, Parts, Filename);
           disable ->
  -            send_file_body_parts_read(Socket, Parts, Filename)
  -    end.
  -
  -send_file_body_parts_sendfile(Socket, {[{From,Length}], _Size, _Boundary, _ContentType}, Filename) ->
  -    {ok, FD} = file:open(Filename, [raw,binary]),
  -    {ok, Bytes} = file:sendfile(FD, Socket, From, Length, []),
  -    file:close(FD),
  -    Bytes;
  -send_file_body_parts_sendfile(Socket, {Parts, Size, Boundary, ContentType}, Filename) ->
  -    {ok, FD} = file:open(Filename, [raw,binary]),
  +            send_file_body_parts_read(Socket, Parts, Filename);
  +        Type ->
  +            send_file_body_parts_sendfile(Type, Socket, Parts, Filename)
  +    end.
  +
  +send_file_body_parts_sendfile(Type, Socket, {[{From,Length}], _Size, _Boundary, _ContentType}, Filename) ->
  +    sendfile(Type, Socket, Filename, From, Length);
  +send_file_body_parts_sendfile(Type, Socket, {Parts, Size, Boundary, ContentType}, Filename) ->
       Bytes = [
           begin
  -            send(Socket, part_preamble(Boundary, ContentType, From, Length, Size)),
  -            {ok, B} = file:sendfile(FD, Socket, From, Length, []),
  -            send(Socket, <<"\r\n">>),
  -            B
  -        end
  -        || {From,Length} <- Parts
  -    ],
  -    send(Socket, end_boundary(Boundary)),
  -    file:close(FD),
  -    lists:sum(Bytes).
  -
  -
  -send_file_body_parts_sendfile_yaws(Socket, {[{From,Length}], _Size, _Boundary, _ContentType}, Filename) ->
  -    {ok, Bytes} = sendfile:send(Socket, Filename, From, Length),
  -    Bytes;
  -send_file_body_parts_sendfile_yaws(Socket, {Parts, Size, Boundary, ContentType}, Filename) ->
  -    Bytes = [
  -        begin
  -            send(Socket, part_preamble(Boundary, ContentType, From, Length, Size)),
  -            {ok, B} = sendfile:send(Socket, Filename, From, Length),
  -            send(Socket, <<"\r\n">>),
  -            B
  +                send(Socket, part_preamble(Boundary, ContentType, From, Length, Size)),
  +                B = sendfile(Type, Filename, Socket, From, Length),
  +                send(Socket, <<"\r\n">>),
  +                B
           end
           || {From,Length} <- Parts
       ],
  
positive.code:     ok;
  send(Socket, Bin) when is_binary(Bin) ->
      case mochiweb_socket:send(Socket, Bin) of
          ok -> ok;
          {error,closed} -> ok;
          _ -> exit(normal)
      end;
  send(Socket, IoList) when is_list(IoList) ->
      send(Socket, iolist_to_binary(IoList)).
  
  
  get_resp_body_size({device, Size, _} = Body) ->
      {ok, Size, Body};
  
negative.code:     send_file_body_read(Socket, Length, Filename);
  send_file_body_1(plain, Socket, Length, Filename) ->
      case use_sendfile() of
          disable ->
              send_file_body_read(Socket, Length, Filename);
          Type ->
              sendfile(Type, Socket, Filename, 0, Length)
      end.
  
  send_file_body_read(Socket, Length, Filename) ->
      {ok, FD} = file:open(Filename, [raw,binary]),
      try
          send_file_body_loop(Socket, 0, Length, FD)
      after
          file:close(FD)
      end.
  
  send_file_body_loop(_Socket, Offset, Size, _Device) when Offset =:= Size ->
      Size;
  