Skip to content

GUACAMOLE-2107: Fix the error handling within the guac_tcp_connect() function.#609

Merged
mike-jumper merged 1 commit intoapache:staging/1.6.1from
necouchman:jira/2107
Oct 19, 2025
Merged

GUACAMOLE-2107: Fix the error handling within the guac_tcp_connect() function.#609
mike-jumper merged 1 commit intoapache:staging/1.6.1from
necouchman:jira/2107

Conversation

@necouchman
Copy link
Contributor

This pull request makes a couple of changes within the guac_tcp_connect() function that correct issues that cause the Wake-on-LAN functionality to break, and probably also break other protocols that rely on this function:

  • The function returned either the socket that was connected, or various error codes from other calls to functions like connect(), select(), etc. The callers of guac_tcp_connect() rely on the return value being either a socket or a negative integer upon failure, so I've updated many of the instances of the fd variable that might get returned to be -1 in the instances where it would be returned.
  • The simple call to the select() function for waiting for a timeout when attempting to connect to a non-blocking socket requires a bit more checking to see if it has succeeded or failed, which involves querying the socket with getsockopt() and looking at the error message.

@mike-jumper mike-jumper changed the base branch from patch to staging/1.6.1 September 30, 2025 18:15
Copy link
Contributor

@mike-jumper mike-jumper left a comment

Choose a reason for hiding this comment

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

Minor style nitpick, otherwise LGTM.

@mike-jumper mike-jumper merged commit c4d70e0 into apache:staging/1.6.1 Oct 19, 2025
1 check passed
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.

2 participants