Don't throw when status is gotten after a server timeout or some such. Bug
304980, r=darin, sr=jst git-svn-id: svn://10.0.0.236/trunk@194939 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -630,7 +630,21 @@ nsXMLHttpRequest::GetStatus(PRUint32 *aStatus)
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel = GetCurrentHttpChannel();
|
||||
|
||||
if (httpChannel) {
|
||||
return httpChannel->GetResponseStatus(aStatus);
|
||||
nsresult rv = httpChannel->GetResponseStatus(aStatus);
|
||||
if (rv == NS_ERROR_NOT_AVAILABLE) {
|
||||
// Someone's calling this before we got a response... Check our
|
||||
// ReadyState. If we're at 3 or 4, then this means the connection
|
||||
// errored before we got any data; return a somewhat sensible error code
|
||||
// in that case.
|
||||
PRInt32 readyState;
|
||||
GetReadyState(&readyState);
|
||||
if (readyState >= 3) {
|
||||
*aStatus = NS_ERROR_NOT_AVAILABLE;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
*aStatus = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user