From: APTX Date: Mon, 13 May 2013 20:06:07 +0000 (+0200) Subject: Automatically fail requests from old clients when starting a new request handler. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=0f624da99c465d71d8d89231a18a5a7e769ab9f5;p=localmylist.git Automatically fail requests from old clients when starting a new request handler. --- 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()