[6.0] 3bc22d40c Use rfc2616_time() to parse Age headers

Reza Naghibi reza at naghibi.com
Tue May 12 15:13:07 UTC 2020


commit 3bc22d40c762d33bb9a9d98523225a5e87f10603
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 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;
 	}
 


More information about the varnish-commit mailing list