r5459: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 5 Aug 2003 23:00:28 +0000 (23:00 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 5 Aug 2003 23:00:28 +0000 (23:00 +0000)
classes.lisp
color-picker.lisp
project.lisp
wol.asd

index 17f12eb267e46ef9ee9ba652276cbf13bd0ace02..4918be1fadadc12aaa830f2177f138fe3e853877 100644 (file)
@@ -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)
index 2122e9e46de9974eb183a66d7154e2bdf17a907e..0e64c971762bd807535c112cbbdfc635fd21ea6c 100644 (file)
@@ -1,3 +1,5 @@
+(in-package #:wol)
+
 (defun luminance (r g b)
   (+ (* r 0.299) (* g 0.587) (* b 0.114)))
 
index ad94d48f2aa99087ff062300aa2130098eb1f4cd..1c9a89d474aee1d31c6c0dd4c6f3bb70f5e3dc39 100644 (file)
@@ -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
   (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)
 (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)
   (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)
 (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 849582a2b9a2cb36ef2ee3561fa8a7782582476a..241638b03ac6784913216908acac911472290f06 100644 (file)
--- 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"))
      ))