You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
alt-svc: a huge "ma" makes every cache save fail (and currently empties the alt-svc file) #23429
With ma=86400 the same command keeps both entries and adds the new one.
What happens: the ma parser accepts values up to TIME_T_MAX (lib/altsvc.c:515) and the expiry then saturates to TIME_T_MAX (altsvc.c:655-656). On save, altsvc_out() cannot format that time, curlx_gmtime() fails (altsvc.c:282), Curl_altsvc_save() stops and unlinks the temp file (altsvc.c:425-432). Because Curl_fopen() has already opened the real file with "w" to stat it, the cache file is left empty, as described in #21610 and fixed by #22850.
#22850 alone does not fix this one: with it the file survives, but every later save still fails for as long as that entry is in memory, so the alt-svc cache silently stops being written. HSTS had the same situation and got a two year cap on max-age in 08d50a7; alt-svc has no such cap.
I expected the following
The entry is stored with a clamped expiry (for example the same two year cap HSTS uses), the save succeeds, and the other entries in the file are kept.
curl/libcurl version
curl 8.23.0 (built from the curl-8_23_0 tag), also master 780405b.
Activity
altsvc: cap 'ma' values at two years maximum
altsvc: cap 'ma' values at two years maximum