From 0abe2ef983ccdee3f7f6ac9a18378504d4745a89 Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Tue, 18 Apr 2000 23:05:12 +0000 Subject: [PATCH] 26191. FTP can now recover when browsing and a connection times out --- .../protocol/ftp/src/nsFtpConnectionThread.cpp | 17 ++--------------- .../protocol/ftp/src/nsFtpConnectionThread.h | 1 - 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp index da1c6347457a..25d3cb1c9aea 100644 --- a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp @@ -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; + return FTP_S_PASV; } // These operations use the command channel response as the diff --git a/netwerk/protocol/ftp/src/nsFtpConnectionThread.h b/netwerk/protocol/ftp/src/nsFtpConnectionThread.h index ed3dbd64fbc0..cef6fe6d3531 100644 --- a/netwerk/protocol/ftp/src/nsFtpConnectionThread.h +++ b/netwerk/protocol/ftp/src/nsFtpConnectionThread.h @@ -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