From 0f624da99c465d71d8d89231a18a5a7e769ab9f5 Mon Sep 17 00:00:00 2001 From: APTX Date: Mon, 13 May 2013 22:06:07 +0200 Subject: [PATCH] Automatically fail requests from old clients when starting a new request handler. --- localmylist/mylist.cpp | 2 +- localmylist/requesthandler.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/localmylist/mylist.cpp b/localmylist/mylist.cpp index fa8f37e..d6aa173 100644 --- a/localmylist/mylist.cpp +++ b/localmylist/mylist.cpp @@ -185,7 +185,7 @@ void MyList::setupUdpClient() void MyList::setupRequestHandler() { #ifndef LOCALMYLIST_NO_ANIDBUDPCLIENT - if (m_requestHandler || !db->isConnected()) + if (m_requestHandler || !db->isConnected() || !udpClientId()) return; m_requestHandler = new RequestHandler(db, this); diff --git a/localmylist/requesthandler.cpp b/localmylist/requesthandler.cpp index 8abe9a6..09653af 100644 --- a/localmylist/requesthandler.cpp +++ b/localmylist/requesthandler.cpp @@ -21,6 +21,8 @@ RequestHandler::RequestHandler(Database *db, QObject *parent) : this->db = db; connect(this, SIGNAL(batchFinished()), this, SLOT(handleRequests()), Qt::QueuedConnection); connect(this, SIGNAL(myListUpdateBatchFinished()), this, SLOT(handleMyListUpdates()), Qt::QueuedConnection); + + db->failPendingRequestsFromOldClients(); } void RequestHandler::handleRequests() -- 2.52.0