How are downloads counted?

When downloads are protected and limited, how are they counted? Various situations can happen and I am never certain.

  • what if someone is to download the same file twice, does it count once or twice?
  • what if a download is incomplete (like with an unstable internet connection) and they try a second (or third) time, does it count once or multiple times?
  • what if someone tries to download a file and there is an error with it and it does not download, will the click count as a download or not?

Thanks.

first two questions - once
Third question - It will count too as far as I know.