Skip to content

Commit

Permalink
Merge pull request #6979 from nextcloud/backport/6958/stable-3.13
Browse files Browse the repository at this point in the history
[stable-3.13] prevent event loop reentrance when handling ENCRYPT socket requests
  • Loading branch information
mgallien authored Aug 8, 2024
2 parents 529092c + ad504ea commit 66c355a
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 @@ -444,6 +444,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 66c355a

Please sign in to comment.