GUACAMOLE-2107: Fix the error handling within the guac_tcp_connect() function.#609
Merged
mike-jumper merged 1 commit intoapache:staging/1.6.1from Oct 19, 2025
Merged
Conversation
mike-jumper
requested changes
Oct 17, 2025
Contributor
mike-jumper
left a comment
There was a problem hiding this comment.
Minor style nitpick, otherwise LGTM.
mike-jumper
approved these changes
Oct 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:connect(),select(), etc. The callers ofguac_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 thefdvariable that might get returned to be -1 in the instances where it would be returned.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 withgetsockopt()and looking at the error message.