Commit graph

130 commits

Author SHA1 Message Date
Marc-André Lureau
33e61a6c19 refactor(server): wrap handler in Arc<Mutex<>>
The following commit will share the handler with a DVC channel.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-25 01:01:59 +09:00
Marc-André Lureau
d0aae30a86 refactor(server): drop need for async in input handler
Having async handlers is discouraged. Implementations should use event
signaling and separate threads instead. See also:
https://github.com/Devolutions/IronRDP/pull/350#pullrequestreview-1821815597

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-25 01:01:59 +09:00
Marc-André Lureau
df329ac888 feat(server): impl From<ainput::MousePdu> for MouseEvent
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-25 01:01:59 +09:00
Marc-André Lureau
c61b17ab70 feat(server): handle relative mouse events
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-15 13:21:51 +09:00
Marc-André Lureau
119b0d33c2 feat(server): add optional cliprdr channel
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-15 13:21:51 +09:00
Marc-André Lureau
38d3c33aa9 feat(server): add basic static channels handling
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-15 13:21:51 +09:00
Marc-Andre Lureau
49ea64d913
fix(server): advertize FASTPATH_OUTPUT (#332)
This helps FreeRDP, despite not being required by mstcs:
https://github.com/FreeRDP/FreeRDP/issues/9612

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-08 14:23:42 -05:00
Marc-Andre Lureau
e3669b8eb7
feat(client): log to stdout/err by default (#330)
Logging to a file by default isn't common.

Use a more verbose and developer-friendly format in this case.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-08 19:11:29 +00:00
Benoît Cortier
9355ae5b3d
refactor: follow-up for PR #198 (#320) 2023-12-05 17:18:09 +00:00
Marc-André Lureau
53967a6bb0 feat(server): use SetSurfaceBits if possible
mstsc does not display bitmap update, for some reason. Using
SetSurfaceBits instead solves it, and is required for more advanced codecs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
06dbe8008b feat(server): pass the surface flags to the UpdateEncoder
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
58a5d396a3 feat(server): check the client supports fastpath
It's needed for bitmap & surface commands etc.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
00ba7ad94d feat(server): advertize support for all surface commands
Those flags are set both by client and server. Even if the server
doesn't send those commands yet, this should be supported by most
clients.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
fa85584658 fix(server): handle only IO data at this point
Support for other channel messages is currently lacking.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
3e47129eef fix(server): use nz/u16 for bitmap update region
Use u16 since that's the limit for resolution and bitmap data.

Use non-zero types for width & height, to avoid various issues, such as
division by zero.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
950e88688c fix(server): fix fragmentation
The fragment index is not correctly updated, staying at 0, making
invalid series of First/First/..Last.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
3467579ffe feat(server): handle ShareDataPdu::ShutdownRequest
That PDU is sent by mstsc on disconnect.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
b0e0dd456e fix(server): advertize smaller FPU
u32::MAX is too large for mstsc, it fails to connect.
See also: https://github.com/Devolutions/IronRDP/issues/318

16Mb is the value use by freerdp
sample/server (https://github.com/FreeRDP/FreeRDP/pull/1313) and it's
probably fine for now.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
b6b509588c fix(server): keep running after a connection error
Simply report an error!() instead of returning an Error back.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau
1c220581de feat(pdu): impl Default for General capability sets
This allows to simplify some user code, and let us introduce a
"protocol_version" field in the next patch without having to explicitly
set its value but rely on the default instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
mihneabuz
ef57fba453 fix(server): improve logging 2023-11-14 16:28:33 -05:00
mihneabuz
8c41b7649e fix(acceptor): accumulate and batch process input packets
We accumulate input events during the accept connection step, and
batch process them before running the main session loop.
2023-11-14 16:28:33 -05:00
Benoît Cortier
c025f494bc
fix(server): enable required tokio feature net (#273) 2023-11-09 21:53:46 -05:00
Benoît Cortier
3d98cd1d94
refactor: enable elided_lifetimes_in_paths lint (#203)
Hiding the lifetimes is making the code less obvious.

That’s not a problem for types that I know about intimately such as
`ReadCursor` or `WriteCursor`, but I actually found myself surprised
more than once when reading code I didn’t authored, discovering  later
there was in fact a hidden lifetime parameter.
I expect this problem to be worse for someone not familiar with
our codebase.

I understand this lint is "allow" by default because in some cases
it leads to writing unergonomic ugly code when a type has many generic
lifetimes parameters:

```
TyCtxt<'_, '_, '_>
```

However we _never_ work with more than one generic lifetime parameter in
IronRDP codebase, so it seems to me that the tradeoff towards clarity is
worth it, in our case.
2023-10-04 09:14:36 -07:00
Benoît Cortier
6283e37937
refactor: check for additional lints (#200) 2023-10-02 13:46:05 +03:00
Benoît Cortier
86b86ba343
doc: elaborate high-level documentation (#192) 2023-09-18 19:03:39 +00:00
Marc-Andre Lureau
37ac7052aa
fix(pdu): don't be strict about platform type (#184)
Allow values outside the range of known values. FreeRDP has been using
0xFFFF - N for custom values.
2023-09-05 15:53:27 -04:00
Vladyslav Nikonov
cd91756305
feat: CLIPRDR initialization sequence (#182) 2023-08-28 15:50:43 +00:00
Benoît CORTIER
2938db416b feat: API for custom static virtual channels
Issue: ARC-147
Co-authored-by: Isaiah Becker-Mayer <isaiah@goteleport.com>
2023-08-26 04:37:13 -04:00
Mihnea Buzatu
74e95f692a
feat: initial server support (#167) 2023-08-25 09:35:00 -04:00