Skip to content

Commit

Permalink
Merge pull request #6981 from nextcloud/backport/6958/stable-3.12
Browse files Browse the repository at this point in the history
[stable-3.12] prevent event loop reentrance when handling ENCRYPT socket requests
  • Loading branch information
mgallien authored Aug 8, 2024
2 parents 7fc2378 + 585c4d5 commit 827f57c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,13 @@ void SocketApi::slotReadSocket()
<< "with argument:" << argument;
socketApiJob->failure(QStringLiteral("command not found"));
}
} else if (command.startsWith("ENCRYPT")) {
if (indexOfMethod != -1) {
ASSERT(thread() == QThread::currentThread())
staticMetaObject.method(indexOfMethod)
.invoke(this, Qt::QueuedConnection, Q_ARG(QString, argument.toString()),
Q_ARG(SocketListener *, listener.data()));
}
} else {
if (indexOfMethod != -1) {
// to ensure that listener is still valid we need to call it with Qt::DirectConnection
Expand Down

0 comments on commit 827f57c

Please sign in to comment.