mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
@@ -490,10 +490,9 @@ typedef enum {
|
||||
*
|
||||
* opts(GIT_OPT_SET_SERVER_CONNECT_TIMEOUT, int timeout)
|
||||
* > Sets the timeout (in milliseconds) to attempt connections 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.
|
||||
* > Note that this may not be able to be configured longer than the
|
||||
* > system default, typically 75 seconds.
|
||||
* > a remote server. 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.
|
||||
*
|
||||
* opts(GIT_OPT_GET_SERVER_TIMEOUT, int *timeout)
|
||||
* > Gets the timeout (in milliseconds) for reading from and writing
|
||||
@@ -501,9 +500,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
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#define OWNING_SUBTRANSPORT(s) ((ssh_subtransport *)(s)->parent.subtransport)
|
||||
|
||||
extern int git_socket_stream__timeout;
|
||||
|
||||
static const char cmd_uploadpack[] = "git-upload-pack";
|
||||
static const char cmd_receivepack[] = "git-receive-pack";
|
||||
|
||||
@@ -539,6 +541,10 @@ static int _git_ssh_session_create(
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (git_socket_stream__timeout > 0) {
|
||||
libssh2_session_set_timeout(s, git_socket_stream__timeout);
|
||||
}
|
||||
|
||||
if ((rc = load_known_hosts(&known_hosts, s)) < 0) {
|
||||
ssh_error(s, "error loading known_hosts");
|
||||
libssh2_session_free(s);
|
||||
|
||||
Reference in New Issue
Block a user