From 932ce6a8430d9e95c680a19f5033eead3c0a0efa Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Mon, 9 Oct 2000 22:52:09 +0000 Subject: [PATCH] Added `server-product-info' to provide the information for the Server response-header. Rewrote error handling code to provide more information in the body. Adjust `read-request' to pass the connection to `parse-request', see changes in messages.cl. --- src/main/server.cl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/server.cl b/src/main/server.cl index 920aa3a..4a2c66c 100644 --- a/src/main/server.cl +++ b/src/main/server.cl @@ -112,6 +112,16 @@ connection.")) condition)))) ,@body))))) +(defgeneric server-product-info (server) + (:documentation + "Return a list of Product-Info strings suitable for the HTTP +Server Response-Header.")) + +(defmethod server-product-info (server) + (declare (ignore server)) + ;; Default for people to lazy to adjust + '("CLASH/1.0")) + ;;; Simple Server (defclass simple-http-server (http-server) @@ -125,7 +135,7 @@ connection.")) (close-connection connection)) (defmethod read-request ((server simple-http-server) connection) - (parse-request server (connection-stream connection))) + (parse-request server connection)) (defmethod serve-request ((server simple-http-server) request) (let ((resource (namespace-lookup-url (http-server-namespace server) @@ -221,11 +231,10 @@ connection.")) (apply #'make-instance 'string-entity :body - (format nil "~%~%~D ~A~%~%~%

~A

~%

~A

~%" + (format nil "~%~%~3D ~A~%~%~%

~2:*~3D ~A

~%
~%~A~%
~%" (clash-error-code condition) (HTTP-Code-Description (clash-error-code condition)) - (HTTP-Code-Description (clash-error-code condition)) - (HTTP-Code-Description (clash-error-code condition))) + condition) (clash-error-entity-initargs condition)) (clash-error-response-initargs condition))) (error