From: APTX Date: Thu, 31 Dec 2009 19:52:33 +0000 (+0100) Subject: 3 seconds is enough... X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=df9dd11abccc6756bbc5fc686d8f4ea2eca1b00f;p=anidbudpclient.git 3 seconds is enough... --- diff --git a/client.cpp b/client.cpp index f469343..25f3ebc 100644 --- a/client.cpp +++ b/client.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "rawcommand.h" #include "logoutcommand.h" @@ -465,6 +466,45 @@ qDebug() << "COMPRESSED DATAGRAM = " << tmp; .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; @@ -540,6 +580,7 @@ qDebug() << "LOGIN FIRST required, authing"; { qDebug() << QString("SERVER ERROR %1").arg(replyCode); } + emit connectionError(); break; } // tag + space + replyCode + space = 5 + 1 + 3 + 1