Jump to content
  • Advertisement
Sign in to follow this  
Teric

ERROR_WINHTTP_HEADER_NOT_FOUND

This topic is 4814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to download a file from the internet using the following WinINet function calls: -InternetOpen() //Open the internet session and grab a handle for it -InternetOpenUrl() //Open a specific Url and grab a handle for it -HttpQueryInfo() //Pass in the Url handle to get the size of the file -InternetReadFileEx() //Download the file I'm running asynchronously, so I've got a callback function set up to handle messages, and I've got a process() function that runs every frame. Basically, after calling InternetOpenUrl, I wait for a INTERNET_STATUS_HANDLE_CREATED message, then I save the created handle. In the next frame, when the process() function runs, I call HttpQueryInfo() with a HTTP_QUERY_CONTENT_LENGTH flag in order to figure out the size of the file I'm trying to download. I'm getting a proper handle from InternetOpenUrl, but when I pass that handle to HttpQueryInfo(), I always get a 12150 error: ERROR_WINHTTP_HEADER_NOT_FOUND 12150 The requested header could not be located. I'm not sure what this means--does it indicate that the program could not find the specified file? I checked the URL that I'm using, and I'm positive that the file does indeed exist. Would appreciate some clarification here. Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Does anyone know what would cause this error? It must have something to do with running it in async mode--I just tried it in synchronous mode, and it was able to read the header just fine.

Share this post


Link to post
Share on other sites
I figured it out--I not only have to wait for an INTERNET_STATUS_HANDLE_CREATED message, I also have to wait for a INTERNET_STATUS_RESPONSE_RECEIVED message before I can query the server for info.

When I call HttpQueryInfo after getting the INTERNET_STATUS_RESPONSE_RECEIVED message, the information comes back just fine.

Share this post


Link to post
Share on other sites
Quote:
Original post by Teric
I figured it out--I not only have to wait for an INTERNET_STATUS_HANDLE_CREATED message, I also have to wait for a INTERNET_STATUS_RESPONSE_RECEIVED message before I can query the server for info.

When I call HttpQueryInfo after getting the INTERNET_STATUS_RESPONSE_RECEIVED message, the information comes back just fine.


You must wait for INTERNET_STATUS_RESPONSE_RECEIVED before you can use HttpQueryInfo() or you must run HttpQueryInfo() and wait for INTERNET_STATUS_RESPONSE_RECEIVED? Does INTERNET_STATUS_RESPONSE_RECEIVED status code must be received always after InternetOpenUrl()?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!