W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2005

[whatwg] XMLHttpRequest.status on connection timeout

From: Maciej Stachowiak <mjs@apple.com>
Date: Fri, 9 Dec 2005 13:49:03 -0800
Message-ID: <64509448-3FD7-4538-BF75-7613D3497FB0@apple.com>

On Nov 30, 2005, at 2:12 AM, Jim Ley wrote:

> On 11/30/05, Boris Zbarsky <bzbarsky at mit.edu> wrote:
>> What should XMLHttpRequest.status return on connection timeout?   
>> Ian and I were
>> talking about this, and it seems like "502" is a good response  
>> code here...
>>
>> See https://bugzilla.mozilla.org/show_bug.cgi?id=304980
>
> I understood the aim was to mimic IE's implementation? Which will
> return a 5 digit code in the 12xxx range from WinInet for errors not
> returned by a server)
>
> Of the 5xx 504 is more justifiable than 502, as then you can pretend
> the browser is simply a proxy which has timed out,  502 which
> specifically mentions an invalid response doesn't sound a good idea.
>
> I believe Safari now has a 1 year timeout, so that could be an
> interesting test to run on a release build :-)

We try to have an effectively unlimited timeout for most things, but  
currently have a 30 second timeout for synchronous XMLHttpRequest to  
avoid blocking the UI forever. Due to the existence of very slow  
severs, timeout is often more annoying than helpful. It might be good  
to provide an API to set a timeout, on the other hand, it's not hard  
for JS code to do its own timeout and cancel the request.

Regards,
Maciej
Received on Friday, 9 December 2005 13:49:03 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:44 UTC