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:
Daniel Stenberg 2024-10-10 18:08:07 +02:00
parent 962097b8dd
commit 3b43a05e00
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 298 additions and 194 deletions

View file

@ -757,6 +757,8 @@ static CURLcode multi_done(struct Curl_easy *data,
mdctx.premature = premature;
Curl_cpool_do_locked(data, data->conn, multi_done_locked, &mdctx);
/* flush the netrc cache */
Curl_netrc_cleanup(&data->state.netrc);
return result;
}