Remove surflet-path bug in SURFLET-HANDLER.
The surflet-path could be given either explicitly or by options-structure. This introduced an unexpected behavior: the explicitly given surflet-path argument was completely ignored when options were given. Now we accept only one argument to SURFLET-HANDLER that must be an option, like HTTPD does it.
This commit is contained in:
parent
0a510b7c76
commit
2067f77670
|
@ -21,6 +21,7 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/su
|
||||||
; rman-gateway
|
; rman-gateway
|
||||||
; info-gateway
|
; info-gateway
|
||||||
surflet-handler
|
surflet-handler
|
||||||
|
surflet-handler/options
|
||||||
let-opt
|
let-opt
|
||||||
scsh
|
scsh
|
||||||
scheme)
|
scheme)
|
||||||
|
@ -201,7 +202,12 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/su
|
||||||
"text/plain"))
|
"text/plain"))
|
||||||
(make-file-directory-options))))
|
(make-file-directory-options))))
|
||||||
(cons "img" (rooted-file-handler images-dir))
|
(cons "img" (rooted-file-handler images-dir))
|
||||||
(cons "surflet" (surflet-handler surflet-dir)))
|
(cons "surflet" (surflet-handler
|
||||||
|
(with-surflet-path surflet-dir)))
|
||||||
|
(cons "surflets" (surflet-handler
|
||||||
|
(with-surflet-path surflet-dir
|
||||||
|
(with-session-lifetime 1300))))
|
||||||
|
)
|
||||||
(rooted-file-or-directory-handler htdocs-dir))))
|
(rooted-file-or-directory-handler htdocs-dir))))
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
|
@ -38,9 +38,7 @@
|
||||||
;; Loads a new or resumes a suspended SUrflet; returns a
|
;; Loads a new or resumes a suspended SUrflet; returns a
|
||||||
;; (HTTP-)RESPONSE. SURFLET-PATH is a string pointing to the real
|
;; (HTTP-)RESPONSE. SURFLET-PATH is a string pointing to the real
|
||||||
;; directory where the SUrflets are searched.
|
;; directory where the SUrflets are searched.
|
||||||
(define (surflet-handler surflet-path . maybe-options)
|
(define (surflet-handler options)
|
||||||
(let-optionals maybe-options
|
|
||||||
((options (with-surflet-path surflet-path (make-default-surflet-options))))
|
|
||||||
(set-thread-fluid! *options* options)
|
(set-thread-fluid! *options* options)
|
||||||
(spawn surveillance-thread)
|
(spawn surveillance-thread)
|
||||||
(lambda (path req)
|
(lambda (path req)
|
||||||
|
@ -58,7 +56,7 @@
|
||||||
(make-error-response (status-code method-not-allowed) req
|
(make-error-response (status-code method-not-allowed) req
|
||||||
request-method)))
|
request-method)))
|
||||||
(make-error-response (status-code bad-request) req
|
(make-error-response (status-code bad-request) req
|
||||||
(format #f "Bad path: ~s" path))))))
|
(format #f "Bad path: ~s" path)))))
|
||||||
|
|
||||||
;;; LAUNCH-NEW-SESSION
|
;;; LAUNCH-NEW-SESSION
|
||||||
;; Loads and runs a new session of a SUrflet installing the RESET
|
;; Loads and runs a new session of a SUrflet installing the RESET
|
||||||
|
|
Loading…
Reference in New Issue