diff --git a/netwerk/protocol/ftp/src/nsFTPChannel.cpp b/netwerk/protocol/ftp/src/nsFTPChannel.cpp index b264db2a32a..e38b162351e 100644 --- a/netwerk/protocol/ftp/src/nsFTPChannel.cpp +++ b/netwerk/protocol/ftp/src/nsFTPChannel.cpp @@ -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; diff --git a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp index e055b517427..ad24b405b9a 100644 --- a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp @@ -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 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 ");