Devolutions / Devolutions/IronRDP

`server_license` module requires non obvious and error-prone control flow

Open
#269 0 comments 0 reactions 0 assignees View on GitHub
kind/technical-debt scope/core
Dominant language
Rust
Stars
3.2k
Forks
275
Avg merge
1d 11h
Merged PRs (30d)
189

Description

`LICENSE_ERROR_MESSAGE` licensing packets should not be returned as errors by the parser.
Such packets should be handled by the caller, and the caller is responsible for turning those into `Result::Err` if necessary.
It should be possible to decode a `LICENSE_ERROR_MESSAGE` structure like any other PDU.
Otherwise it requires the caller to match on the error kind in order to check for variants that are not actual errors (notably because of the protocol-level error code `STATUS_VALID_CLIENT`), and it makes the flow of control harder to write correctly and less obvious, i.e.: using the error variant for control flow is an anti-pattern the same way that using exceptions for control flow in languages such as C# or Java is an anti-pattern.
See `ConnectionConfirm` from the `nego` module for prior art.

Prior bug caused by this pattern: https://github.com/Devolutions/IronRDP/issues/268

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.