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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>