Mailing List Archive

[6.0] 3bc22d40c Use rfc2616_time() to parse Age headers
commit 3bc22d40c762d33bb9a9d98523225a5e87f10603
Author: Martin Blix Grydeland <martin@varnish-software.com>
Date: Tue Feb 25 15:29:58 2020 +0100

Use rfc2616_time() to parse Age headers

One time element function to rule and parse them all.

diff --git a/bin/varnishd/cache/cache_rfc2616.c b/bin/varnishd/cache/cache_rfc2616.c
index 79317394e..2a1b476dd 100644
--- a/bin/varnishd/cache/cache_rfc2616.c
+++ b/bin/varnishd/cache/cache_rfc2616.c
@@ -115,12 +115,7 @@ RFC2616_Ttl(struct busyobj *bo, vtim_real now, vtim_real *t_origin,
*/

if (http_GetHdr(hp, H_Age, &p)) {
- /*
- * We deliberately run with partial results, rather than
- * reject the Age: header outright. This will be future
- * compatible with fractional seconds.
- */
- age = strtoul(p, NULL, 10);
+ age = rfc2616_time(p);
*t_origin -= age;
}

_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit