eli
svn: r4534
This commit is contained in:
parent
75e9681724
commit
e98caf31c1
|
@ -20,13 +20,19 @@
|
||||||
(gen-authentication-responder "forbidden.html")]
|
(gen-authentication-responder "forbidden.html")]
|
||||||
[passwords-refresh-responder
|
[passwords-refresh-responder
|
||||||
(gen-passwords-refreshed "passwords-refresh.html")])
|
(gen-passwords-refreshed "passwords-refresh.html")])
|
||||||
|
(define last-read-time (box #f))
|
||||||
(define password-cache (box #f))
|
(define password-cache (box #f))
|
||||||
(define (reset-password-cache!)
|
(define (update-password-cache!)
|
||||||
; more here - a malformed password file will kill the connection
|
(define cur-mtime (file-or-directory-modify-seconds password-file))
|
||||||
(set-box! password-cache (read-passwords password-file)))
|
(when (or (not (unbox last-read-time))
|
||||||
|
(cur-mtime . > . (unbox last-read-time))
|
||||||
|
(not (unbox password-cache)))
|
||||||
|
(set-box! last-read-time cur-mtime)
|
||||||
|
; more here - a malformed password file will kill the connection
|
||||||
|
(set-box! password-cache (read-passwords password-file))))
|
||||||
(define (read-password-cache)
|
(define (read-password-cache)
|
||||||
|
(update-password-cache!)
|
||||||
(unbox password-cache))
|
(unbox password-cache))
|
||||||
(reset-password-cache!)
|
|
||||||
(lambda (conn req)
|
(lambda (conn req)
|
||||||
(define-values (uri method path) (decompose-request req))
|
(define-values (uri method path) (decompose-request req))
|
||||||
(cond
|
(cond
|
||||||
|
@ -38,7 +44,7 @@
|
||||||
realm))]
|
realm))]
|
||||||
[(string=? "/conf/refresh-passwords" path)
|
[(string=? "/conf/refresh-passwords" path)
|
||||||
;; more here - send a nice error page
|
;; more here - send a nice error page
|
||||||
(reset-password-cache!)
|
(update-password-cache!)
|
||||||
(output-response/method
|
(output-response/method
|
||||||
conn
|
conn
|
||||||
(passwords-refresh-responder)
|
(passwords-refresh-responder)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user