Commit graph

130 commits

Author SHA1 Message Date
devolutionsbot
e6d6e9d8a7
chore(release): prepare for publishing (#628) 2025-01-28 23:24:35 +00:00
Marc-Andre Lureau
a6c36511f6
feat(server): add volume support (#641)
Add server messages and API to support setting client volume.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-27 08:10:15 -05:00
Marc-André Lureau
0f9877ad39 fix(server): check client size
It's problematic when the client didn't resize, as we send bitmap
updates that don't fit. The client will likely drop the connection.
Let's have a warning for this case in the server.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-27 07:35:36 -05:00
Marc-André Lureau
e21c5568a4 refactor(server): factor out deactivate_reactivate()
This makes code slightly nicer and allow further code reuse.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-27 07:35:36 -05:00
Marc-André Lureau
a0fccf8d1a feat(server): advertize Bitmap::desktopResizeFlag
This makes freerdp keep the flag up and handle desktop
resize/deactivation-reactivation. It should be okay to advertize,
if the server doesn't resize anyway, I guess.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-27 07:35:36 -05:00
Marc-André Lureau
82c7c2f5b0 fix(server): do not restart static channels on reactivation
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-27 07:35:36 -05:00
Marc-André Lureau
c4587b537c fix(server): reattach existing channels
I couldn't find any explicit behaviour described in the specification,
but apparently, we must just keep the channel state as they were during
reactivation. This fixes various state issues during client resize.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-27 07:35:36 -05:00
Marc-André Lureau
63963182b5 fix(server): drop unexpected PDUs during deactivation-reactivation
The current behaviour of handling unmatched PDUs in fn read_by_hint()
isn't good enough. An unexpected PDUs may be received and fail to be
decoded during Acceptor::step().

Change the code to simply drop unexpected PDUs (as opposed to attempting
to replay the unmatched leftover, which isn't clearly needed)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-27 07:35:36 -05:00
Sébastien Duquette
dd249909a8
docs: use CDN URLs instead of the blob storage URLs for Devolutions logo (#631) 2025-01-09 10:06:10 -05:00
Marc-Andre Lureau
a0d32d7245
fix: fix commit 9198284263 (#626)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Changelog: ignore
2025-01-06 09:29:30 -05:00
devolutionsbot
9292988a88
chore(release): prepare for publishing (#624)
Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com>
2024-12-17 18:18:10 +00:00
Marc-Andre Lureau
9198284263
feat(server): make TlsIdentityCtx accept PEM files (#623)
This is in general more convenient than DER files.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-12-17 10:50:39 -05:00
devolutionsbot
97ef9f0acb
chore(release): prepare for publishing (#611) 2024-12-14 14:32:28 +00:00
Benoît Cortier
0c10367ebc
chore: symlinks to license files in packages (#604)
Add symlinks to the license files in crates that we are publishing on
crates.io.
2024-12-11 08:13:26 -05:00
Benoît Cortier
755738ff9c
chore: prepare release (#598)
Crates to release:

- ironrdp-acceptor -> 0.2.0
- ironrdp-async -> 0.2.0
- ironrdp-blocking -> 0.2.0
- ironrdp-session -> 0.2.0
- ironrdp-server -> 0.3.0
- ironrdp -> 0.7.0
2024-12-06 09:51:14 +00:00
Benoît Cortier
fc23992dea
chore: prepare release (#585)
Crates to release:

- ironrdp-core -> 0.1.1
- ironrdp-pdu -> 0.1.1
- ironrdp-svc -> 0.1.1
- ironrdp-connector -> 0.2.0
- ironrdp-server -> 0.2.0
- ironrdp -> 0.6.0
2024-11-21 10:14:01 -05:00
Marc-Andre Lureau
2e59014c97
feat(server): add GetLocalAddr (#581)
Add a server event to lookup the actual server listen address.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-11-20 10:06:57 -05:00
Benoît CORTIER
294af1cc5c style: cargo +nightly fmt 2024-11-20 01:28:31 +09:00
Benoît CORTIER
807eb59b07 refactor: enable clippy::std_instead_of_core lint 2024-11-20 01:28:31 +09:00
Benoît CORTIER
d26e64e4c2 refactor: enable clippy::similar_names lint 2024-11-20 01:28:31 +09:00
Marc-André Lureau
de67e58dd5 perf(server): make tiles encoding parallel with rayon
This can help a lot wall-clock time, but depends on CPU.

rfx_enc                 time:   [9.7885 ms 10.123 ms 10.439 ms]
                        change: [-80.484% -79.847% -79.208%] (p = 0.00 < 0.05)
                        Performance has improved.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-11-05 20:16:43 +09:00
Marc-André Lureau
6e567d401f feat(bench): benchmark the remotefx encoder
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-11-05 20:16:43 +09:00
Marc-André Lureau
ff81e7502c refactor(server): factor out remotefx tile encoding
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-11-05 20:16:43 +09:00
Marc-André Lureau
631964d615 feat(server): warn if encoding takes >10ms
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-11-05 20:16:43 +09:00
Marc-Andre Lureau
3e738a96ed
feat(server): add builder option to set remotefx (#569)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-31 14:16:03 +00:00
Marc-André Lureau
7dd1787c52 feat(server): add a "helper" feature for TlsIdentityCtx
This snippet is useful for server implementations, as long as the server
must be configured with a tokio-rustls TlsAcceptor, and not directly
with certificate paths for examples.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-29 21:48:11 +09:00
Marc-André Lureau
5381b24444 docs: use Devolutions logo
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-29 19:14:20 +09:00
Marc-André Lureau
bf56a7fc80 docs: use README.md for crates lib.rs doc
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-29 19:14:20 +09:00
Marc-André Lureau
4ef36bf5fa docs: add project links to READMEs for consistency
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-29 19:14:20 +09:00
Benoît CORTIER
42cc02d6f6 docs(server): slightly adjust comments 2024-10-25 16:04:07 +09:00
Marc-André Lureau
8fc30cb22e feat(server): add hybrid security support
Add a RdpServerSecurity::Hybrid variant, to support both hybrid +
hybrid-ex, since they are very close / similar and I don't see much
point in selecting one without the other at this point.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-25 13:19:58 +09:00
Marc-André Lureau
86bc10bf95 feat(server): allow setting credentials
Modify Acceptor to take optionally Credentials at construct time.

The credentials can be changed via ServerEvent::SetCredentials.

Unauthorized connections are no longer accepted.

Note that I couldn't find a nice way to return an invalid logon with RDP
standard security. The next commits will add HYBRID support to improve
the situation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-25 13:19:58 +09:00
Marc-André Lureau
aa8c34edf4 fix(server): add missing tokio rt feature
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-10-25 13:19:58 +09:00
Marc-André Lureau
c5a4abd112 perf(server): run server tasks concurrently
Instead of using tokio::select!() and following one branch at a time to
process one events, use multiple loop that process events independently.
This way, we can be at the same time reading and processing a PDU from
the client, while encoding display update and writing a Wave.

This greatly improves responsivness and usability of qemu-rdp.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-09-23 02:25:59 -04:00
Marc-André Lureau
648f73c995 refactor(server): lower function requirements
Prepare for the next patch, and take "impl FramedWrite" rather than a
Framed<W> for the various dispatch methods.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-09-23 02:25:59 -04:00
Marc-André Lureau
3c6b2ef2e2 feat(server): move the encoder to blocking task
Since it is a CPU intesive task, we should spawn a task to avoid
blocking other async tasks.

The UpdateFragmenterOwned is quite a gross hack to allow returning the result
from a the task lifetime. I don't know how to accomplish this better, or
else we have to add some Arc<Mutex> stuff.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-09-23 02:25:59 -04:00
Marc-André Lureau
b7164ecc68 refactor(server): split read and write half
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-09-23 02:25:59 -04:00
Marc-André Lureau
303315c168 refactor: make reader/writer functions specific
No functional change.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-09-23 02:25:59 -04:00
Marc-André Lureau
ba49456236 fix(server): fix unnecessary qualification
705 |             rdp::headers::ShareControlPdu::Data(header) => match header.share_data_pdu {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: requested on the command line with `-W unused-qualifications`
help: remove the unnecessary path segments
    |
705 -             rdp::headers::ShareControlPdu::Data(header) => match header.share_data_pdu {
705 +             ShareControlPdu::Data(header) => match header.share_data_pdu {

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-09-03 06:48:31 -04:00
Marc-André Lureau
402ffd56c9 refactor(core): move Encode/Decode to core
ironrdp-pdu contains lots of code that we don’t actually need in other crates such as the virtual channels.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
ab5760d47b refactor(pdu): add X224 newtype
This allows to implement external Encode/Decode traits in following change.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
23bc008d65 refactor(core): move {Decode/Encode}Error
& document the public API.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
1ef9dd3f37 refactor(pdu): rename PduEncode->Encode PduDecode->Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
b4c4b7ef58 chore(pdu): introduce DecodeResult
Introduce a new error type to split encoding/decoding errors as well as
helper traits and functions to ease porting and conventions.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
f1c3f7aa60 refactor(pdu): remove PduError::Custom
It's similar to PduError::Other, except it has an error source.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
80e8d1b257 refactor(server): factorize RfxEncoder::encode() code
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
00d4750e4b refactor(pdu): rename InvalidMessage->InvalidField
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
7419467ad3 refactor(core): move cursor.rs
Add documentation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
4154ceea05 refactor(core): move impl_as_any macros
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
09ae0d043d feat(server): collect and postpone incoming PDUs during reactivation
The client may have pending messages while the activation-reactivation
sequence is ongoing. Let's collect them in this case and restore them
after successfull reconnection.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-19 06:44:15 -04:00