revert(3p/git): Revert merge of git upstream at v2.26.2
This causes cgit to serve error pages, which is undesirable. This reverts commit5229c9b232, reversing changes made tof2b211131f.
This commit is contained in:
parent
6f8fbf4aa4
commit
93ba78d6f4
1006 changed files with 60537 additions and 148724 deletions
30
third_party/git/http.c
vendored
30
third_party/git/http.c
vendored
|
|
@ -150,7 +150,7 @@ static unsigned long empty_auth_useless =
|
|||
|
||||
static struct curl_slist *pragma_header;
|
||||
static struct curl_slist *no_pragma_header;
|
||||
static struct string_list extra_http_headers = STRING_LIST_INIT_DUP;
|
||||
static struct curl_slist *extra_http_headers;
|
||||
|
||||
static struct active_request_slot *active_queue_head;
|
||||
|
||||
|
|
@ -414,9 +414,11 @@ static int http_options(const char *var, const char *value, void *cb)
|
|||
if (!value) {
|
||||
return config_error_nonbool(var);
|
||||
} else if (!*value) {
|
||||
string_list_clear(&extra_http_headers, 0);
|
||||
curl_slist_free_all(extra_http_headers);
|
||||
extra_http_headers = NULL;
|
||||
} else {
|
||||
string_list_append(&extra_http_headers, value);
|
||||
extra_http_headers =
|
||||
curl_slist_append(extra_http_headers, value);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -511,11 +513,9 @@ static void set_proxyauth_name_password(CURL *result)
|
|||
#else
|
||||
struct strbuf s = STRBUF_INIT;
|
||||
|
||||
strbuf_addstr_urlencode(&s, proxy_auth.username,
|
||||
is_rfc3986_unreserved);
|
||||
strbuf_addstr_urlencode(&s, proxy_auth.username, 1);
|
||||
strbuf_addch(&s, ':');
|
||||
strbuf_addstr_urlencode(&s, proxy_auth.password,
|
||||
is_rfc3986_unreserved);
|
||||
strbuf_addstr_urlencode(&s, proxy_auth.password, 1);
|
||||
curl_proxyuserpwd = strbuf_detach(&s, NULL);
|
||||
curl_easy_setopt(result, CURLOPT_PROXYUSERPWD, curl_proxyuserpwd);
|
||||
#endif
|
||||
|
|
@ -558,7 +558,6 @@ static int has_cert_password(void)
|
|||
return 0;
|
||||
if (!cert_auth.password) {
|
||||
cert_auth.protocol = xstrdup("cert");
|
||||
cert_auth.host = xstrdup("");
|
||||
cert_auth.username = xstrdup("");
|
||||
cert_auth.path = xstrdup(ssl_cert);
|
||||
credential_fill(&cert_auth);
|
||||
|
|
@ -681,8 +680,8 @@ static void curl_dump_header(const char *text, unsigned char *ptr, size_t size,
|
|||
for (header = headers; *header; header++) {
|
||||
if (hide_sensitive_header)
|
||||
redact_sensitive_header(*header);
|
||||
strbuf_insertstr((*header), 0, text);
|
||||
strbuf_insertstr((*header), strlen(text), ": ");
|
||||
strbuf_insert((*header), 0, text, strlen(text));
|
||||
strbuf_insert((*header), strlen(text), ": ", 2);
|
||||
strbuf_rtrim((*header));
|
||||
strbuf_addch((*header), '\n');
|
||||
trace_strbuf(&trace_curl, (*header));
|
||||
|
|
@ -1074,7 +1073,6 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
|
|||
|
||||
git_config(urlmatch_config_entry, &config);
|
||||
free(normalized_url);
|
||||
string_list_clear(&config.vars, 1);
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800
|
||||
if (http_ssl_backend) {
|
||||
|
|
@ -1201,7 +1199,8 @@ void http_cleanup(void)
|
|||
#endif
|
||||
curl_global_cleanup();
|
||||
|
||||
string_list_clear(&extra_http_headers, 0);
|
||||
curl_slist_free_all(extra_http_headers);
|
||||
extra_http_headers = NULL;
|
||||
|
||||
curl_slist_free_all(pragma_header);
|
||||
pragma_header = NULL;
|
||||
|
|
@ -1625,11 +1624,10 @@ int run_one_slot(struct active_request_slot *slot,
|
|||
|
||||
struct curl_slist *http_copy_default_headers(void)
|
||||
{
|
||||
struct curl_slist *headers = NULL;
|
||||
const struct string_list_item *item;
|
||||
struct curl_slist *headers = NULL, *h;
|
||||
|
||||
for_each_string_list_item(item, &extra_http_headers)
|
||||
headers = curl_slist_append(headers, item->string);
|
||||
for (h = extra_http_headers; h; h = h->next)
|
||||
headers = curl_slist_append(headers, h->data);
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue