From e4f3715d43b245f860a31f15ccb6bce0751489a5 Mon Sep 17 00:00:00 2001 From: APTX Date: Thu, 31 Dec 2009 20:52:33 +0100 Subject: [PATCH] 3 seconds is enough... --- lib/anidbudpclient/client.cpp | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/lib/anidbudpclient/client.cpp b/lib/anidbudpclient/client.cpp index f469343..25f3ebc 100644 --- a/lib/anidbudpclient/client.cpp +++ b/lib/anidbudpclient/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 -- 2.52.0