1
0
Fork 0

fix time comparisons

* tekuti/cache.scm (make-entry): Fix time comparisons.
This commit is contained in:
Andy Wingo 2010-12-06 13:06:50 +01:00
parent 8f2e3b741c
commit 68966d9e17

View file

@ -75,7 +75,8 @@
(let ((last-modified (response-last-modified response)) (let ((last-modified (response-last-modified response))
(since (request-if-modified-since request))) (since (request-if-modified-since request)))
(if (and last-modified since) (if (and last-modified since)
(<= (date->time-utc last-modified) (date->time-utc since)) (time<=? (date->time-utc last-modified)
(date->time-utc since))
#t)) #t))
(let ((etag (response-etag response)) (let ((etag (response-etag response))
(match (request-if-none-match request))) (match (request-if-none-match request)))
@ -94,7 +95,7 @@
(and (or since match) (and (or since match)
(or (not since) (or (not since)
(and last-modified (and last-modified
(<= (date->time-utc last-modified) (time<=? (date->time-utc last-modified)
(date->time-utc since)))) (date->time-utc since))))
(or (not match) (or (not match)
(and etag (list? match) (member etag match))) (and etag (list? match) (member etag match)))