removed version, refs #101; implemented new temporaryfile handler and improved save, refs #51; partial changes for refs #79 and solved #104

This commit is contained in:
Marc Wäckerlin
2011-09-26 10:56:35 +00:00
parent b35e1fd9ed
commit 0614b4fc23
13 changed files with 1271 additions and 227 deletions

View File

@@ -153,8 +153,11 @@ class SmartCardAuth: public QObject {
void login(bool force=true) {
qDebug()<<__PRETTY_FUNCTION__;
QMutexLocker lock(&_mutex);
while (!_mutex.tryLock()) QCoreApplication::processEvents();
FreeLock freelock(_mutex);
OPENSSL_LOG("got lock");
if (!_e || (!force && *_e)) return; // no smartcard or already logged in
OPENSSL_LOG("start login to smartcard");
try {
QList<CertInfo> authcerts;
QList<CertInfo> allcerts;
@@ -286,6 +289,17 @@ class SmartCardAuth: public QObject {
cryptoki::SlotList::iterator slot;
cryptoki::Attribute id;
};
class FreeLock {
public:
FreeLock(QMutex& m): _mutex(m) {
}
~FreeLock() {
_mutex.unlock();
}
private:
QMutex& _mutex;
};
private: