mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:17:28 +03:00
cookie: only count accepted cookies in Curl_cookie_add
The counter used to stop accepting cookies after a certain amount has been received in a single response would previously also count some cookies that were not actually accepted as they were discarded after the counter was increased. Starting now, the counter is increased only for cookies that were accepted. Pointed out by ZeroPath Closes #19157
This commit is contained in:
parent
40f7cd2bdd
commit
48df7b29d9
1 changed files with 3 additions and 1 deletions
|
|
@ -750,7 +750,6 @@ parse_cookie_header(struct Curl_easy *data,
|
|||
if(!co->name)
|
||||
return CERR_BAD;
|
||||
|
||||
data->req.setcookies++;
|
||||
return CERR_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1140,6 +1139,9 @@ Curl_cookie_add(struct Curl_easy *data,
|
|||
if(co->expires && (co->expires < ci->next_expiration))
|
||||
ci->next_expiration = co->expires;
|
||||
|
||||
if(httpheader)
|
||||
data->req.setcookies++;
|
||||
|
||||
return co;
|
||||
fail:
|
||||
freecookie(co);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue