anchor.diff:      send_file_body_read(Socket, Length, Filename);
   send_file_body_1(plain, Socket, Length, Filename) ->
       case use_sendfile() of
  -        erlang ->
  -            {ok, FD} = file:open(Filename, [raw,binary]),
  -            {ok, Bytes} = file:sendfile(FD, Socket, 0, Length, []),
  -            file:close(FD),
  -            Bytes;
  -        yaws ->
  -            {ok, Bytes} = sendfile:send(Socket, Filename, 0, Length),
  -            Bytes;
           disable ->
  -            send_file_body_read(Socket, Length, Filename)
  +            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]),
  -    Bytes = send_file_body_loop(Socket, 0, Length, FD),
  -    file:close(FD),
  -    Bytes.
  +    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;
  
positive.code:     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]),
      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
          end
          || {From,Length} <- Parts
      ],
  
negative.code: 
  send_file_body_parts_read(Socket, Parts, Filename) ->
      {ok, FD} = file:open(Filename, [raw,binary]),
      try
          send_device_body_parts(Socket, Parts, FD)
      after
          file:close(FD)
      end.
  
  send_parts(Socket, Bin, {[{From,Length}], _Size, _Boundary, _ContentType}) ->
      send(Socket, binary:part(Bin,From,Length)),
  