]> Some of my projects - localmylist.git/commitdiff
Automatically fail requests from old clients when starting a new request handler.
authorAPTX <marek321@gmail.com>
Mon, 13 May 2013 20:06:07 +0000 (22:06 +0200)
committerAPTX <marek321@gmail.com>
Mon, 13 May 2013 20:06:07 +0000 (22:06 +0200)
localmylist/mylist.cpp
localmylist/requesthandler.cpp

index fa8f37e4d7a2620d31412aa6be7a181322b0b131..d6aa173ebc0267dff92c0608eed50e83532e7f52 100644 (file)
@@ -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);
index 8abe9a6269b479a487ce6b781edc2f71cb0d08de..09653afa649ceac1d03288011037cdfc9afeacc2 100644 (file)
@@ -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()