Discussion:
WinHttpReceiveResponse - 12002 - The operation timed out
(too old to reply)
mike
2006-12-08 20:34:04 UTC
Permalink
You know what, I am getting this on larger uploads.

It seems to occur as file sizes get over the 100MB range. While not looking
fo GB uploads, would like to provide for 200MB.

It does seem to occur when on a lesser horsepower web server.

With TaskMan up and monitoring on both machines, you can see the CPU &
Network spike as usual, the file most often actually gets written to the
disk.

However on the client after the WinHttpWriteData loop, when calling
WinHttpReceiveResponse there is the 30 pause before getting the Timeout.

I pushed it up to 60 seconds but you can observe the server settling down
and cleaning up as if it has completed all of its tasks.

It is almost as if the WinHTTP client somehow missed getting its response?

This occurs whether the web server is accepting uploads by way of ASP.NET
2.0 or an ISAPI extention.

The client code is pretty much the Platform SDK sample code, would anyone
know how to ensure things move along smoother?

Thanks,

- Mike
Stephen Sulzer
2006-12-09 09:34:39 UTC
Permalink
Hi Mike,

A couple things to check first:

1. Ensure you are uploading all the data your request says it will,
according to the dwTotalLength parameter of WinHttpSendRequest. If you are
off (under) by even 1 byte, the server will still be waiting for your client
to finish uploading the request data and may not send a response.

2. Use a network sniffer like Ethereal to ensure the server is not aborting
the TCP connection (look for a RST indication). If that looks OK, then check
whether or not the server is sending a 200 OK response back to your client.
If it is, check that its response headers are properly terminated with an
extra CRLF sequence (the last response header should have two CRLF pairs
following it).

3. Try sending the request with keep-alive (persistent connections)
disabled. To do that, include a "Connection: Close" request header in the
call to WinHttpSendRequest.

Hope that helps.

Regards,
- Stephen
mike
2007-01-10 20:35:24 UTC
Permalink
Hi,

I had to leave for a bit, some end of year vacation time.

But anyhow, using Wireshark, I do find a reset (RST), it is the very last
entry.

The file does upload, the sizes are good.

I added and see the "Connection: Close" in the header but still get the same
timeout behavior, and only when getting up near 200MB.

I do calculate the size of the entire multipart-form that is POSTed.

- Mike
Post by Stephen Sulzer
Hi Mike,
1. Ensure you are uploading all the data your request says it will,
according to the dwTotalLength parameter of WinHttpSendRequest. If you are
off (under) by even 1 byte, the server will still be waiting for your
client to finish uploading the request data and may not send a response.
2. Use a network sniffer like Ethereal to ensure the server is not
aborting the TCP connection (look for a RST indication). If that looks OK,
then check whether or not the server is sending a 200 OK response back to
your client. If it is, check that its response headers are properly
terminated with an extra CRLF sequence (the last response header should
have two CRLF pairs following it).
3. Try sending the request with keep-alive (persistent connections)
disabled. To do that, include a "Connection: Close" request header in the
call to WinHttpSendRequest.
Hope that helps.
Regards,
- Stephen
Stephen Sulzer
2007-01-13 20:36:32 UTC
Permalink
In the network traffic capture, do you see an HTTP response being sent back
from the server? If so, does it appear to be well-formed; e.g., HTTP
response headers terminated with CRLF CRLF? If there is no response from
the server, then you will probably need to debug the problem on the
receiving server, assuming you have access to it.

If the server is malfunctioning with larger file sizes, then could the file
be sent in pieces over multiple HTTP requests?

- Stephen
Post by mike
Hi,
I had to leave for a bit, some end of year vacation time.
But anyhow, using Wireshark, I do find a reset (RST), it is the very last
entry.
The file does upload, the sizes are good.
I added and see the "Connection: Close" in the header but still get the
same timeout behavior, and only when getting up near 200MB.
I do calculate the size of the entire multipart-form that is POSTed.
- Mike
mike
2007-02-02 20:56:00 UTC
Permalink
Hi,

Yes I am working on the server side as well. I have been testing with two
server-side solutions ASP.NET or ISAPI whichever gets the job done.
Post by Stephen Sulzer
If the server is malfunctioning with larger file sizes, then could the
file be sent in pieces over multiple HTTP requests?
The behavior is really looking to somehow be related to stress
(file-size:server-horsepower). Is it OK to ask? What are your thoughts on
the multiple HTTP requests?

I had sketched out a an idea but I might be looking at it, too close to my
nose. I was thinking that I would need to break the large files up and
insert each chunk into their own form for posting.

I went that direction because of ASP.NETs 4MB default, which I've had to
override with a web.config file httpRuntime stanza's maxRequestLength=
parameter. I am not comfortable doing that so got to thinking about the
chunks.

Now the ISAPI would is not affected in this category, which is why I am
surprised to see the behavior there as well.

- Mike

Loading...