Fixing PR 7359

svn: r657
This commit is contained in:
Jay McCarthy 2005-08-24 18:02:23 +00:00
parent 68667a740f
commit d981654bbc

View File

@ -651,17 +651,17 @@
;;;;;; (two versions, 'v1 and I don't know what 'typed-model-split-store0 is) ;;;;;; (two versions, 'v1 and I don't know what 'typed-model-split-store0 is)
;;;; A response ;;;; A response
(define (load-servlet/path a-path) (define (load-servlet/path a-path)
(and (file-exists? a-path) (parameterize ([current-namespace (config:make-servlet-namespace)])
(let ([s (load/use-compiled a-path)]) (and (file-exists? a-path)
(cond (let ([s (load/use-compiled a-path)])
;; signed-unit servlet (cond
; MF: I'd also like to test that s has the correct import signature. ;; signed-unit servlet
[(unit/sig? s) ; MF: I'd also like to test that s has the correct import signature.
(make-cache-entry s (current-namespace))] [(unit/sig? s)
; FIX - reason about exceptions from dynamic require (catch and report if not already) (make-cache-entry s (current-namespace))]
;; module servlet ; FIX - reason about exceptions from dynamic require (catch and report if not already)
[(void? s) ;; module servlet
(parameterize ([current-namespace (config:make-servlet-namespace)]) [(void? s)
(let* ([module-name `(file ,(path->string a-path))] (let* ([module-name `(file ,(path->string a-path))]
[version (dynamic-require module-name 'interface-version)]) [version (dynamic-require module-name 'interface-version)])
(case version (case version
@ -681,15 +681,15 @@
(make-cache-entry the-servlet (make-cache-entry the-servlet
(current-namespace)))] (current-namespace)))]
[else [else
(raise (format "unknown servlet version ~e" version))])))] (raise (format "unknown servlet version ~e" version))]))]
;; response ;; response
[(response? s) [(response? s)
(letrec ([go (lambda () (letrec ([go (lambda ()
(begin (begin
(set! go (lambda () (load/use-compiled a-path))) (set! go (lambda () (load/use-compiled a-path)))
s))]) s))])
(make-cache-entry (unit/sig () (import servlet^) (go)) (make-cache-entry (unit/sig () (import servlet^) (go))
(current-namespace)))] (current-namespace)))]
[else [else
(raise (format "Loading ~e produced ~n~e~n instead of a servlet." a-path s))])))) (raise (format "Loading ~e produced ~n~e~n instead of a servlet." a-path s))])))))
))) )))