cookie: propagate errors better, cleanup the internal API

Overhaul of the internal cookie APIs and an attempt to better return
errors for OOM and similar critical problems, separate from ordinary and
benign parsing problems.

Closes #19493
This commit is contained in:
Daniel Stenberg 2025-11-12 13:16:33 +01:00
parent 296ffc45c3
commit 3f0629ca44
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
8 changed files with 317 additions and 336 deletions

View file

@ -558,10 +558,12 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
data->state.infilesize = 0;
/* If there is a list of cookie files to read, do it now! */
Curl_cookie_loadfiles(data);
result = Curl_cookie_loadfiles(data);
if(!result)
Curl_cookie_run(data); /* activate */
/* If there is a list of host pairs to deal with */
if(data->state.resolve)
if(!result && data->state.resolve)
result = Curl_loadhostpairs(data);
/* If there is a list of hsts files to read */