| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whilst the initial "connect" message is framed with a length header,
this was missing for the user data.
Thus there was no guarantee that the message frame was really received
completely on emitting the "receivedMessage" signal.
This change splits the previous "StageConnected" state into
"StageConnectedHeader" and "StageConnectedBody" and does some
refactoring to allow using the same write and read functions as the
"init" messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The server now acknowledges every received message by sending a \r.
By waiting for the acknowledgement, clients should no longer terminate
too early, causing bytes getting lost in Qt's internal socket handling.
Message handling in the server is simplified because we can now rely
on the readyRead signal being raised for every frame.
This should finally solve #125 and #121.
What remains is to correctly handle data sent using
SingleApplication::sendMessage.
|
| |
|
| |
|
|
|
| |
Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
|
|
|
|
|
|
| |
This leaves the ConnectionInfo in a valid state, even after the socket is disconnected, which could still have a readyRead() signal emitted.
Closes #123
|
| |
|
|\
| |
| | |
Fix Clang Tidy warnings
|
| |
| |
| |
| | |
No longer needed since applicationPid() now is static.
|
| |
| |
| |
| |
| |
| |
| | |
readability-convert-member-functions-to-static
readability-static-accessed-through-instance
readability-make-member-function-const
readability-inconsistent-declaration-parameter-name
|
|/ |
|
| |
|
| |
|
|
|
| |
Without guard this define from https://github.com/itay-grudev/SingleApplication/commit/3230430311c3b9d027a0ef23c3657eed3caaa696#diff-35c7c4188004bde084344a3aa8eeab6dR60 introduced compilation warning/error, and can break compilation
|
| |
|
|
|
|
|
|
| |
define NOMINMAX before <Windows.h> inclusion to disable min/max macros
defined in it. these macros conflict with any min/max functions and it
is common practice to disable them adding NOMINMAX define.
|
| |
|
|
|
|
| |
instanceStarted() not getting emitted
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes MSVC C4996 warning.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
So use QString::fromLocal8Bit and QStrings.
|
|
|
|
| |
Closes #95
|
|
|
|
| |
Fix `comparison between signed and unsigned integer expressions` problem.
User ID is a positive integer in Linux/UNIX(macOS, FreeBSD, Solaris), also `geteuid()` never fails with return code.
|
|
|
|
|
|
|
|
| |
variable (#72)
* Use geteuid and getpwuid to get username on Unix, fallback to environment variable
* Remove QProcess include
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Process socket events asynchronously
Avoid blocking the event loop using waitForReadyRead(). Instead, process the
initialization in two phases. It was necessary to add a map to keep track of
the state of the initial message processing
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
* Fix undefined variable on Windows
The timout variable does not exists in this scope, we can safely remove the
Q_UNUSED.
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
* Fix validation logic of initial message
I modified the logic to a positive value, but the modification was incomplete
and caused the initial message to be incorrectly considered as invalid.
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
* Use the proper socket when receiving message
The socket variable is a class member, but we really want to use
nextConnSocket when receiving the message in the lambda.
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
|
| |
|
|
|