Remove xrdp_sec_in_mcs_data() function #3263
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Back in #1742, @aquesnel added these comments to the header of
xrdp_sec_in_mcs_data()
:-I've finally gotten round to looking into this, and, like @aquesnel, I've reached the conclusion this function is not necessary (and is, in fact, confusing). The function parses data within the TS_UD_CS_CORE struct which could just as easily be parsed when
xrdp_sec_process_mcs_data_CS_CORE()
is called earlier.This ASCII art show the call sequence of these functions:-
Currently the contents of the MSC Connect Initial PDU are stored within the
client_mcs_data
member of thexrdp_sec
struct. This stream is parsed once byxrdp_sec_process_mcs_data()
and then separately byxrdp_sec_in_mcs_data()
(as the diagram above shows). There is no reason not to perform the parse in a single pass through the stream.This commit folds the functionality in
xrdp_sec_in_mcs_data()
intoxrdp_sec_process_mcs_data_CS_CORE()
and removesxrdp_sec_in_mcs_data()
Looking back on the history of these functions,
xrdp_sec_in_mcs_data()
is the older, and was added in August 2005 by 5e69f15.xrdp_sec_process_mcs_data_CS_CORE()
was originally calledxrdp_rdp_parse_client_mcs_data_CS_CORE()
and was added in Feb 2014 by 1d9c773 to a different file. The two functions have never been combined.