From 3b97d53de6b73b41d2153f74aa8c1961a75441ae Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 23 Dec 2011 23:03:05 +0100 Subject: Actually make the decoupled design work. --- mulkcms-hunchentoot.lisp | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'mulkcms-hunchentoot.lisp') diff --git a/mulkcms-hunchentoot.lisp b/mulkcms-hunchentoot.lisp index 9f123d0..5a134ac 100644 --- a/mulkcms-hunchentoot.lisp +++ b/mulkcms-hunchentoot.lisp @@ -32,25 +32,27 @@ (multiple-value-bind (mulkcms::*user-name* mulkcms::*password*) (hunchentoot:authorization) - (let ((result (mulkcms::find-request-handler relative-path - (append (get-parameters*) - (post-parameters*)) - (header-in* :accept-language)))) - (typecase result - (cons - (when-let (content-type (getf result :content-type)) - (setf (hunchentoot:content-type*) content-type)) - (when-let (headers (getf result :headers)) - (dolist (header headers) - (setf (hunchentoot:header-out (car header)) - (cdr header)))) - (when-let (return-code (getf result :return-code)) - (setf (hunchentoot:return-code*) return-code) - ;;(hunchentoot:abort-request-handler) - ) - (getf result :body)) - (t - result)))))) + (let ((handler (mulkcms::find-request-handler relative-path + (append (get-parameters*) + (post-parameters*)) + (header-in* :accept-language)))) + (lambda () + (let ((result (funcall handler))) + (typecase result + (cons + (when-let (content-type (getf result :content-type)) + (setf (hunchentoot:content-type*) content-type)) + (when-let (headers (getf result :headers)) + (dolist (header headers) + (setf (hunchentoot:header-out (car header)) + (cdr header)))) + (when-let (return-code (getf result :return-code)) + (setf (hunchentoot:return-code*) return-code) + ;;(hunchentoot:abort-request-handler) + ) + (getf result :body)) + (t + result)))))))) (defun setup-handlers () (setq *dispatch-table* -- cgit v1.2.3