aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorSasha Khapyorsky <sashak@voltaire.com>2006-09-29 03:10:44 +0300
committerJunio C Hamano <junkio@cox.net>2006-09-28 19:02:46 -0700
commit3ea099d48b15f69889f4efe71599c9dfde6bb26a (patch)
treea9ad5a1e8038a6ab2300876eae9e940752483792 /http.c
parent77e565d8f76357781eb6236e031e8e0581de83a9 (diff)
downloadgit-3ea099d48b15f69889f4efe71599c9dfde6bb26a.tar.gz
git-3ea099d48b15f69889f4efe71599c9dfde6bb26a.tar.xz
http/ftp: optionally ask curl to not use EPSV command
If http.noEPSV config variable is defined and true, or if GIT_CURL_FTP_NO_EPSV environment variable is defined, disable using of EPSV ftp command (PASV will be used instead). This is helpful with some "poor" ftp servers which does not support EPSV mode. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http.c')
-rw-r--r--http.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/http.c b/http.c
index 6c1937b67..576740fef 100644
--- a/http.c
+++ b/http.c
@@ -23,6 +23,7 @@ char *ssl_capath = NULL;
char *ssl_cainfo = NULL;
long curl_low_speed_limit = -1;
long curl_low_speed_time = -1;
+int curl_ftp_no_epsv = 0;
struct curl_slist *pragma_header;
@@ -155,6 +156,11 @@ static int http_options(const char *var, const char *value)
return 0;
}
+ if (!strcmp("http.noepsv", var)) {
+ curl_ftp_no_epsv = git_config_bool(var, value);
+ return 0;
+ }
+
/* Fall back on the default ones */
return git_default_config(var, value);
}
@@ -196,6 +202,9 @@ static CURL* get_curl_handle(void)
curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT);
+ if (curl_ftp_no_epsv)
+ curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
+
return result;
}
@@ -251,6 +260,9 @@ void http_init(void)
max_requests = DEFAULT_MAX_REQUESTS;
#endif
+ if (getenv("GIT_CURL_FTP_NO_EPSV"))
+ curl_ftp_no_epsv = 1;
+
#ifndef NO_CURL_EASY_DUPHANDLE
curl_default = get_curl_handle();
#endif