Fixes 72774. Simple fix which checks the response code of the SYST command. If it is a 500 series we default to guessing the server is UNIX. r=bbaetz@cs.mcgill.ca

This commit is contained in:
dougt%netscape.com 2001-04-14 20:36:24 +00:00
parent 553b0cba11
commit 58452faa5b

View File

@ -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<nsIStreamListener> 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