GH-4071 handle network errors when logging in with MSA as 'soft'
This makes the tokens not expire when such errors happen. Only applies to MSA, not the XBox and Mojang steps afterwards. Further testing and improvements are still needed.
This commit is contained in:
@ -7,25 +7,28 @@ namespace Katabasis {
|
||||
|
||||
Reply::Reply(QNetworkReply *r, int timeOut, QObject *parent): QTimer(parent), reply(r) {
|
||||
setSingleShot(true);
|
||||
connect(this, SIGNAL(error(QNetworkReply::NetworkError)), reply, SIGNAL(error(QNetworkReply::NetworkError)), Qt::QueuedConnection);
|
||||
connect(this, SIGNAL(timeout()), this, SLOT(onTimeOut()), Qt::QueuedConnection);
|
||||
connect(this, &Reply::timeout, this, &Reply::onTimeOut, Qt::QueuedConnection);
|
||||
start(timeOut);
|
||||
}
|
||||
|
||||
void Reply::onTimeOut() {
|
||||
emit error(QNetworkReply::TimeoutError);
|
||||
timedOut = true;
|
||||
reply->abort();
|
||||
}
|
||||
|
||||
// ----------------------------
|
||||
|
||||
ReplyList::~ReplyList() {
|
||||
foreach (Reply *timedReply, replies_) {
|
||||
delete timedReply;
|
||||
}
|
||||
}
|
||||
|
||||
void ReplyList::add(QNetworkReply *reply) {
|
||||
if (reply && ignoreSslErrors())
|
||||
reply->ignoreSslErrors();
|
||||
add(new Reply(reply));
|
||||
void ReplyList::add(QNetworkReply *reply, int timeOut) {
|
||||
if (reply && ignoreSslErrors()) {
|
||||
reply->ignoreSslErrors();
|
||||
}
|
||||
add(new Reply(reply, timeOut));
|
||||
}
|
||||
|
||||
void ReplyList::add(Reply *reply) {
|
||||
|
Reference in New Issue
Block a user