![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - XMLHTTP and POST and keepalive timeouts >Thread Next - Re: XMLHTTP and POST and keepalive timeouts Re: XMLHTTP and POST and keepalive timeoutsTo: NULL Date: 2/2/2007 11:33:00 PM
"Clive George" <clive@x...> wrote in message
news:45c3b213$0$8738$ed2619ec@p......
> First question - is this the right place to discuss use of the MS XMLHTTP
> control? (I've seen some, but am not sure :-) ). If not, any pointers to a
> better place would be appreciated, and my apologies for disturbing you
all.
>
This is a good place for the question
> Now my actual question :
>
> We're getting problems with XMLHTTP not sending POST bodies after a
> keepalive timeout. What happens is this:
>
> Client sends request. Connection/Socket stays open as per normal HTTP
> keepalive.
>
> 10 seconds later, the server says "That's it" and terminates the
> connection - well, sends a FIN packet.
> At the same time, the client sends a HTTP POST request. With a slow enough
> link (100ms latency?), it's possible for these to cross.
> Obviously the server can't actually respond to this request, because it's
> said it's shutting that connection. So it accepts all the data, and chucks
> it away.
> The XMLHTTP control can cope with this - it knows it has to reissue the
> request on a new connection. Unfortunately if it's a POST request, it
> appears that it only sends the message header, not the body. Which is
> obviously wrong!
>
> What ends up happening is the server sits there waiting for the message
> body, and after a suitable timeout gives up and returns HTTP 400 - invalid
> request.
>
> So:
>
> Is this a known problem?
> Has anybody seen it before?
> Any good ideas on how to avoid it? (current plan is to simply issue a GET
if
> the time since the last request was about 10 seconds - the GET will either
> force the new connection or keep the old one alive).
>
> Oh yes - this is using the XMLHTTP which you get with IE 6, on either
Win2K
> or WinXP. Code is running in javascript on a normal html page. Server is
> apache, but I don't think that's relevant. Code is this simple:
>
> var httpObj = new ActiveXObject('Microsoft.XMLHTTP');
> httpObj.open( "POST", url, false );
> httpObj.setRequestHeader( "Content-Type", "text/plain" );
> httpObj.send( postData );
>
Try MSXML2.XMLHTTP.3.0 and make sure the machine is fully patched.
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
