move global variables in httpd-logging to preserved-thread-fluids
This commit is contained in:
parent
f9060d992a
commit
becf14ce30
|
@ -35,6 +35,11 @@
|
|||
((httpd-options-simultaneous-requests options)
|
||||
=> make-rate-limiter)
|
||||
(else #f))))
|
||||
(let-thread-fluid
|
||||
logging
|
||||
(make-logging)
|
||||
(lambda ()
|
||||
|
||||
(init-http-log! options)
|
||||
(with-syslog-destination
|
||||
"httpd" #f #f #f
|
||||
|
@ -90,7 +95,7 @@
|
|||
(http-syslog (syslog-level info) "<~a>~a [closed]~%"
|
||||
(pid)
|
||||
(format-internet-host-address host-address)))))))))
|
||||
port))))))
|
||||
port))))))))
|
||||
|
||||
|
||||
;;; Top-level http request processor
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
(http-syslog-proc do-nothing-proc) ;proc to run for syslog (level fmt . args)
|
||||
(dns-lookup? #f)) ;perform dns-lookups?
|
||||
|
||||
(define logging (make-fluid #f))
|
||||
(define logging (make-preserved-thread-fluid #f))
|
||||
|
||||
(define (make-fluid-selector selector)
|
||||
(lambda () (selector (fluid logging))))
|
||||
(lambda () (selector (thread-fluid logging))))
|
||||
|
||||
(define (make-fluid-setter setter)
|
||||
(lambda (value)
|
||||
(setter (fluid logging) value)))
|
||||
(setter (thread-fluid logging) value)))
|
||||
|
||||
(define logging-http-log-proc (make-fluid-selector logging:http-log-proc))
|
||||
(define logging-http-syslog-proc (make-fluid-selector logging:http-syslog-proc))
|
||||
|
@ -51,7 +51,6 @@
|
|||
(define (init-http-log! options)
|
||||
;; syslog has to be initialized before CLF-logging
|
||||
;; because the latter may generate syslog-messages
|
||||
(set! logging (make-fluid (make-logging)))
|
||||
(init-http-syslog! (httpd-options-syslog? options))
|
||||
(init-http-port-log! (httpd-options-logfile options))
|
||||
(if (httpd-options-resolve-ips? options)
|
||||
|
|
|
@ -697,6 +697,7 @@
|
|||
enumerated ; enum
|
||||
architecture ; exception, os-error
|
||||
|
||||
|
||||
handle-fatal-error
|
||||
httpd-read-options
|
||||
httpd-error
|
||||
|
@ -745,7 +746,8 @@
|
|||
threads ; spawn
|
||||
dns ; dns-lookup-ip
|
||||
defrec-package ; define-record
|
||||
fluids ; make-fluid et al.
|
||||
thread-fluids ; make-preserved-fluid et al.
|
||||
|
||||
scsh
|
||||
scheme)
|
||||
(files (httpd logging)))
|
||||
|
|
Loading…
Reference in New Issue