Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: support building on RHEL6 #1277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions git-curl-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
* introduced, oldest first, in the official version of cURL library.
*/

/**
** CURLOPT_RESOLVE was added in 7.21.3, released in December 2010.
*/
#if LIBCURL_VERSION_NUM >= 0x071503
#define GIT_CURL_HAVE_CURLOPT_RESOLVE 1
#endif

/**
* CURL_SOCKOPT_OK was added in 7.21.5, released in April 2011.
*/
Expand Down
5 changes: 5 additions & 0 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,12 @@ struct active_request_slot *get_active_slot(void)
if (curl_save_cookies)
curl_easy_setopt(slot->curl, CURLOPT_COOKIEJAR, curl_cookie_file);
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, pragma_header);
#ifdef GIT_CURL_HAVE_CURLOPT_RESOLVE
curl_easy_setopt(slot->curl, CURLOPT_RESOLVE, host_resolutions);
#else
if (host_resolutions)
warning(_("lacking support for `http.curloptResolve`"));
#endif
curl_easy_setopt(slot->curl, CURLOPT_ERRORBUFFER, curl_errorstr);
curl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(slot->curl, CURLOPT_READFUNCTION, NULL);
Expand Down