Skip to content

Commit 61ccb76

Browse files
committed
Add support for using curl with a specified interface
1 parent 3bc5322 commit 61ccb76

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
GIT_SRC_DIR=`pwd`
4+
GIT_INSTALL_DIR=`pwd`/../git-install
5+
CURL_INSTALL_DIR=/usr/local/opt/curl/
6+
OPENSSL_INSTALL_DIR=/usr/local/opt/openssl
7+
8+
configure()
9+
{
10+
cd $GIT_SRC_DIR
11+
make clean
12+
make configure
13+
./configure --prefix=$GIT_INSTALL_DIR --with-curl=$CURL_INSTALL_DIR --with-openssl=$OPENSSL_INSTALL_DIR
14+
15+
}
16+
17+
build()
18+
{
19+
cd $GIT_SRC_DIR
20+
make all
21+
make install
22+
}
23+
24+
$*

http.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,9 @@ struct active_request_slot *get_active_slot(void)
10631063
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1);
10641064
curl_easy_setopt(slot->curl, CURLOPT_RANGE, NULL);
10651065

1066+
if (getenv("GIT_CURL_INTERFACE"))
1067+
curl_easy_setopt(slot->curl, CURLOPT_INTERFACE, getenv("GIT_CURL_INTERFACE"));
1068+
10661069
/*
10671070
* Default following to off unless "ALWAYS" is configured; this gives
10681071
* callers a sane starting point, and they can tweak for individual

0 commit comments

Comments
 (0)