use git_socket_stream__timeout

This commit is contained in:
Mark
2024-01-26 13:37:23 -05:00
parent 392e380463
commit 7be7c0c0e0
2 changed files with 6 additions and 7 deletions

View File

@@ -490,7 +490,8 @@ typedef enum {
*
* opts(GIT_OPT_SET_SERVER_CONNECT_TIMEOUT, int timeout)
* > Sets the timeout (in milliseconds) to attempt connections to
* > a remote server. Set to 0 to use the system default.
* > a remote server. This is supported only for HTTP(S) connections
* > and is not supported by SSH. Set to 0 to use the system default.
* > Note that this may not be able to be configured longer than the
* > system default, typically 75 seconds.
*
@@ -500,9 +501,7 @@ typedef enum {
*
* opts(GIT_OPT_SET_SERVER_TIMEOUT, int timeout)
* > Sets the timeout (in milliseconds) for reading from and writing
* > to a remote server. This is supported only for HTTP(S)
* > connections and is not supported by SSH. Set to 0 to use the
* > system default.
* > to a remote server. Set to 0 to use the system default.
*
* @param option Option key
* @param ... value to set the option

View File

@@ -23,7 +23,7 @@
#define OWNING_SUBTRANSPORT(s) ((ssh_subtransport *)(s)->parent.subtransport)
extern int git_socket_stream__connect_timeout;
extern int git_socket_stream__timeout;
static const char cmd_uploadpack[] = "git-upload-pack";
static const char cmd_receivepack[] = "git-receive-pack";
@@ -541,8 +541,8 @@ 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);
if (git_socket_stream__timeout > 0) {
libssh2_session_set_timeout(s, git_socket_stream__timeout);
}
if ((rc = load_known_hosts(&known_hosts, s)) < 0) {