summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/remoteobject.h
Commit message (Collapse)AuthorAgeFilesLines
* Adapt to QTextCodec changesChristian Stenger2023-06-061-0/+8
| | | | | | Task-number: QTIFW-1829 Change-Id: Iad99b41ec67b0d4c64623da04fff65a737f46ff2 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Simplify remoteobject classKatja Marttila2023-04-131-61/+18
| | | | | | | | | We can use parameter packs for the functions instead of overloading functions with different parameter counts. Change-Id: I58713e20a399c3434f5acbe8ac7eec8915eba49b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix and shuffle some includesChristian Stenger2022-12-161-1/+3
| | | | | | Task-number: QTIFW-1829 Change-Id: I16025ae23f91849d6317e25e56099c77a37f0cd9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* RemoteObject: require server reply for all client commandsArttu Tarkiainen2022-05-301-29/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-301-17/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
| * License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | | | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-031-0/+2
|\| | | | | | | | | | | | | Conflicts: doc/installerfw.qdoc Change-Id: I3d991775eae96c7de689e4b92393065564940a5f
| * Fix hang in Windows when admin rights neededKatja Marttila2016-12-221-0/+2
| | | | | | | | | | | | | | Change-Id: I07f22c9452deae7a044ac186c8d1953df00df43c Task-number: QTIFW-902 Reviewed-by: SIGMA Surface Science Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-201-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
| * Update license headersIikka Eklund2015-12-291-4/+3
| | | | | | | | | | | | | | | | | | Update existing license headers. LGPL -> LGPLv21. Update copyright year as well. Change-Id: Ie1d71f8c68186b8f625f409ddf94691f178093c9 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* | Unify translated error messagesKai Koehne2015-06-241-1/+1
|/ | | | | | | | | | | | * Enclose file paths in "" * Localize file paths with QDir::toNativeSeparators. * Make sure sentences end with a '.' * Append error details always by ':', e.g. tr("Failed to copy file '%1': %2").(...) * Use 'directory' instead of 'folder' everywhere Change-Id: Ie045f429f72ad5045c96537465c5fb9d2e99d250 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Replace waitForBytesWritten with flushKai Koehne2015-05-111-0/+1
| | | | | | | | | | | Unfortunately waitForByesWritten is known to fail from time to time: QTBUG-24451 . We introduced it for making sure large data is actually send, but flush() seems to serve the same purporse. The only drawback is that flush() operates on the concrete socket, and therefore needs to be called on the caller's side. Change-Id: Ic92db298b3dad2c3f9eaa47d160aec517e33e284 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Windows: Fix crashes in elevated installationKai Koehne2015-04-161-4/+0
| | | | | | | | | | | | | | | | | | | | | | Until Qt 5.5.0, QLocalSocket::waitForReadyRead() immediately returns when there are still bytesAvailable(). This means our busy loop for polling new data gets stuck. To work around this we've been explicitly calling processEvents(), which however can have undesired side effects: Namely that non-network events get delivered too, and that 'intermediate' requests are sent to the server, resulting in the protocol getting out of sync - requests get replies from intermediate commands, ultimately leading to crashes. The patch therefore removes the processEvents() call, and instead works around the QLocalSocket::waitForReadyRead() deficiency by subclassing. Task-number: QTIFW-663 Task-number: QTIFW-656 Task-number: QTIFW-659 Change-Id: I4099fa1702cd8dceda954d672c9c3dac0ca7fd66 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Do wait an indefinite time for server repliesKai Koehne2015-02-241-1/+1
| | | | | | | | Operations can take sometimes longer than 30 seconds. Do wait forever, provided that the port is still open. Change-Id: If28fab22a42a863d026f2ff04cad5d8d980ea92b Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Fix handling of incomplete messages in client/server communicationKai Koehne2015-02-201-11/+18
| | | | | | | | | | | | | Do not assume that the socket always contains enough data. Instead, prefix every 'packet' with its size, and back off until the full packet is available. The actual encoding/decoding is done in Protocol::sendPacket, Protocol::receivePacket. To be able to use the methods everywhere, replies are now prefixed by a Protocol::Reply command. Change-Id: I75a89605b2cc3fe2f2f841d8e3159fc8aea65d77 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Use local sockets for client-server communicationKai Koehne2015-02-201-2/+2
| | | | | | Change-Id: I12bfef671ab31ae9fb8c4bb02776517e7f434d27 Task-number: QTIFW-228 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Fixed wrong placeholder in string.Niels Weber2015-01-061-1/+1
| | | | | Change-Id: Ifeca6563c9b1c82ab754fe87e8cacfae040cc070 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Move and rename connect method, adapt depending code.kh2014-12-021-0/+1
| | | | | | | | | | Move the connect into the remote object class and rename. Avoids passing around the socket and possible writing to the socket in a different thread. Also inherit the private remote client class from remote object to avoid code duplication (connect and send). Change-Id: I6e747dbbd8eff2846362d7f5fa4fa170495ac503 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Add LGPLv3 as new licenseKai Koehne2014-10-161-14/+7
| | | | | | | Change-Id: I61158f956894e209dccf83744b4753774676099d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Silence warning, we know what we are doing (-Wunused-value).kh12014-06-051-1/+1
| | | | | Change-Id: I3a944e0ff38b10b3440fa3c3dfcce378f284aacc Reviewed-by: Niels Weber <niels.weber@digia.com>
* Introduce new classes for client-server communication.kh12014-06-031-0/+166
Still based on what we had already, though more separated. Change-Id: I4cce298003a4ffc2ebcec01fea1a07adfbfdf990 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>