Merge branch 'jc/maint-log-grep-all-match-1' into maint
[git.git] / http.c
diff --git a/http.c b/http.c
index 0a27b146adb15ad97407ed2c196878058f0ccec8..9bac1d89fdb639f6991bfe9f683ccf7bd5ada4cb 100644 (file)
--- a/http.c
+++ b/http.c
@@ -4,6 +4,7 @@
 #include "run-command.h"
 #include "url.h"
 #include "credential.h"
+#include "version.h"
 
 int active_requests;
 int http_is_verbose;
@@ -299,7 +300,7 @@ static CURL *get_curl_handle(void)
                curl_easy_setopt(result, CURLOPT_VERBOSE, 1);
 
        curl_easy_setopt(result, CURLOPT_USERAGENT,
-               user_agent ? user_agent : GIT_HTTP_USER_AGENT);
+               user_agent ? user_agent : git_user_agent());
 
        if (curl_ftp_no_epsv)
                curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
@@ -763,10 +764,12 @@ int handle_curl_result(struct active_request_slot *slot)
                        return HTTP_REAUTH;
                }
        } else {
+#if LIBCURL_VERSION_NUM >= 0x070c00
                if (!curl_errorstr[0])
                        strlcpy(curl_errorstr,
                                curl_easy_strerror(results->curl_result),
                                sizeof(curl_errorstr));
+#endif
                return HTTP_ERROR;
        }
 }