diff --git a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp index 74a8198dcee..08b07fc5813 100644 --- a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp +++ b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp @@ -1230,13 +1230,26 @@ nsFtpState::R_syst() { } else { - NS_ASSERTION(0, "Guessing FTP server type."); + NS_ASSERTION(0, "Guessing FTP server type."); // No clue. We will just hope it is UNIX type server. + // An assertion here indicates that we should be testing + // for another substring mServerType = FTP_UNIX_TYPE; mList = PR_TRUE; - } + } + + return FTP_S_PWD; + } + + if (mResponseCode/100 == 5) { + // server didn't like the SYST command. Probably (500, 501, 502) + // No clue. We will just hope it is UNIX type server. + mServerType = FTP_UNIX_TYPE; + mList = PR_TRUE; + + return FTP_S_PWD; } - return FTP_S_PWD; + return FTP_ERROR; } nsresult @@ -1456,8 +1469,13 @@ nsFtpState::S_list() { nsCOMPtr converter; rv = BuildStreamConverter(getter_AddRefs(converter)); - if (NS_FAILED(rv)) return rv; - + if (NS_FAILED(rv)) { + // clear mResponseMsg which is displayed to the user. + // TODO: we should probably set this to something + // meaningful. + mResponseMsg = ""; + return rv; + } mDRequestForwarder->SetStreamListener(converter); #ifdef DOUGT_NEW_CACHE