qmlui: support concurrent native client sessions - #2094
Conversation
Key native TCP clients by a unique session ID instead of peer address. Serialize manual authorization requests, enforce per-session access masks, and add the runtime-only --allow-all-native option.
|
The current corrected head ( |
|
Please remove the changes to README.md and name the command line option like this: As I am renaming --remote to --server Thanks |
|
Thanks. Done on current head
I have put the PR back in draft while revalidating the current head. GitHub Actions run #2480 is currently |
Resolve conflicts between the concurrent native client sessions work and the remote project handling landed on master: - m_hostsMap is now keyed by session ID, so NetProjectRequest identifies the requester from its own socket (hostForSocket) instead of a host name in the payload. getHostFromName() is gone and a session can no longer ask for the project on behalf of another - NetProjectRequest requires an authenticated session, as it is a 'case' and would otherwise bypass the access mask check in 'default' - notifyProjectChanging()/notifyProjectLoaded() iterate the session map and honour the QPointer sockets - sendWorkspaceToClient() takes a session ID - keep the per-socket RX buffering (m_rxBuffers) and its cleanup on disconnect, alongside the new session teardown
|
@infrafast today I worked a little bit on the Android version so native protocol is very important and needed some adjustments. Your PR is still valid and I appreciate it, thanks. |
|
Thanks. The requested changes are now applied and revalidated on the current upstream master: |
| } | ||
| int NetworkManager::requiredAccessMask(int actionCode) const | ||
| { | ||
| if (actionCode >= 0x0100 && actionCode < 0x0200) return 1 << 6; |
There was a problem hiding this comment.
I don't quite like this one.
Better use named enums rather than numbers
Summary
This clean PR supersedes #2093. The previous PR branch accidentally received a later packaging commit that added
out/rpi-arm64-rootfs, inflating the diff to 2910 files. This branch is recreated directly from the current officialmasterand contains only the native multi-client implementation.Changes
-sa/--server-allow-alloption for unattended deployments;Compatibility and defaults
-sa/--server-allow-allis runtime-only and is not persisted.Scope verification
Exactly 7 files are modified:
qmlui/app.cppqmlui/app.hqmlui/main.cppqmlui/qml/MainView.qmlqmlui/qml/popup/PopupNetworkConnect.qmlqmlui/tardis/networkmanager.cppqmlui/tardis/networkmanager.hREADME.mdis unchanged from upstream, as requested by the maintainer. No build output, package, rootfs, orout/content is included.Validation
upstream/master(a7f1b68f);qlcplus5build completed successfully on the implementation head before the later portability/naming-only changes;master;NativeAccessRequestanonymoustypedef struct-> named C++struct) with no runtime logic or layout change;README.mdrestored to upstream and command-line option renamed to-sa/--server-allow-all;6fa21927completed successfully;windeployqtand installer package;Ready for maintainer review.