[claw-cvs] r86 - trunk/main/connectors/hunchentoot/src

achiumenti at common-lisp.net achiumenti at common-lisp.net
Mon Sep 8 09:34:13 UTC 2008


Author: achiumenti
Date: Mon Sep  8 05:34:13 2008
New Revision: 86

Modified:
   trunk/main/connectors/hunchentoot/src/hunchentoot.lisp
   trunk/main/connectors/hunchentoot/src/packages.lisp
Log:
CLAW redirection bugfix

Modified: trunk/main/connectors/hunchentoot/src/hunchentoot.lisp
==============================================================================
--- trunk/main/connectors/hunchentoot/src/hunchentoot.lisp	(original)
+++ trunk/main/connectors/hunchentoot/src/hunchentoot.lisp	Mon Sep  8 05:34:13 2008
@@ -33,9 +33,6 @@
       hunchentoot:*default-content-type* "text/html; charset=utf-8"
       hunchentoot:*handle-http-errors-p* nil)
 
-(defgeneric claw-to-hunchentoot-cookie (claw-cookie)
-  (:documentation "Returns hunchentoot cookie from a claw cookie"))
-
 (defgeneric hunchentoot-to-claw-cookie (hunchentoot-cookie)
   (:documentation "Returns a claw cookie from a hunchentoot cookie"))
 
@@ -113,15 +110,8 @@
 	   :documentation "The hunchentoot server dispatching http requests.")
    (sslserver :initform nil
               :accessor hunchentoot-connector-sslserver
-              :documentation "The hunchentoot server dispatching https requests.")
-   (http-p :initarg :http-p
-           :reader hunchentoot-connector-http-p
-           :documentation "When true the http server is enabled.")
-   (https-p :initarg :https-p
-            :reader hunchentoot-connector-https-p
-            :documentation "When true the https server is enabled if ssl-certificate-file is provided."))
-  (:default-initargs :http-p t :https-p nil
-                     :mod-lisp-p nil
+              :documentation "The hunchentoot server dispatching https requests."))
+  (:default-initargs :mod-lisp-p nil
                      :use-apache-log-p nil
                      :input-chunking-p nil 
                      :read-timeout hunchentoot:*default-read-timeout*
@@ -152,7 +142,7 @@
          (ssl-privatekey-file (hunchentoot-connector-ssl-privatekey-file connector))
          (ssl-privatekey-password (hunchentoot-connector-ssl-privatekey-password connector)))
     (progn
-      (when (hunchentoot-connector-http-p connector)
+      (when port
         (setf (hunchentoot-connector-server connector)
               (hunchentoot:start-server :port port
                                         :address address
@@ -164,21 +154,21 @@
                                         :write-timeout write-timeout
                                         #+(and :unix (not :win32)) :setuid uid
                                         #+(and :unix (not :win32)) :setgid gid)))
-      #-:hunchentoot-no-ssl (when (and (hunchentoot-connector-https-p connector) ssl-certificate-file)
-                              (setf (hunchentoot-connector-sslserver connector)
-                                    (hunchentoot:start-server :port sslport
-                                                              :address address
-                                                              :dispatch-table dispatch-table
-                                                              :mod-lisp-p mod-lisp-p
-                                                              :use-apache-log-p use-apache-log-p
-                                                              :input-chunking-p input-chunking-p
-                                                              :read-timeout read-timeout
-                                                              :write-timeout write-timeout
-                                                              #+(and :unix (not :win32)) :setuid uid
-                                                              #+(and :unix (not :win32)) :setgid gid
-                                                              :ssl-certificate-file ssl-certificate-file
-                                                              :ssl-privatekey-file ssl-privatekey-file
-                                                              :ssl-privatekey-password ssl-privatekey-password))))))
+      (when sslport
+        (setf (hunchentoot-connector-sslserver connector)
+              (hunchentoot:start-server :port sslport
+                                        :address address
+                                        :dispatch-table dispatch-table
+                                        :mod-lisp-p mod-lisp-p
+                                        :use-apache-log-p use-apache-log-p
+                                        :input-chunking-p input-chunking-p
+                                        :read-timeout read-timeout
+                                        :write-timeout write-timeout
+                                        #+(and :unix (not :win32)) :setuid uid
+                                        #+(and :unix (not :win32)) :setgid gid
+                                        #-:hunchentoot-no-ssl :ssl-certificate-file ssl-certificate-file
+                                        #-:hunchentoot-no-ssl :ssl-privatekey-file ssl-privatekey-file
+                                        #-:hunchentoot-no-ssl :ssl-privatekey-password ssl-privatekey-password))))))
 
 (defmethod claw-service-stop :before ((connector hunchentoot-connector))
   (let ((server (hunchentoot-connector-server connector))
@@ -323,9 +313,9 @@
 
 (defmethod connector-redirect ((connector hunchentoot-connector) target &key host port protocol add-session-id code)
   (hunchentoot:redirect target
-                        :host (or host (connector-server-addr connector))
-                        :port (or port (connector-server-port connector))
-                        :protocol (or protocol (connector-server-protocol connector))
+                        :host host
+                        :port port
+                        :protocol protocol
                         :add-session-id add-session-id
                         :code code))
 
@@ -385,15 +375,6 @@
 (defmethod (setf connector-content-length) (value (connector hunchentoot-connector))
   (setf (hunchentoot:content-length) value))
 
-(defmethod claw-to-hunchentoot-cookie ((cookie claw-cookie))
-  (make-instance 'hunchentoot::cookie 
-                 :name (claw-cookie-name cookie)
-                 :value (claw-cookie-value cookie)
-                 :expires (claw-cookie-expires cookie)
-                 :path (claw-cookie-path cookie)
-                 :domoain (claw-cookie-domain cookie)
-                 :secure (claw-cookie-secure cookie)
-                 :http-only (claw-cookie-http-only cookie)))
 
 (defmethod hunchentoot-to-claw-cookie ((cookie hunchentoot::cookie))
   (make-instance 'claw-cookie 

Modified: trunk/main/connectors/hunchentoot/src/packages.lisp
==============================================================================
--- trunk/main/connectors/hunchentoot/src/packages.lisp	(original)
+++ trunk/main/connectors/hunchentoot/src/packages.lisp	Mon Sep  8 05:34:13 2008
@@ -1,4 +1,4 @@
-(in-package :cl-user)
+y(in-package :cl-user)
 
 (defpackage :hunchentoot-connector
   (:use :cl :claw)



More information about the Claw-cvs mailing list