Last commit broke async auth, e.g. via imapauth. Fix it.

See #946
This commit is contained in:
Alexey Sokolov
2015-04-16 20:31:31 +01:00
parent 0167a827a7
commit 7c64eba693
2 changed files with 22 additions and 17 deletions
+12 -15
View File
@@ -168,24 +168,21 @@ void CHTTPSock::ReadLine(const CString& sData) {
sLine.Token(1, true).Split(",", ssEncodings, false, "", "", false, true);
m_bAcceptGzip = (ssEncodings.find("gzip") != ssEncodings.end());
} else if (sLine.empty()) {
m_bGotHeader = true;
if (!m_sUser.empty()) {
if (!m_sUser.empty() && !m_bLoggedIn) {
m_bLoggedIn = OnLogin(m_sUser, m_sPass, true);
if (!m_bLoggedIn) {
// Error message already was sent
return;
}
}
if (m_bPost) {
m_sPostData = GetInternalReadBuffer();
CheckPost();
// After successful login ReadLine("") will be called again to trigger "else" block
} else {
GetPage();
}
m_bGotHeader = true;
DisableReadLine();
if (m_bPost) {
m_sPostData = GetInternalReadBuffer();
CheckPost();
} else {
GetPage();
}
DisableReadLine();
}
}
}