[master] b610e9a0b Use rfc2616_time() to parse Age headers
Nils Goroll
nils.goroll at uplex.de
Wed Feb 26 13:08:10 UTC 2020
commit b610e9a0b954fe963a86b95b44ee30089a9333d3
Author: Martin Blix Grydeland <martin at 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 22263a7bf..781a108cc 100644
--- a/bin/varnishd/cache/cache_rfc2616.c
+++ b/bin/varnishd/cache/cache_rfc2616.c
@@ -117,12 +117,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;
}
More information about the varnish-commit
mailing list