r=gordon. 24985. 24837. we now error out if we confront an ftp server that has reached it's connection limit. we also start the throbber (add our selves to the load group) when an FTP transaction begins

This commit is contained in:
valeski%netscape.com 2000-01-26 00:36:01 +00:00
Родитель a25f47d902
Коммит 4326a1acf5
2 изменённых файлов: 25 добавлений и 6 удалений

Просмотреть файл

@ -220,6 +220,11 @@ nsFTPChannel::OpenInputStream(PRUint32 startPosition, PRInt32 readCount,
return rv;
}
if (mLoadGroup) {
rv = mLoadGroup->AddChannel(this, nsnull);
if (NS_FAILED(rv)) return rv;
}
rv = mPool->DispatchRequest((nsIRunnable*)mConnThread);
if (NS_FAILED(rv)) return rv;
@ -264,6 +269,11 @@ nsFTPChannel::AsyncOpen(nsIStreamObserver *observer, nsISupports* ctxt)
mConnected = PR_TRUE;
mAsyncOpen = PR_TRUE;
if (mLoadGroup) {
rv = mLoadGroup->AddChannel(this, nsnull);
if (NS_FAILED(rv)) return rv;
}
return mPool->DispatchRequest((nsIRunnable*)mConnThread);
}
@ -321,6 +331,11 @@ nsFTPChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount,
return rv;
}
if (mLoadGroup) {
rv = mLoadGroup->AddChannel(this, nsnull);
if (NS_FAILED(rv)) return rv;
}
rv = mPool->DispatchRequest((nsIRunnable*)mConnThread);
mConnected = PR_TRUE;
@ -362,6 +377,11 @@ nsFTPChannel::AsyncWrite(nsIInputStream *fromStream,
if (NS_FAILED(rv))
NS_RELEASE(mConnThread);
if (mLoadGroup) {
rv = mLoadGroup->AddChannel(this, nsnull);
if (NS_FAILED(rv)) return rv;
}
rv = mPool->DispatchRequest((nsIRunnable*)mConnThread);
mConnected = PR_TRUE;

Просмотреть файл

@ -875,6 +875,10 @@ nsFtpConnectionThread::R_user() {
} else if (mResponseCode/100 == 2) {
// no password required, we're already logged in
return FTP_S_SYST;
} else if (mResponseCode/100 == 5) {
// problem logging in. typically this means the server
// has reached it's user limit.
return FTP_ERROR;
} else {
// LOGIN FAILED
if (mAnonymous) {
@ -1140,12 +1144,7 @@ nsFtpConnectionThread::S_cwd() {
nsresult rv = NS_OK;
nsXPIDLCString path;
PRUint32 bytes;
nsCOMPtr<nsIURL> url = do_QueryInterface(mURL, &rv);
if (NS_FAILED(rv)) {
rv = mURL->GetPath(getter_Copies(path));
} else {
rv = url->GetDirectory(getter_Copies(path));
}
rv = mURL->GetPath(getter_Copies(path));
if (NS_FAILED(rv)) return rv;
nsCAutoString cwdStr("CWD ");