mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:23:33 +03:00
netrc: cache the netrc file in memory
So that on redirects etc it does not reread the file but just parses it again. Reported-by: Pierre-Etienne Meunier Fixes #15248 Closes #15259
This commit is contained in:
parent
962097b8dd
commit
3b43a05e00
6 changed files with 298 additions and 194 deletions
|
|
@ -338,6 +338,7 @@ CURLcode Curl_close(struct Curl_easy **datap)
|
|||
Curl_wildcard_dtor(&data->wildcard);
|
||||
Curl_freeset(data);
|
||||
Curl_headers_cleanup(data);
|
||||
Curl_netrc_cleanup(&data->state.netrc);
|
||||
free(data);
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
@ -545,6 +546,7 @@ CURLcode Curl_open(struct Curl_easy **curl)
|
|||
#ifndef CURL_DISABLE_HTTP
|
||||
Curl_llist_init(&data->state.httphdrs, NULL);
|
||||
#endif
|
||||
Curl_netrc_init(&data->state.netrc);
|
||||
}
|
||||
|
||||
if(result) {
|
||||
|
|
@ -2689,7 +2691,7 @@ static CURLcode override_login(struct Curl_easy *data,
|
|||
url_provided = TRUE;
|
||||
}
|
||||
|
||||
ret = Curl_parsenetrc(conn->host.name,
|
||||
ret = Curl_parsenetrc(&data->state.netrc, conn->host.name,
|
||||
userp, passwdp,
|
||||
data->set.str[STRING_NETRC_FILE]);
|
||||
if(ret > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue