Re: [XMLHttpRequest] SENT state (readState = 2)

"Anne van Kesteren" <annevk@opera.com> wrote:

> 
> Hi,
> 
> I made http://tc.labs.opera.com/apis/XMLHttpRequest/send/010.htm which  
> shows that Opera switches to readyState = 2 when transmitting something  
> large over the wire where Internet Explorer and Firefox (haven't tested  
> Safari) stay in readyState = 1 until the whole transaction is over. This  
> seems to indicate that readyState = 2 is pretty much useless and just  
> becomes a required state to visit before going to state 3. I will update  
> the specification soonish to reflect this unless implementors (or someone 

> who can convince implementors) want to do it differently.

What happens if you write a CGI script at the server that deliberately waits
a bit between receiving the request and sending the response?  Do IE & FF
switch to state 2 at *that* point?  (i.e. indicating that it's finished
sending the request but it hasn't received the response headers back yet)

I prefer Opera's behaviour, FWIW.  I don't like the idea that if you have
scripting that is checking up on the state of the XHR object, then it will
find that the readyState is still OPEN when actually you've already invoked
the send() method.

The problem is that an additional state is probably needed ("SENDING") that
covers the period of time during which the client is transmitting the
request between OPEN and SENT.  You already know that I strongly disagree
with the spurious readystatechange events when the ready state hasn't
changed.  I wonder if this is what those spurious events are actually for -
to cover up the lack of a separate state between OPEN and SENT?


-- 
Stewart Brodie
Software Engineer
ANT Software Limited

Received on Tuesday, 29 May 2007 15:14:34 UTC