зеркало из https://github.com/mozilla/gecko-dev.git
26191. FTP can now recover when browsing and a connection times out
This commit is contained in:
Родитель
2a270612c7
Коммит
0abe2ef983
|
@ -57,7 +57,7 @@ nsFtpConnectionThread::nsFtpConnectionThread() {
|
|||
NS_INIT_REFCNT();
|
||||
// bool init
|
||||
mConnected = mList = mRetryPass = mCachedConn = mSentStart = PR_FALSE;
|
||||
mFireCallbacks = mUsePasv = mBin = mKeepRunning = mAnonymous = PR_TRUE;
|
||||
mFireCallbacks = mBin = mKeepRunning = mAnonymous = PR_TRUE;
|
||||
|
||||
mAction = GET;
|
||||
mState = FTP_COMMAND_CONNECT;
|
||||
|
@ -1288,14 +1288,9 @@ nsFtpConnectionThread::R_pasv() {
|
|||
PRInt32 port;
|
||||
|
||||
if (mResponseCode/100 != 2) {
|
||||
// failed. increment to port.
|
||||
// mState = FTP_S_PORT;
|
||||
mUsePasv = PR_FALSE;
|
||||
return FTP_ERROR;
|
||||
}
|
||||
|
||||
mUsePasv = PR_TRUE;
|
||||
|
||||
char *ptr = nsnull;
|
||||
char *response = mResponseMsg.ToNewCString();
|
||||
if (!response) return FTP_ERROR;
|
||||
|
@ -1329,9 +1324,6 @@ nsFtpConnectionThread::R_pasv() {
|
|||
&h0, &h1, &h2, &h3, &p0, &p1);
|
||||
|
||||
if (fields < 6) {
|
||||
// bad format. we'll try PORT, but it's probably over.
|
||||
|
||||
mUsePasv = PR_FALSE;
|
||||
return FTP_ERROR;
|
||||
}
|
||||
|
||||
|
@ -1714,12 +1706,7 @@ nsFtpConnectionThread::FindActionState(void) {
|
|||
// we're doing an operation that requies the data channel.
|
||||
// figure out what kind of data channel we want to setup,
|
||||
// and do it.
|
||||
if (mUsePasv)
|
||||
return FTP_S_PASV;
|
||||
else
|
||||
// until we have PORT support, we'll just fail.
|
||||
// return FTP_S_PORT;
|
||||
return FTP_ERROR;
|
||||
}
|
||||
|
||||
// These operations use the command channel response as the
|
||||
|
|
|
@ -183,7 +183,6 @@ private:
|
|||
nsAutoString mUsername; // username
|
||||
nsAutoString mPassword; // password
|
||||
FTP_ACTION mAction; // the higher level action (GET/PUT)
|
||||
PRBool mUsePasv; // use a passive data connection.
|
||||
PRBool mBin; // transfer mode (ascii or binary)
|
||||
PRBool mAnonymous; // try connecting anonymous (default)
|
||||
PRBool mRetryPass; // retrying the password
|
||||
|
|
Загрузка…
Ссылка в новой задаче