Discussion:
HttpSendRequest, timeout (12002) and scrambled TCP packets
(too old to reply)
Stefan M. Huber
2007-06-26 08:51:36 UTC
Permalink
Hi!

I am standing in front of a problem that I cannot cope with: I am using
the wininet API to accomplish some HTTP and HTTPS actions. I am *not*
using thirdy party components because we want to avoid that our users
install SSL certificates in our application as well as in MSIE (where they
already have them).

I am using HttpSendRequest to send a HTTP POST request. Normally, this
works out perfectly, but we noticed that on some occasions, when the sent
payload is larger (about 300kb), HttpSendRequest fails with a timeout.

The problem is *not* that the data is so large. The problem is that the
send/ACK packets of the TCP stream get out of sync. I sniffed with
Wireshark which can rearrange the packets in the right order: The complete
answer from the server is there (after about 10 seconds). But
HttpSendRequest only returns when the set timeout is reached.

Any ideas of how to prevent that?

Thanks,
Stefan
Stefan M. Huber
2007-06-26 13:20:58 UTC
Permalink
Post by Stefan M. Huber
Hi!
I am standing in front of a problem that I cannot cope with: I am
using the wininet API to accomplish some HTTP and HTTPS actions. I am
*not* using thirdy party components because we want to avoid that our
users install SSL certificates in our application as well as in MSIE
(where they already have them).
I am using HttpSendRequest to send a HTTP POST request. Normally, this
works out perfectly, but we noticed that on some occasions, when the
sent payload is larger (about 300kb), HttpSendRequest fails with a
timeout.
The problem is *not* that the data is so large. The problem is that the
send/ACK packets of the TCP stream get out of sync. I sniffed with
Wireshark which can rearrange the packets in the right order: The
complete answer from the server is there (after about 10 seconds). But
HttpSendRequest only returns when the set timeout is reached.
Any ideas of how to prevent that?
Addendum: Apaprently this only happens with WinXP SP2. I found a PC in our
network that has SP1 installed and the same application with the same
payload data works perfectly fine there. No scrambled TCP packets, no
checksum error in the TCP framework. Any pointers?

Stefan
Stefan M. Huber
2007-07-04 13:30:52 UTC
Permalink
Post by Stefan M. Huber
Hi!
I am standing in front of a problem that I cannot cope with: I am
using the wininet API to accomplish some HTTP and HTTPS actions. I am
*not* using thirdy party components because we want to avoid that our
users install SSL certificates in our application as well as in MSIE
(where they already have them).
I am using HttpSendRequest to send a HTTP POST request. Normally, this
works out perfectly, but we noticed that on some occasions, when the
sent payload is larger (about 300kb), HttpSendRequest fails with a
timeout.
The problem is *not* that the data is so large. The problem is that the
send/ACK packets of the TCP stream get out of sync. I sniffed with
Wireshark which can rearrange the packets in the right order: The
complete answer from the server is there (after about 10 seconds). But
HttpSendRequest only returns when the set timeout is reached.
Any ideas of how to prevent that?
OK, the message was the right one but I drew the wrong conclusions:
I used InternetSetOption with the SEND and RECEIVE timeouts and passed
larger values (or 0). It works ever since. But I still wonder, how the
problem is created.

The response from the server came after 22 seconds (according to
Wireshark) and the timeout was reached after 30 seconds...

Anyway, as it works again, I am happy.
Stefan
Scherbina Vladimir
2007-07-04 13:55:04 UTC
Permalink
[...]
Post by Stefan M. Huber
I used InternetSetOption with the SEND and RECEIVE timeouts and passed
larger values (or 0). It works ever since. But I still wonder, how the
problem is created.
The response from the server came after 22 seconds (according to
Wireshark) and the timeout was reached after 30 seconds...
Anyway, as it works again, I am happy.
Stefan
Anyway, 22 seconds is too long to make me happy ...
--
Vladimir, Windows SDK MVP
Stefan M. Huber
2007-07-06 08:35:55 UTC
Permalink
On Wed, 04 Jul 2007 15:55:04 +0200, Scherbina Vladimir
Post by Scherbina Vladimir
[...]
Post by Stefan M. Huber
I used InternetSetOption with the SEND and RECEIVE timeouts and passed
larger values (or 0). It works ever since. But I still wonder, how the
problem is created.
The response from the server came after 22 seconds (according to
Wireshark) and the timeout was reached after 30 seconds...
Anyway, as it works again, I am happy.
Stefan
Anyway, 22 seconds is too long to make me happy ...
That's not an issue. The server I am using is a local black box. It's part
of the Austrian health infrastructure. It takes the request from our
application and sends it to another centralized server. There the request
is processed and the response sent back. And with SOAP attachments being
uploaded, this can take a while. And yes, there's only a synchronous call
to the function in question. So we'd either have to create a thread and
notify the user afterwards or wait for the response. And we have been
strongly advised to wait for the answer by the guys who wrote the
specification.

Stefan

Loading...