Skip to content

test_ssh2: fix detecting connect failure - #1854

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:testssh2-connect
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:testssh2-connect

Conversation

@vszakats

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the test_ssh2 self-test to correctly detect connection failures by tracking whether any connect() attempt succeeded, rather than relying on the socket handle becoming invalid.

Changes:

  • Add a connected flag to record successful connect() completion within the retry loop.
  • Replace the post-loop failure check (sock == LIBSSH2_INVALID_SOCKET) with !connected to correctly report connect failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

vszakats added a commit to vszakats/libssh2 that referenced this pull request Apr 12, 2026
@vszakats vszakats closed this in 2e69ba2 Apr 13, 2026
@vszakats
vszakats deleted the testssh2-connect branch April 13, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants