[bknr-cvs] hans changed trunk/projects/quickhoney/src/

BKNR Commits bknr at bknr.net
Sun Jul 4 20:32:45 UTC 2010


Revision: 4563
Author: hans
URL: http://bknr.net/trac/changeset/4563

adapt to new hunchentoot
U   trunk/projects/quickhoney/src/handlers.lisp
U   trunk/projects/quickhoney/src/init.lisp

Modified: trunk/projects/quickhoney/src/handlers.lisp
===================================================================
--- trunk/projects/quickhoney/src/handlers.lisp	2010-06-14 07:56:22 UTC (rev 4562)
+++ trunk/projects/quickhoney/src/handlers.lisp	2010-07-04 20:32:45 UTC (rev 4563)
@@ -597,5 +597,5 @@
   ())
 
 (defmethod handle ((handler shutdown-handler))
-  (hunchentoot:stop-server hunchentoot:*server*)
+  (hunchentoot:stop hunchentoot:*acceptor*)
   "Shutting down HTTP server")

Modified: trunk/projects/quickhoney/src/init.lisp
===================================================================
--- trunk/projects/quickhoney/src/init.lisp	2010-06-14 07:56:22 UTC (rev 4562)
+++ trunk/projects/quickhoney/src/init.lisp	2010-07-04 20:32:45 UTC (rev 4563)
@@ -6,7 +6,7 @@
   #+openmcl
   (ccl:save-application "quickhoney" :prepend-kernel t))
 
-(defun startup ()
+(defun startup (&key foregroundp (port *webserver-port*))
   (cond
     (*dumped-image*
      (asdf:oos 'asdf:load-op :quickhoney)
@@ -36,8 +36,14 @@
     (format t "; loading site configuration file~%")
     (let ((*package* (find-package :quickhoney.config)))
       (load "site-config.lisp")))
-  (bt:make-thread (curry #'hunchentoot:start-server
-                         :port *webserver-port*
-                         :threaded nil
-                         :persistent-connections-p nil)
-                  :name (format nil "HTTP server on port ~A" *webserver-port*)))
+  (flet
+      ((start-fn ()
+         (hunchentoot:start (make-instance 'hunchentoot:acceptor
+                                           :port port
+                                           :taskmaster 'hunchentoot:single-threaded-taskmaster
+                                           :request-dispatcher 'bknr.web:bknr-dispatch
+                                           :persistent-connections-p nil))))
+    (if foregroundp
+        (funcall #'start-fn)
+        (bt:make-thread #'start-fn
+                        :name (format nil "HTTP server on port ~A" *webserver-port*)))))





More information about the Bknr-cvs mailing list