I'm using a combination of InternetSetFilePointer
, and InternetReadFile
, to support a resumable download. So when I begin downloading a file, I check to see if we already have part of it, and call InternetSetFilePointer
using the size of what we have, and then I begin reading. This works ... however, here's my observation:
If I've downloaded 90% of a file, and it took 2 minutes to do so, when I resume, the first call to InternetReadFile
takes approximately 2 minutes return! I can only conclude that behind the scenes, it's simply downloading the file from the beginning, throwing out everything up to the point I gave to InternetSetFilePointer
, and then it returns with the "next" data.
So the questions are:
1) does WinInet "simulate" InternetSetFilePointer
, or does it really give that info to the server?
2) Is there a way to make WinInet truly skip to the desired seek point, assuming the HTTP server supports doing so?
The server I'm downloading from is an Amazon S3 server, which I'm 99.9% sure supports resume.