mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Bug 1257058 - Distinguish 'empty password' from no password received to avoid shutdown crash.
Tag #1273
This commit is contained in:
parent
14590876b2
commit
6ee94917fe
2 changed files with 5 additions and 2 deletions
|
|
@ -8463,7 +8463,7 @@ nsresult nsImapProtocol::GetPassword(nsCString &password,
|
|||
NS_ENSURE_TRUE(msgWindow, NS_ERROR_NOT_AVAILABLE); // biff case
|
||||
|
||||
// Get the password from pw manager (harddisk) or user (dialog)
|
||||
nsAutoCString pwd; // GetPasswordWithUI truncates the password on Cancel
|
||||
m_passwordObtained = false;
|
||||
rv = m_imapServerSink->AsyncGetPassword(this,
|
||||
newPasswordRequested,
|
||||
password);
|
||||
|
|
@ -8472,7 +8472,7 @@ nsresult nsImapProtocol::GetPassword(nsCString &password,
|
|||
PRIntervalTime sleepTime = kImapSleepTime;
|
||||
m_passwordStatus = NS_OK;
|
||||
ReentrantMonitorAutoEnter mon(m_passwordReadyMonitor);
|
||||
while (m_password.IsEmpty() && !NS_FAILED(m_passwordStatus) &&
|
||||
while (!m_passwordObtained && !NS_FAILED(m_passwordStatus) &&
|
||||
m_passwordStatus != NS_MSG_PASSWORD_PROMPT_CANCELLED &&
|
||||
!DeathSignalReceived())
|
||||
mon.Wait(sleepTime);
|
||||
|
|
@ -8504,6 +8504,7 @@ nsImapProtocol::OnPromptStart(bool *aResult)
|
|||
*aResult = true;
|
||||
|
||||
// Notify the imap thread that we have a password.
|
||||
m_passwordObtained = true;
|
||||
ReentrantMonitorAutoEnter passwordMon(m_passwordReadyMonitor);
|
||||
passwordMon.Notify();
|
||||
return rv;
|
||||
|
|
@ -8517,6 +8518,7 @@ nsImapProtocol::OnPromptAuthAvailable()
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
m_passwordStatus = imapServer->GetPassword(m_password);
|
||||
// Notify the imap thread that we have a password.
|
||||
m_passwordObtained = true;
|
||||
ReentrantMonitorAutoEnter passwordMon(m_passwordReadyMonitor);
|
||||
passwordMon.Notify();
|
||||
return m_passwordStatus;
|
||||
|
|
|
|||
|
|
@ -358,6 +358,7 @@ private:
|
|||
nsCString m_password;
|
||||
// Set to the result of nsImapServer::PromptPassword
|
||||
nsresult m_passwordStatus;
|
||||
bool m_passwordObtained;
|
||||
|
||||
bool m_imapThreadIsRunning;
|
||||
void ImapThreadMainLoop(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue