diff options
author | Don Sanders <don.sanders@nokia.com> | 2011-06-03 00:03:40 +0300 |
---|---|---|
committer | Don Sanders <don.sanders@nokia.com> | 2011-06-03 00:03:40 +0300 |
commit | 2303643a347d4ff75efacb92f79f73ba7db5fc4e (patch) | |
tree | c356d743d0c5daf6ac033b64317dc11ba90017e7 | |
parent | 57bfe7758650da5fa70aba6f15348984ac0af34d (diff) |
Emit connectionDown signal immediately if messageserver fails.
Add new QMailMessageServer::connectionDown signal,
and use it to fail any outstanding serviceactions if messageserver
goes down.
Eliminates 6 second window of vulnerability mentioned earlier.
-rw-r--r-- | src/libraries/qmfclient/CHANGES.qdoc | 4 | ||||
-rw-r--r-- | src/libraries/qmfclient/qmailmessageserver.cpp | 4 | ||||
-rw-r--r-- | src/libraries/qmfclient/qmailmessageserver.h | 2 | ||||
-rw-r--r-- | src/libraries/qmfclient/qmailserviceaction.cpp | 2 | ||||
-rw-r--r-- | src/libraries/qmfclient/support/qcopadaptor.cpp | 4 | ||||
-rw-r--r-- | src/libraries/qmfclient/support/qcopadaptor.h | 2 | ||||
-rw-r--r-- | src/libraries/qmfclient/support/qcopchannel.cpp | 3 | ||||
-rw-r--r-- | src/libraries/qmfclient/support/qcopchannel.h | 1 |
8 files changed, 12 insertions, 10 deletions
diff --git a/src/libraries/qmfclient/CHANGES.qdoc b/src/libraries/qmfclient/CHANGES.qdoc index 29514859..1faeda1d 100644 --- a/src/libraries/qmfclient/CHANGES.qdoc +++ b/src/libraries/qmfclient/CHANGES.qdoc @@ -344,8 +344,8 @@ Changes since the development preview release on 16/01/09: 32. Added 'QMailStore::ensureDurabiilty()'. -32. Added 'QMailMessageServer::connectionFailed()', and - 'QMailMessageServer::serverFailure()' signals. +32. Added 'QMailMessageServer::connectionDown()', and + 'QMailMessageServer::reconnectionTimeout()' signals. ***************************************************************************** diff --git a/src/libraries/qmfclient/qmailmessageserver.cpp b/src/libraries/qmfclient/qmailmessageserver.cpp index 58651687..4132a928 100644 --- a/src/libraries/qmfclient/qmailmessageserver.cpp +++ b/src/libraries/qmfclient/qmailmessageserver.cpp @@ -228,8 +228,8 @@ QMailMessageServerPrivate::QMailMessageServerPrivate(QMailMessageServer* parent) parent, SIGNAL(protocolResponse(quint64, QString, QVariant))); connectIpc(adaptor, MESSAGE(protocolRequestCompleted(quint64)), parent, SIGNAL(protocolRequestCompleted(quint64))); - QObject::connect(adaptor, SIGNAL(connectionFailed()), - parent, SIGNAL(connectionFailed())); + QObject::connect(adaptor, SIGNAL(connectionDown()), + parent, SIGNAL(connectionDown())); QObject::connect(adaptor, SIGNAL(reconnectionTimeout()), parent, SIGNAL(reconnectionTimeout())); } diff --git a/src/libraries/qmfclient/qmailmessageserver.h b/src/libraries/qmfclient/qmailmessageserver.h index b193a9f8..a36c0eee 100644 --- a/src/libraries/qmfclient/qmailmessageserver.h +++ b/src/libraries/qmfclient/qmailmessageserver.h @@ -108,7 +108,7 @@ signals: void protocolResponse(quint64, const QString &response, const QVariant &data); void protocolRequestCompleted(quint64); - void connectionFailed(); + void connectionDown(); void reconnectionTimeout(); public slots: diff --git a/src/libraries/qmfclient/qmailserviceaction.cpp b/src/libraries/qmfclient/qmailserviceaction.cpp index d5f91dc6..a65d81a4 100644 --- a/src/libraries/qmfclient/qmailserviceaction.cpp +++ b/src/libraries/qmfclient/qmailserviceaction.cpp @@ -96,7 +96,7 @@ QMailServiceActionPrivate::QMailServiceActionPrivate(Subclass *p, QMailServiceAc this, SLOT(statusChanged(quint64, const QMailServiceAction::Status))); connect(_server, SIGNAL(progressChanged(quint64, uint, uint)), this, SLOT(progressChanged(quint64, uint, uint))); - connect(_server, SIGNAL(connectionFailed()), + connect(_server, SIGNAL(connectionDown()), this, SLOT(serverFailure())); connect(_server, SIGNAL(reconnectionTimeout()), this, SLOT(serverFailure())); diff --git a/src/libraries/qmfclient/support/qcopadaptor.cpp b/src/libraries/qmfclient/support/qcopadaptor.cpp index 036df731..4c4a98ec 100644 --- a/src/libraries/qmfclient/support/qcopadaptor.cpp +++ b/src/libraries/qmfclient/support/qcopadaptor.cpp @@ -717,8 +717,8 @@ bool QCopAdaptor::connectRemoteToLocal QCopAdaptorChannel *channel = new QCopAdaptorChannel(chan, this); QObject::connect(channel, SIGNAL(reconnectionTimeout()), this, SIGNAL(reconnectionTimeout())); - QObject::connect(channel, SIGNAL(connectionFailed()), - this, SIGNAL(connectionFailed())); + QObject::connect(channel, SIGNAL(connectionDown()), + this, SIGNAL(connectionDown())); } d->connected = true; } diff --git a/src/libraries/qmfclient/support/qcopadaptor.h b/src/libraries/qmfclient/support/qcopadaptor.h index 79c93e43..ea7af07d 100644 --- a/src/libraries/qmfclient/support/qcopadaptor.h +++ b/src/libraries/qmfclient/support/qcopadaptor.h @@ -112,7 +112,7 @@ public: bool isConnected(const QByteArray& signal); signals: - void connectionFailed(); + void connectionDown(); void reconnectionTimeout(); protected: diff --git a/src/libraries/qmfclient/support/qcopchannel.cpp b/src/libraries/qmfclient/support/qcopchannel.cpp index a224afa7..1ba000f7 100644 --- a/src/libraries/qmfclient/support/qcopchannel.cpp +++ b/src/libraries/qmfclient/support/qcopchannel.cpp @@ -193,6 +193,7 @@ QCopChannel::QCopChannel(const QString& channel, QObject *parent) QCopClient* client = td->clientConnection(); Q_ASSERT (client); connect(client, SIGNAL(connected()), this, SIGNAL(connected())); + connect(client, SIGNAL(connectionFailed()), this, SIGNAL(connectionFailed())); connectClientSignals(); // Inform the server about this channel td->clientConnection()->registerChannel(channel); @@ -203,8 +204,8 @@ void QCopChannel::connectClientSignals() QCopThreadData *td = qcopThreadData(); QCopClient* client = td->clientConnection(); Q_ASSERT (client); - connect(client, SIGNAL(connectionFailed()), this, SIGNAL(connectionFailed())); connect(client, SIGNAL(reconnectionTimeout()), this, SIGNAL(reconnectionTimeout())); + connect(client, SIGNAL(destroyed(QObject*)), this, SIGNAL(connectionDown())); connect(client, SIGNAL(destroyed(QObject*)), this, SLOT(connectClientSignals())); } diff --git a/src/libraries/qmfclient/support/qcopchannel.h b/src/libraries/qmfclient/support/qcopchannel.h index 020695a9..01d8b90b 100644 --- a/src/libraries/qmfclient/support/qcopchannel.h +++ b/src/libraries/qmfclient/support/qcopchannel.h @@ -87,6 +87,7 @@ Q_SIGNALS: void connected(); void connectionFailed(); void reconnectionTimeout(); + void connectionDown(); protected: void connectNotify(const char *); |