diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-25 17:21:22 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-25 17:21:22 +0200 |
commit | 898f35f2982e86f95c7fe061aa5e697c771a0d47 (patch) | |
tree | 95425299b4c4668258707de9cc149ba6f43add10 /common/resourceaccess.cpp | |
parent | a9cd61f1baafe09fd20ffb6ba1c6728a8792b344 (diff) | |
download | sink-898f35f2982e86f95c7fe061aa5e697c771a0d47.tar.gz sink-898f35f2982e86f95c7fe061aa5e697c771a0d47.zip |
Avoid the socket probing and move the shutdown logic into
resourceaccess.
The problem was (as excercised by the last test in resourcecontroltest),
that in this scenario we would:
* trigger a synchronization that starts the resource, and then goes into
a loop trying to connecting (KAsync::wait -> singleshot timer)
* trigger a shutdown that would probe for the socket, not find it, and
thus do nothing.
* exit the testfunction, which somehow stops qtimer processing, meaning
we are stuck in KAsync::wait.
For now this is fixed by simply not probing for the socket.
Diffstat (limited to 'common/resourceaccess.cpp')
-rw-r--r-- | common/resourceaccess.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 2fa753d..033acc9 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -424,6 +424,11 @@ KAsync::Job<void> ResourceAccess::sendSecret(const QString &secret) | |||
424 | return sendCommand(Sink::Commands::SecretCommand, fbb); | 424 | return sendCommand(Sink::Commands::SecretCommand, fbb); |
425 | } | 425 | } |
426 | 426 | ||
427 | KAsync::Job<void> ResourceAccess::shutdown() | ||
428 | { | ||
429 | return sendCommand(Sink::Commands::ShutdownCommand); | ||
430 | } | ||
431 | |||
427 | void ResourceAccess::open() | 432 | void ResourceAccess::open() |
428 | { | 433 | { |
429 | if (d->socket && d->socket->isValid()) { | 434 | if (d->socket && d->socket->isValid()) { |