Commit 2f504289 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Reset the Assuan context if we detect a broken pipe

A broken pipe occurs if the gpg-agent that is listening to the Assuan
connection we are polling is shut down. In this case, we need to
reestablish the connection with a fresh context.

GnuPG-bug-id: 5775
parent 183e3f72
Pipeline #136070 passed with stage
in 1 minute and 45 seconds
......@@ -68,6 +68,10 @@ void DeviceInfoWatcher::Worker::start()
return;
}
qCWarning(KLEOPATRA_LOG) << "DeviceInfoWatcher::Worker::start: Connecting to the agent failed too often. Giving up.";
} else if (err.code() == GPG_ERR_EPIPE) {
qCDebug(KLEOPATRA_LOG) << "DeviceInfoWatcher::Worker::start: Assuan transaction failed with broken pipe. The agent seems to have died. Resetting context.";
mContext.reset();
QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
} else {
qCWarning(KLEOPATRA_LOG) << "DeviceInfoWatcher::Worker::start: Starting Assuan transaction for" << command << "failed:" << err;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment