#include <QCoreApplication>
#include <QUdpSocket>
#include <QTimer>
+#include <QRegExp>
#include "rawcommand.h"
#include "logoutcommand.h"
.arg(senderPort)
.arg(reply);
+/*
+ // Check if it is a 6xx error.
+ {
+ QRegExp rx("6[0-9]{2} ");
+ if (rx.exactMatch(tmp.mid(0, 4)))
+ {
+
+ int replyCode = tmp.mid(0, 3).toInt();
+ switch (replyCode)
+ {
+ case INTERNAL_SERVER_ERROR:
+ m_error = ServerError;
+ m_errorString = tr("Internal Server Error");
+ emit connectionError();
+ goto endLoop;
+ break;
+ case ANIDB_OUT_OF_SERVICE:
+ m_error = ServerError;
+ m_errorString = tr("AniDB out of service");
+ emit connectionError();
+ goto endLoop;
+ break;
+ case SERVER_BUSY:
+ m_error = ServerError;
+ m_errorString = tr("Server busy. Try again later. Wait at least 30 minutes.");
+ emit connectionError();
+ goto endLoop;
+ default:
+ if (replyCode > 601 && replyCode < 700)
+ {
+ qDebug() << QString("SERVER ERROR %1").arg(replyCode);
+ }
+ emit connectionError();
+ break;
+ }
+ }
+ continue;
+ }
+*/
QByteArray commandId = tmp.mid(0, 5);
commandsTimedOut = 0;
{
qDebug() << QString("SERVER ERROR %1").arg(replyCode);
}
+ emit connectionError();
break;
}
// tag + space + replyCode + space = 5 + 1 + 3 + 1