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>
This commit is contained in:

committed by
Junio C Hamano

parent
77e565d8f7
commit
3ea099d48b
@ -289,6 +289,10 @@ fetch_main () {
|
||||
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
|
||||
curl_extra_args="-k"
|
||||
fi
|
||||
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
|
||||
"`git-repo-config --bool http.noEPSV`" = true ]; then
|
||||
noepsv_opt="--disable-epsv"
|
||||
fi
|
||||
max_depth=5
|
||||
depth=0
|
||||
head="ref: $remote_name"
|
||||
@ -300,7 +304,7 @@ fetch_main () {
|
||||
$u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg;
|
||||
print "$u";
|
||||
' "$head")
|
||||
head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted")
|
||||
head=$(curl -nsfL $curl_extra_args $noepsv_opt "$remote/$remote_name_quoted")
|
||||
depth=$( expr \( $depth + 1 \) )
|
||||
done
|
||||
expr "z$head" : "z$_x40\$" >/dev/null ||
|
||||
|
Reference in New Issue
Block a user