Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added libxrdp_get_channel_count() #1789

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

matt335672
Copy link
Member

Fixes #1775

The particular error focussed on here this :-

[yyyymmdd-hh:mm:ss] [ERROR] libxrdp_query_channel - Channel out of range 4

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 a for loop to do this. This occurs in two places:-

  1. xrdp_mm_trans_send_channel_setup() iterates over the channels when sending them to chansrv
  2. xrdp_wm_init() iterates over the channels when processing the [Channels] section in xrdp.ini

In both cases, the resulting code now reads more easily.

Two other cleanups have been incorporated:-

  1. The channel ID parameter to libxrdp_query_channel() has been renamed from index to channel_id for consistency with other channel calls.
  2. A couple of g_writeln() calls in xrdp_wm.c have been replaced with a single call to the LOG() macro.

This PR conflicts a little with #1742 - that PR also addresses these particular errors:-

[yyyymmdd-hh:mm:ss] [ERROR] libxrdp_query_channel - Channel 0 name rdpdr

Copy link
Contributor

@aquesnel aquesnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link
Member

@metalefty metalefty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, too.

@matt335672 matt335672 merged commit dc3276c into neutrinolabs:devel Feb 4, 2021
@matt335672 matt335672 deleted the issue1775 branch February 4, 2021 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XRDP is logging some normal conditions as ERROR messages
3 participants