Skip to content

set SSH timeout #6721

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

Merged
merged 3 commits into from
Feb 5, 2024
Merged

set SSH timeout #6721

merged 3 commits into from
Feb 5, 2024

Conversation

vafada
Copy link
Contributor

@vafada vafada commented Jan 19, 2024

fixes #6708 ?

@@ -539,6 +541,10 @@ static int _git_ssh_session_create(
return -1;
}

if (git_socket_stream__connect_timeout > 0) {
libssh2_session_set_timeout(s, git_socket_stream__connect_timeout);
Copy link
Member

Choose a reason for hiding this comment

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

We should inherit the git_socket_stream__connect_timeout from the socket stream. So we already have connection timeouts.

I think that for this, we want to use GIT_OPT_SET_SERVER_TIMEOUT. So I think that this should be git_socket_stream__timeout instead...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated PR

@vafada vafada requested a review from ethomson January 26, 2024 18:38
The connect timeout *does* apply to SSH connections (at least libssh2),
so update the documentation appropriately.
@ethomson
Copy link
Member

ethomson commented Feb 5, 2024

Looks great — I added one change to the docs that is related but independent. (They stated that the connect timeout was not supported for SSH, in fact, it is.)

Thanks for the PR! 🎉

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.

Allow set timeout for SSH connection.
2 participants