From ad10f85ccddf4cdc4fdabe5bc28622975338d552 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 5 Aug 2003 23:00:28 +0000 Subject: [PATCH] r5459: *** empty log message *** --- classes.lisp | 4 +++- color-picker.lisp | 2 ++ project.lisp | 38 +++++++++++++++++++++++--------------- wol.asd | 3 ++- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/classes.lisp b/classes.lisp index 17f12eb..4918be1 100644 --- a/classes.lisp +++ b/classes.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: July 2003 ;;;; -;;;; $Id: classes.lisp,v 1.3 2003/07/18 21:34:18 kevin Exp $ +;;;; $Id: classes.lisp,v 1.4 2003/08/05 23:00:28 kevin Exp $ ;;;; ;;;; This file and Wol are Copyright (c) 2001-2003 by Kevin M. Rosenberg ;;;; ************************************************************************* @@ -63,6 +63,8 @@ (aserve-server :initarg :aserve-server :reader request-aserve-server) (host :initarg :host :accessor request-host) (vhost :initarg :vhost :accessor request-vhost) + (desired-query :initform nil :accessor request-desired-query + :documentation "type of query alist requested") (posted-content :initarg :posted-content :accessor request-posted-content) (headers :initarg :headers :accessor request-headers) (page :initarg :page :initform nil :accessor request-page) diff --git a/color-picker.lisp b/color-picker.lisp index 2122e9e..0e64c97 100644 --- a/color-picker.lisp +++ b/color-picker.lisp @@ -1,3 +1,5 @@ +(in-package #:wol) + (defun luminance (r g b) (+ (* r 0.299) (* g 0.587) (* b 0.114))) diff --git a/project.lisp b/project.lisp index ad94d48..1c9a89d 100644 --- a/project.lisp +++ b/project.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: July 2003 ;;;; -;;;; $Id: project.lisp,v 1.5 2003/07/23 23:08:28 kevin Exp $ +;;;; $Id: project.lisp,v 1.6 2003/08/05 23:00:28 kevin Exp $ ;;;; ;;;; This file and Wol are Copyright (c) 2001-2003 by Kevin M. Rosenberg ;;;; ************************************************************************* @@ -18,7 +18,6 @@ (sessions t) (session-lifetime 18000) (reap-interval 300) server (connector :modlisp)) - (unless server (setq server (ecase connector @@ -112,8 +111,14 @@ (let ((req (make-instance 'http-request :host (header-value command :host) - :raw-uri (puri:intern-uri (header-value command :url)) - :uri (puri:intern-uri (command->uri command)) + :raw-uri (aif (ignore-errors + (puri:intern-uri (header-value command :url))) + it + (header-value command :url)) + :uri (aif (ignore-errors + (puri:intern-uri (command->uri command))) + it + (command->uri command)) :protocol (ensure-keyword (header-value command :server-protocol)) :protocol-string (header-value command :server-protocol) @@ -130,9 +135,7 @@ (defun command->uri (command) (format nil "http://~A:~D~A" (header-value command :host) - (awhen (header-value - command :server-ip-port) - (parse-integer it)) + (header-value command :server-ip-port) (header-value command :url))) (defun is-index-request (req ent) @@ -214,14 +217,18 @@ (format nil "~{~D~^.~}" *wol-version*)) (defun request-query (req &key (uri t) (post t)) - (append - (when (and uri (request-uri-query req)) - (aif (request-query-alist req) - it - (setf (request-query-alist req) - (query-to-alist (request-uri-query req))))) - (when (and post (request-posted-content req)) - (query-to-alist (request-posted-content req))))) + (let ((desired (cons uri post))) + (if (equal desired (request-desired-query req)) + ;; Same desired as cached + (request-query-alist req) + (progn + (setf (request-desired-query req) desired) + (setf (request-query-alist req) + (append + (when (and uri (request-uri-query req)) + (query-to-alist (request-uri-query req))) + (when (and post (request-posted-content req)) + (query-to-alist (request-posted-content req))))))))) (defun request-query-value (key req &key (uri t) (post t)) (cdr (assoc key (request-query req :uri uri :post post) @@ -239,6 +246,7 @@ (defmacro with-wol-page ((req ent &key (format :html) (precompute t) headers) &body body) + (declare (ignore req ent)) (let ((fmt (gensym "FMT-")) (precomp (gensym "PRE-")) (result (gensym "RES-")) diff --git a/wol.asd b/wol.asd index 849582a..241638b 100644 --- a/wol.asd +++ b/wol.asd @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: July 2003 ;;;; -;;;; $Id: wol.asd,v 1.4 2003/07/19 20:32:48 kevin Exp $ +;;;; $Id: wol.asd,v 1.5 2003/08/05 23:00:28 kevin Exp $ ;;;; ;;;; This file and Wol are Copyright (c) 2003 by Kevin M. Rosenberg ;;;; ************************************************************************* @@ -38,4 +38,5 @@ (:file "sessions" :depends-on ("classes")) (:file "uri" :depends-on ("classes")) (:file "log" :depends-on ("classes")) + (:file "color-picker" :depends-on ("package")) )) -- 2.34.1