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