CInternetSession::GetHttpConnection() does not throw an exception if the server is down ? 
Author Message
 CInternetSession::GetHttpConnection() does not throw an exception if the server is down ?


I try to implement a HTTP PUT request into my MFC
application (on Windows 2000).

Following are the steps I use :

1) create a CInternetSession object
2) open the HTTP connection:
3) open the request: CHttpConnection::OpenRequest()
4) send the request: CHttpFile::SendRequestEx(),
CHttpFile::Write(), CHttpFile::QueryInfoStatusCode()
5) close the request: CHttpFile::EndRequest().

My problem is that when the target HTTP server is NOT
running, the GetHttpConnection() method returns a valid
CHttpConnection pointer and does not throw any

Then the OpenRequest() returns a valid CHttpFile pointer
so I can write my blocks of data to it.

If the file is a large one, after having successfully
written the first blocks of data, I can get a
CInternetException on the CHttpFile::Write() method.

But if the file to send is a small one, all seems to
work fine... But of course nothing is sent.

Is it a known problem or am I doing something wrong ?

Thanks for help,


Sun, 18 Dec 2005 16:07:24 GMT  
 [ 1 post ] 

 Relevant Pages 

1. problems Retrieve Binary file with CInternetSession::GetHttpConnection

2. CInternetSession::OpenURL() throws mystery exception, crashes

3. System.Drawing.SafeNativeMethods threw an exception

4. Unhandled Exception: System.Configuration.ConfigurationException: Could not create System Configuration.NameValueSectionHandler, System

5. Exception Not Thrown When Disk Is Full?

6. Destructors are not called when exception is thrown.

7. Getting this when run from mapped drive System.Security.Permissions.SecurityPermission

8. Exception handling - how to know which exceptions are thrown

9. bufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbuf

10. CInternetSession::OnStatusCallback

11. CInternetSession/CHTTPConnection/CHTTPFile

12. CInternetSession::GetFtpConnection() under Win2000 SP1?


Powered by phpBB® Forum Software