Revision: 4471 Author: edi URL: http://bknr.net/trac/changeset/4471
Use abort-request-handler
U trunk/thirdparty/cl-webdav/doc/index.html U trunk/thirdparty/cl-webdav/handlers.lisp U trunk/thirdparty/cl-webdav/util.lisp
Modified: trunk/thirdparty/cl-webdav/doc/index.html =================================================================== --- trunk/thirdparty/cl-webdav/doc/index.html 2009-11-16 07:04:07 UTC (rev 4470) +++ trunk/thirdparty/cl-webdav/doc/index.html 2009-11-16 07:14:00 UTC (rev 4471) @@ -724,10 +724,9 @@ allowed. If <code><i>root-name</i></code> is given, it should be the local name (a string) of a DAV node. In this case, the XML is validated. This function is expected to be called from within a -Hunchentoot request and throws to -the <a -href="http://weitz.de/hunchentoot/#handler-done%22%3E<code>HANDLER-DONE</code></a> -tag with a return code of +Hunchentoot request and +calls <a href="http://weitz.de/hunchentoot/#abort-request-handler"><code>ABORT-REQUEST-HANDLER</code></a> +with a return code of <a href="http://weitz.de/hunchentoot/#+http-bad-request+"><code>+HTTP-BAD-REQUEST+</code></a> if a parsing error occurs or if the XML is invalid. <p>
Modified: trunk/thirdparty/cl-webdav/handlers.lisp =================================================================== --- trunk/thirdparty/cl-webdav/handlers.lisp 2009-11-16 07:04:07 UTC (rev 4470) +++ trunk/thirdparty/cl-webdav/handlers.lisp 2009-11-16 07:14:00 UTC (rev 4471) @@ -174,12 +174,10 @@ (setf (header-out :etag) etag)) (when content-language (setf (header-out :content-language) content-language)) - (catch 'handler-done - (handle-if-modified-since write-date) - (when (equal etag (header-in* :if-none-match)) - (setf (return-code) +http-not-modified+))) - (when (eql (return-code) +http-not-modified+) - (throw 'handler-done nil)) + (handle-if-modified-since write-date) + (when (equal etag (header-in* :if-none-match)) + (setf (return-code) +http-not-modified+) + (abort-request-handler)) (setf (header-out :last-modified) (rfc-1123-date write-date) (content-length) (resource-length resource)) (unless head-request-p @@ -199,7 +197,7 @@ instead." (unless results (setf (return-code) default-return-code) - (throw 'handler-done nil)) + (abort-request-handler)) (setf (content-type) "text/xml; charset=utf-8" (return-code) +http-multi-status+) ;; use a hash table to group by status code
Modified: trunk/thirdparty/cl-webdav/util.lisp =================================================================== --- trunk/thirdparty/cl-webdav/util.lisp 2009-11-16 07:04:07 UTC (rev 4470) +++ trunk/thirdparty/cl-webdav/util.lisp 2009-11-16 07:14:00 UTC (rev 4471) @@ -30,14 +30,14 @@ (in-package :cl-webdav)
(defmacro define-return-code-shortcut (name return-code) - "Defines a function called NAME which just sets the HTTP return -code to RETURN-CODE and then ends the current handler by throwing -NIL to the catch tag HANDLER-DONE." + "Defines a function called NAME which just sets the HTTP return code +to RETURN-CODE and then ends the current handler by calling +ABORT-REQUEST-HANDLER." `(defun ,name () - ,(format nil "Sets RETURN-CODE to ~A and then throws NIL to -the HANDLER-DONE catch tag." return-code) + ,(format nil "Sets RETURN-CODE to ~A and then calls ABORT-REQUEST-HANDLER." + return-code) (setf (return-code) ,return-code) - (throw 'handler-done nil))) + (abort-request-handler)))
(define-return-code-shortcut not-implemented +http-not-implemented+) (define-return-code-shortcut bad-request +http-bad-request+)