Added libxrdp_get_channel_count() #1789
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.
Fixes #1775
The particular error focussed on here this :-
Previous to this PR, the only way that xrdp code had to iterate over the channels was to call
libxrdp_query_channel()
with channel ID values increasing from zero until the call failed. This method would always result in the above message being generated when the maximum channel ID was exceeded. Although the message is harmless it is misleading in the sense that no error has actually occured.The PR adds the call
libxrdp_get_channel_count()
so that code which needs to iterate over the channels can use afor
loop to do this. This occurs in two places:-xrdp_mm_trans_send_channel_setup()
iterates over the channels when sending them to chansrvxrdp_wm_init()
iterates over the channels when processing the[Channels]
section in xrdp.iniIn both cases, the resulting code now reads more easily.
Two other cleanups have been incorporated:-
libxrdp_query_channel()
has been renamed fromindex
tochannel_id
for consistency with other channel calls.g_writeln()
calls inxrdp_wm.c
have been replaced with a single call to theLOG()
macro.This PR conflicts a little with #1742 - that PR also addresses these particular errors:-