Bug fix (issue 2)
This commit is contained in:
parent
81e561c91b
commit
3d3f9136af
@ -380,23 +380,29 @@ void SmtpClient::quit()
|
|||||||
|
|
||||||
void SmtpClient::waitForResponse() throw (ResponseTimeoutException)
|
void SmtpClient::waitForResponse() throw (ResponseTimeoutException)
|
||||||
{
|
{
|
||||||
if (!socket->waitForReadyRead(responseTimeout))
|
do {
|
||||||
{
|
if (!socket->waitForReadyRead(responseTimeout))
|
||||||
emit smtpError(ResponseTimeoutError);
|
{
|
||||||
throw ResponseTimeoutException();
|
emit smtpError(ResponseTimeoutError);
|
||||||
}
|
throw ResponseTimeoutException();
|
||||||
|
}
|
||||||
|
|
||||||
// Save the server's response
|
while (socket->canReadLine()) {
|
||||||
responseText = socket->readAll();
|
// Save the server's response
|
||||||
|
responseText = socket->readLine();
|
||||||
|
|
||||||
// Extract the respose code from the server's responce (first 3 digits)
|
// Extract the respose code from the server's responce (first 3 digits)
|
||||||
responseCode = responseText.left(3).toInt();
|
responseCode = responseText.left(3).toInt();
|
||||||
|
|
||||||
if (responseCode / 100 == 4)
|
if (responseCode / 100 == 4)
|
||||||
emit smtpError(ServerError);
|
emit smtpError(ServerError);
|
||||||
|
|
||||||
if (responseCode / 100 == 5)
|
if (responseCode / 100 == 5)
|
||||||
emit smtpError(ClientError);
|
emit smtpError(ClientError);
|
||||||
|
|
||||||
|
if (responseText[3] == ' ') { return; }
|
||||||
|
}
|
||||||
|
} while (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SmtpClient::sendMessage(const QString &text)
|
void SmtpClient::sendMessage(const QString &text)
|
||||||
|
Loading…
Reference in New Issue
Block a user