diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-05-19 11:46:34 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-05-30 10:39:06 +0300 |
commit | 9b1f233372211475236911cc63019419c2d070cf (patch) | |
tree | 2d1f8778eccc4218c5a010d94d0bc8c2156f599e /src/libs/installer/packagemanagercore.h | |
parent | 2826f35955e68a12cdcb3fb1b6375c718e5c66c4 (diff) |
RemoteObject: require server reply for all client commands
For classes supporting the remote-client-server protocol through
inheritance of the QInstaller::RemoteObject class: when calling
functions of return type void, the client process did not block and
wait for the server process to finish execution of the corresponding
function, only checking that the packet containing the function
command and arguments was written to the socket.
The server-side connection thread operates in a loop that tries to
read a packet from the socket in each iteration, and process the
contained command, with the condition that the socket is still in
connected state. If the function calls requested by the commands take
long time to execute and we destruct the client-side object,
disconnecting the socket, the server thread could break out of the
loop before handling all pending packets.
This hasn't been a problem for non-void functions because the server
will send a return value reply and the client would block until the
sent packet was available. Fix by refactoring the server connection
code to send a default reply for commands not requiring a real return
value, and blocking the client until the reply can be read.
Task-number: QTIFW-999
Change-Id: Ie1d0e118e6830a1049a2ad50cc80b54c967fcde6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore.h')
0 files changed, 0 insertions, 0 deletions