mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
httpcredentials: Remove useless mutex
The mutex is not shared with any thread, so it is totaly useless. Yes: there are possible races here. (with the account, but also with the user and password)
This commit is contained in:
parent
92f07cb60f
commit
48864a6921
1 changed files with 3 additions and 4 deletions
|
@ -48,8 +48,9 @@ int getauth(const char *prompt,
|
|||
void *userdata)
|
||||
{
|
||||
int re = 0;
|
||||
QMutex mutex;
|
||||
// ### safe?
|
||||
|
||||
// ### safe? Not really. If the wizard is run in the main thread, the caccount could change during the sync.
|
||||
// Ideally, http_credentials could be use userdata, but userdata is the SyncEngine.
|
||||
HttpCredentials* http_credentials = qobject_cast<HttpCredentials*>(AccountManager::instance()->account()->credentials());
|
||||
|
||||
if (!http_credentials) {
|
||||
|
@ -63,10 +64,8 @@ int getauth(const char *prompt,
|
|||
|
||||
if( qPrompt == QLatin1String("Enter your username:") ) {
|
||||
// qDebug() << "OOO Username requested!";
|
||||
QMutexLocker locker( &mutex );
|
||||
qstrncpy( buf, user.toUtf8().constData(), len );
|
||||
} else if( qPrompt == QLatin1String("Enter your password:") ) {
|
||||
QMutexLocker locker( &mutex );
|
||||
// qDebug() << "OOO Password requested!";
|
||||
qstrncpy( buf, pwd.toUtf8().constData(), len );
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue