[bknr-cvs] r2280 - branches/trunk-reorg/projects/scrabble/src

bknr at bknr.net bknr at bknr.net
Wed Nov 14 07:35:43 UTC 2007


Author: hhubner
Date: 2007-11-14 02:35:39 -0500 (Wed, 14 Nov 2007)
New Revision: 2280

Modified:
   branches/trunk-reorg/projects/scrabble/src/start-webserver.lisp
Log:
Remove hunchentoot patch.


Modified: branches/trunk-reorg/projects/scrabble/src/start-webserver.lisp
===================================================================
--- branches/trunk-reorg/projects/scrabble/src/start-webserver.lisp	2007-11-14 07:31:01 UTC (rev 2279)
+++ branches/trunk-reorg/projects/scrabble/src/start-webserver.lisp	2007-11-14 07:35:39 UTC (rev 2280)
@@ -20,45 +20,6 @@
   (make-pathname :name nil :type nil :version nil
 		 :defaults (merge-pathnames #p"../../../thirdparty/MochiKit/MochiKit/" *load-truename*)))
 
-
-;; for now...
-(in-package :hunchentoot)
-
-(defun enough-url (url url-prefix)
-  (subseq url (mismatch url url-prefix)))
-
-(defun create-folder-dispatcher-and-handler (uri-prefix base-path &optional content-type)
-  "Creates and returns a dispatch function which will dispatch to a
-handler function which emits the file relative to BASE-PATH that is
-denoted by the URI of the request relative to URI-PREFIX.  URI-PREFIX
-must be a string ending with a slash, BASE-PATH must be a pathname
-designator for an existing directory.  If CONTENT-TYPE is not NIL,
-it'll be the content type used for all files in the folder."
-  (unless (and (stringp uri-prefix)
-               (plusp (length uri-prefix))
-               (char= (char uri-prefix (1- (length uri-prefix))) #\/))
-    (error "~S must be string ending with a slash." uri-prefix))
-  (when (or (pathname-name base-path)
-            (pathname-type base-path))
-    (error "~S is supposed to denote a directory." base-path))
-  (flet ((handler ()
-           (let* ((script-name (url-decode (script-name)))
-                  (script-path (enough-url (regex-replace-all "\\\\" script-name "/")
-                                                  uri-prefix))
-                  (script-path-directory (pathname-directory script-path)))
-             (unless (or (stringp script-path-directory)
-                         (null script-path-directory)
-                         (and (listp script-path-directory)
-                              (eq (first script-path-directory) :relative)
-                              (loop for component in (rest script-path-directory)
-                                    always (stringp component))))
-               (setf (return-code) +http-forbidden+)
-               (throw 'handler-done nil))
-             (handle-static-file (merge-pathnames script-path base-path) content-type))))
-    (create-prefix-dispatcher uri-prefix #'handler)))
-
-(in-package :scrabble.web)
-
 (defun start-webserver (&key (port 4242))
   (open-scrabble-store)
   (when (and (boundp '*server*) *server*)




More information about the Bknr-cvs mailing list