summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2003-04-10 22:07:44 (UTC)
committer llornkcor <llornkcor>2003-04-10 22:07:44 (UTC)
commit7be68c0e03961ef8da0e0fa9683ab83770b41d62 (patch) (side-by-side diff)
tree82a2756dc720622c90b1f8d2a2319525ebb4bb3b /noncore
parenta37444cf6a9b5a903124d63c8c742bb9dbf04069 (diff)
downloadopie-7be68c0e03961ef8da0e0fa9683ab83770b41d62.zip
opie-7be68c0e03961ef8da0e0fa9683ab83770b41d62.tar.gz
opie-7be68c0e03961ef8da0e0fa9683ab83770b41d62.tar.bz2
some debug output
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/smtpclient.cpp10
-rw-r--r--noncore/unsupported/mailit/smtpclient.cpp10
2 files changed, 18 insertions, 2 deletions
diff --git a/noncore/net/mailit/smtpclient.cpp b/noncore/net/mailit/smtpclient.cpp
index 3bdc072..6699a90 100644
--- a/noncore/net/mailit/smtpclient.cpp
+++ b/noncore/net/mailit/smtpclient.cpp
@@ -86,22 +86,25 @@ void SmtpClient::incomingData()
if (!socket->canReadLine())
return;
response = socket->readLine();
-
+ qDebug(response);
+
switch(status) {
case Init: {
if (response[0] == '2') {
status = From;
mailPtr = mailList.first();
*stream << "HELO there\r\n";
+ qDebug("HELO");
} else errorHandling(ErrUnknownResponse);
break;
}
case From: {
if (response[0] == '2') {
*stream << "MAIL FROM: <" << mailPtr->from << ">\r\n";
status = Recv;
+ qDebug("MAIL FROM: "+mailPtr->from);
} else errorHandling(ErrUnknownResponse);
break;
}
case Recv: {
@@ -109,8 +112,9 @@ void SmtpClient::incomingData()
it = mailPtr->to.begin();
if (it == NULL)
errorHandling(ErrUnknownResponse);
*stream << "RCPT TO: <" << *it << ">\r\n";
+ qDebug("RCPT TO: "+ *it);
status = MRcv;
} else errorHandling(ErrUnknownResponse);
break;
}
@@ -118,8 +122,9 @@ void SmtpClient::incomingData()
if (response[0] == '2') {
it++;
if ( it != mailPtr->to.end() ) {
*stream << "RCPT TO: <" << *it << ">\r\n";
+ qDebug("RCPT TO: "+ *it);
break;
} else {
status = Data;
}
@@ -128,8 +133,9 @@ void SmtpClient::incomingData()
case Data: {
if (response[0] == '2') {
*stream << "DATA\r\n";
status = Body;
+ qDebug("DATA");
emit updateStatus(tr("Sending: ") + mailPtr->subject);
} else errorHandling(ErrUnknownResponse);
break;
}
@@ -141,8 +147,9 @@ void SmtpClient::incomingData()
status = From;
} else {
status = Quit;
}
+ qDebug("BODY");
} else errorHandling(ErrUnknownResponse);
break;
}
case Quit: {
@@ -155,8 +162,9 @@ void SmtpClient::incomingData()
emit mailSent();
mailList.clear();
sending = FALSE;
socket->close();
+ qDebug("QUIT");
} else errorHandling(ErrUnknownResponse);
break;
}
}
diff --git a/noncore/unsupported/mailit/smtpclient.cpp b/noncore/unsupported/mailit/smtpclient.cpp
index 3bdc072..6699a90 100644
--- a/noncore/unsupported/mailit/smtpclient.cpp
+++ b/noncore/unsupported/mailit/smtpclient.cpp
@@ -86,22 +86,25 @@ void SmtpClient::incomingData()
if (!socket->canReadLine())
return;
response = socket->readLine();
-
+ qDebug(response);
+
switch(status) {
case Init: {
if (response[0] == '2') {
status = From;
mailPtr = mailList.first();
*stream << "HELO there\r\n";
+ qDebug("HELO");
} else errorHandling(ErrUnknownResponse);
break;
}
case From: {
if (response[0] == '2') {
*stream << "MAIL FROM: <" << mailPtr->from << ">\r\n";
status = Recv;
+ qDebug("MAIL FROM: "+mailPtr->from);
} else errorHandling(ErrUnknownResponse);
break;
}
case Recv: {
@@ -109,8 +112,9 @@ void SmtpClient::incomingData()
it = mailPtr->to.begin();
if (it == NULL)
errorHandling(ErrUnknownResponse);
*stream << "RCPT TO: <" << *it << ">\r\n";
+ qDebug("RCPT TO: "+ *it);
status = MRcv;
} else errorHandling(ErrUnknownResponse);
break;
}
@@ -118,8 +122,9 @@ void SmtpClient::incomingData()
if (response[0] == '2') {
it++;
if ( it != mailPtr->to.end() ) {
*stream << "RCPT TO: <" << *it << ">\r\n";
+ qDebug("RCPT TO: "+ *it);
break;
} else {
status = Data;
}
@@ -128,8 +133,9 @@ void SmtpClient::incomingData()
case Data: {
if (response[0] == '2') {
*stream << "DATA\r\n";
status = Body;
+ qDebug("DATA");
emit updateStatus(tr("Sending: ") + mailPtr->subject);
} else errorHandling(ErrUnknownResponse);
break;
}
@@ -141,8 +147,9 @@ void SmtpClient::incomingData()
status = From;
} else {
status = Quit;
}
+ qDebug("BODY");
} else errorHandling(ErrUnknownResponse);
break;
}
case Quit: {
@@ -155,8 +162,9 @@ void SmtpClient::incomingData()
emit mailSent();
mailList.clear();
sending = FALSE;
socket->close();
+ qDebug("QUIT");
} else errorHandling(ErrUnknownResponse);
break;
}
}