From bknr at bknr.net Tue Dec 1 21:58:01 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 22:58:01 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/chunga/ Message-ID: Revision: 4478 Author: edi URL: http://bknr.net/trac/changeset/4478 Changes for cookie parsing U trunk/thirdparty/chunga/CHANGELOG.txt U trunk/thirdparty/chunga/doc/index.html U trunk/thirdparty/chunga/packages.lisp U trunk/thirdparty/chunga/read.lisp U trunk/thirdparty/chunga/util.lisp Modified: trunk/thirdparty/chunga/CHANGELOG.txt =================================================================== --- trunk/thirdparty/chunga/CHANGELOG.txt 2009-11-30 13:24:17 UTC (rev 4477) +++ trunk/thirdparty/chunga/CHANGELOG.txt 2009-12-01 21:58:01 UTC (rev 4478) @@ -1,3 +1,7 @@ +Exported TOKEN-CHAR-P +Allowed START and END keyword arguments for TRIM-WHITESPACE +Simplified cookie value parsing + Version 1.0.0 2009-02-19 Switched to binary streams underneath and got rid of FLEXI-STREAMS dependency Modified: trunk/thirdparty/chunga/doc/index.html =================================================================== --- trunk/thirdparty/chunga/doc/index.html 2009-11-30 13:24:17 UTC (rev 4477) +++ trunk/thirdparty/chunga/doc/index.html 2009-12-01 21:58:01 UTC (rev 4478) @@ -85,6 +85,7 @@
  • with-character-stream-semantics
  • read-line*
  • read-http-headers +
  • token-char-p
  • read-token
  • read-name-value-pair
  • read-name-value-pairs @@ -542,6 +543,19 @@ + + +


    [Function]
    token-char-p char => generalized-boolean +


    + +Returns a true value if the Lisp character CHAR is a token constituent +according to +RFC 2616. + +
    + + +


    [Function]
    read-name-value-pair stream &key value-required-p cookie-syntax => pair @@ -662,10 +676,10 @@ -


    [Function]
    trim-whitespace string => string' +


    [Function]
    trim-whitespace string &key start end => string'


    -Returns a version of the string string where spaces and tab +Returns a version of the string string (between start and end) where spaces and tab characters are trimmed from the start and the end.
    Modified: trunk/thirdparty/chunga/packages.lisp =================================================================== --- trunk/thirdparty/chunga/packages.lisp 2009-11-30 13:24:17 UTC (rev 4477) +++ trunk/thirdparty/chunga/packages.lisp 2009-12-01 21:58:01 UTC (rev 4478) @@ -62,6 +62,7 @@ :read-token :skip-whitespace :syntax-error + :token-char-p :trim-whitespace :with-character-stream-semantics)) Modified: trunk/thirdparty/chunga/read.lisp =================================================================== --- trunk/thirdparty/chunga/read.lisp 2009-11-30 13:24:17 UTC (rev 4477) +++ trunk/thirdparty/chunga/read.lisp 2009-12-01 21:58:01 UTC (rev 4478) @@ -120,10 +120,10 @@ (finish-output log-stream)) result)) -(defun trim-whitespace (string) - "Returns a version of the string STRING where spaces and tab -characters are trimmed from the start and the end. Might return -STRING." +(defun trim-whitespace (string &key (start 0) (end (length string))) + "Returns a version of the string STRING \(between START and END) +where spaces and tab characters are trimmed from the start and the +end. Might return STRING." ;; optimized version to replace STRING-TRIM, suggested by Jason Kantz (declare (optimize speed @@ -133,18 +133,18 @@ (compilation-speed 0) #+:lispworks (hcl:fixnum-safety 0))) (declare (string string)) - (let* ((length (length string)) - (start (loop for i of-type fixnum from 0 below length - while (or (char= #\space (char string i)) - (char= #\tab (char string i))) - finally (return i))) - (end (loop for i of-type fixnum downfrom (1- length) to 0 - while (or (char= #\space (char string i)) - (char= #\tab (char string i))) - finally (return (1+ i))))) - (declare (fixnum start end)) - (cond ((and (zerop start) (= end length)) string) - (t (subseq string start end))))) + (let* ((start% (loop for i of-type fixnum from start below end + while (or (char= #\space (char string i)) + (char= #\tab (char string i))) + finally (return i))) + (end% (loop for i of-type fixnum downfrom (1- end) to start + while (or (char= #\space (char string i)) + (char= #\tab (char string i))) + finally (return (1+ i))))) + (declare (fixnum start% end%)) + (cond ((and (zerop start%) (= end% (length string))) string) + ((> start% end%) "") + (t (subseq string start% end%))))) (defun read-http-headers (stream &optional log-stream) "Reads HTTP header lines from STREAM \(except for the initial @@ -243,24 +243,14 @@ (signal-unexpected-chars stream char '(#\Space #\Tab))))) (otherwise (write-char char out)))))) -(defun read-cookie-value (stream &key name separators) +(defun read-cookie-value (stream &key (separators ";")) "Reads a cookie parameter value from STREAM which is returned as a -string. Simply reads until a comma or a semicolon is seen \(or an -element of SEPARATORS)." - (when (eql #\, (peek-char* stream nil)) - (return-from read-cookie-value "")) +string. Simply reads until a semicolon is seen \(or an element of +SEPARATORS)." (trim-whitespace (with-output-to-string (out) - ;; special case for the `Expires' parameter - maybe skip the first comma - (loop with separators% = (cond (separators) - ((equalp name "Expires") ";") - (t ",;")) - for char = (peek-char* stream nil) - until (or (null char) (find char separators% :test #'char=)) - when (and (null separators) - (or (char= char #\,) - (digit-char-p char))) - do (setq separators% '(#\, #\;)) + (loop for char = (peek-char* stream nil) + until (or (null char) (find char separators :test #'char=)) do (write-char (read-char* stream) out))))) (defun read-name-value-pair (stream &key (value-required-p t) cookie-syntax) @@ -272,7 +262,7 @@ internally." (skip-whitespace stream) (let ((name (if cookie-syntax - (read-cookie-value stream :separators "=,") + (read-cookie-value stream :separators "=") (read-token stream)))) (skip-whitespace stream) (cons name @@ -280,7 +270,7 @@ (eql (peek-char* stream nil) #\=)) (assert-char stream #\=) (skip-whitespace stream) - (cond (cookie-syntax (read-cookie-value stream :name name)) + (cond (cookie-syntax (read-cookie-value stream)) ((char= (peek-char* stream) #\") (read-quoted-string stream)) (t (read-token stream))))))) Modified: trunk/thirdparty/chunga/util.lisp =================================================================== --- trunk/thirdparty/chunga/util.lisp 2009-11-30 13:24:17 UTC (rev 4477) +++ trunk/thirdparty/chunga/util.lisp 2009-12-01 21:58:01 UTC (rev 4478) @@ -90,4 +90,4 @@ READ-CHAR* and friends \(see above) to simulate a character stream although we're reading from a binary stream." `(let ((*char-buffer* nil)) - , at body)) \ No newline at end of file + , at body)) From bknr at bknr.net Tue Dec 1 22:06:56 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:06:56 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/drakma/ Message-ID: Revision: 4479 Author: edi URL: http://bknr.net/trac/changeset/4479 Be more liberal when parsing cookies U trunk/thirdparty/drakma/CHANGELOG.txt U trunk/thirdparty/drakma/cookies.lisp U trunk/thirdparty/drakma/util.lisp Modified: trunk/thirdparty/drakma/CHANGELOG.txt =================================================================== --- trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-01 21:58:01 UTC (rev 4478) +++ trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-01 22:06:56 UTC (rev 4479) @@ -1,3 +1,4 @@ +Be more liberal when parsing cookies (thanks to Andrei Stebakov) Added HTTP method PATCH (thanks to Xiangjun Wu) Don't send GET parameters again when redirecting (reported by Eugene Ossintsev) Solidify feature expressions (thanks to Joshua Taylor) Modified: trunk/thirdparty/drakma/cookies.lisp =================================================================== --- trunk/thirdparty/drakma/cookies.lisp 2009-12-01 21:58:01 UTC (rev 4478) +++ trunk/thirdparty/drakma/cookies.lisp 2009-12-01 22:06:56 UTC (rev 4479) @@ -249,20 +249,14 @@ of three-element lists where each one contains the name of the cookie, the value of the cookie, and an attribute/value list for the optional cookie parameters." - (with-sequence-from-string (stream string) - (loop with *current-error-message* = (format nil "While parsing cookie header ~S:" string) - for first = t then nil - for next = (and (skip-whitespace stream) - (or first (assert-char stream #\,)) - (skip-whitespace stream) - (skip-more-commas stream)) - for name/value = (and next (read-name-value-pair stream - :cookie-syntax t)) - for parameters = (and name/value (read-name-value-pairs stream - :value-required-p nil - :cookie-syntax t)) - while name/value - collect (list (car name/value) (cdr name/value) parameters)))) + (let ((*current-error-message* (format nil "While parsing cookie header ~S:" string)) + result) + (dolist (substring (split-set-cookie-string string)) + (with-sequence-from-string (stream substring) + (let* ((name/value (read-name-value-pair stream :cookie-syntax t)) + (parameters (read-name-value-pairs stream :value-required-p nil :cookie-syntax t))) + (push (list (car name/value) (cdr name/value) parameters) result)))) + (nreverse result))) (defun get-cookies (headers uri) "Returns a list of COOKIE objects corresponding to the Modified: trunk/thirdparty/drakma/util.lisp =================================================================== --- trunk/thirdparty/drakma/util.lisp 2009-12-01 21:58:01 UTC (rev 4478) +++ trunk/thirdparty/drakma/util.lisp 2009-12-01 22:06:56 UTC (rev 4479) @@ -279,4 +279,49 @@ WITH-INPUT-FROM-STRING, but creates a sequence of octets that works with CHUNGA::PEEK-CHAR* and friends." `(flex:with-input-from-sequence (,stream (map 'list #'char-code ,string)) - , at body)) \ No newline at end of file + , at body)) + +(defun split-set-cookie-string (string) + "Splits the string STRING which is assumed to be the value of a +`Set-Cookie' into parts corresponding to individual cookies and +returns a list of these parts \(substrings). + +The string /should/ be split at commas, but heuristical approach is +used instead which doesn't split at commas which are followed by what +cannot be recognized as the start of the next cookie. This is +necessary because servers send headers containing unquoted commas +which are not meant as separators." + ;; this would of course be a lot easier with CL-PPCRE's SPLIT + (let ((cookie-start 0) + (string-length (length string)) + search-start + result) + (tagbody + ;; at this point we know that COOKIE-START is the start of a new + ;; cookie (at the start of the string or behind a comma) + next-cookie + (setq search-start cookie-start) + ;; we reach this point if the last comma didn't separate two + ;; cookies or if there was no previous comma + skip-comma + (unless (< search-start string-length) + (return-from split-set-cookie-string (nreverse result))) + ;; look is there's a comma + (let* ((comma-pos (position #\, string :start search-start)) + ;; and if so, look for a #\= behind the comma + (equals-pos (and comma-pos (position #\= string :start comma-pos))) + ;; check that (except for whitespace) there's only a token + ;; (the name of the next cookie) between #\, and #\= + (new-cookie-start-p (and equals-pos + (every 'token-char-p + (trim-whitespace string + :start (1+ comma-pos) + :end equals-pos))))) + (when (and comma-pos (not new-cookie-start-p)) + (setq search-start (1+ comma-pos)) + (go skip-comma)) + (let ((end-pos (or comma-pos string-length))) + (push (trim-whitespace (subseq string cookie-start end-pos)) result) + (setq cookie-start (1+ end-pos)) + (go next-cookie)))))) + From bknr at bknr.net Tue Dec 1 22:36:55 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:36:55 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/drakma/ Message-ID: Revision: 4480 Author: edi URL: http://bknr.net/trac/changeset/4480 Allow additional headers to be functions U trunk/thirdparty/drakma/CHANGELOG.txt U trunk/thirdparty/drakma/doc/index.html U trunk/thirdparty/drakma/request.lisp Modified: trunk/thirdparty/drakma/CHANGELOG.txt =================================================================== --- trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-01 22:06:56 UTC (rev 4479) +++ trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-01 22:36:55 UTC (rev 4480) @@ -1,3 +1,4 @@ +Allowed additional headers to be function designators (suggested by Xiangjun Wu) Be more liberal when parsing cookies (thanks to Andrei Stebakov) Added HTTP method PATCH (thanks to Xiangjun Wu) Don't send GET parameters again when redirecting (reported by Eugene Ossintsev) Modified: trunk/thirdparty/drakma/doc/index.html =================================================================== --- trunk/thirdparty/drakma/doc/index.html 2009-12-01 22:06:56 UTC (rev 4479) +++ trunk/thirdparty/drakma/doc/index.html 2009-12-01 22:36:55 UTC (rev 4480) @@ -935,11 +935,15 @@ proxy-basic-authorization is used like basic-authorization, but for the proxy, and only if proxy is true.

    -additional-headers is a -name/value alist -(like parameters) of additional HTTP headers which -should be sent with the request. +additional-headers +is a +name/value alist +of additional HTTP headers which should be sent with the request. +Unlike in parameters, the cdrs can not only be +strings but also designators for unary functions (which should in turn +return a string) in which case the function is called each time the +header is written.

    If redirect is not NIL, it must be a non-negative integer Modified: trunk/thirdparty/drakma/request.lisp =================================================================== --- trunk/thirdparty/drakma/request.lisp 2009-12-01 22:06:56 UTC (rev 4479) +++ trunk/thirdparty/drakma/request.lisp 2009-12-01 22:36:55 UTC (rev 4480) @@ -321,8 +321,11 @@ BASIC-AUTHORIZATION, but for the proxy, and only if PROXY is true. -ADDITIONAL-HEADERS is a name/value alist \(like PARAMETERS) of -additional HTTP headers which should be sent with the request. +ADDITIONAL-HEADERS is a name/value alist of additional HTTP headers +which should be sent with the request. Unlike in PARAMETERS, the cdrs +can not only be strings but also designators for unary functions +\(which should in turn return a string) in which case the function is +called each time the header is written. If REDIRECT is not NIL, it must be a non-negative integer or T. If REDIRECT is true, Drakma will follow redirects \(return codes @@ -543,7 +546,10 @@ (setq must-close close) (write-header "Connection" "close")) (loop for (name . value) in additional-headers - do (write-header name "~A" value)) + do (write-header name "~A" + (cond ((or (functionp value) (symbolp value)) + (funcall value)) + (t value)))) (when content (when content-type (write-header "Content-Type" "~A" content-type)) From bknr at bknr.net Tue Dec 1 22:41:14 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:41:14 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/chunga/ Message-ID: Revision: 4481 Author: edi URL: http://bknr.net/trac/changeset/4481 Release 1.1.0 U trunk/thirdparty/chunga/CHANGELOG.txt U trunk/thirdparty/chunga/chunga.asd U trunk/thirdparty/chunga/doc/index.html Modified: trunk/thirdparty/chunga/CHANGELOG.txt =================================================================== --- trunk/thirdparty/chunga/CHANGELOG.txt 2009-12-01 22:36:55 UTC (rev 4480) +++ trunk/thirdparty/chunga/CHANGELOG.txt 2009-12-01 22:41:14 UTC (rev 4481) @@ -1,3 +1,5 @@ +Version 1.1.0 +2009-12-01 Exported TOKEN-CHAR-P Allowed START and END keyword arguments for TRIM-WHITESPACE Simplified cookie value parsing Modified: trunk/thirdparty/chunga/chunga.asd =================================================================== --- trunk/thirdparty/chunga/chunga.asd 2009-12-01 22:36:55 UTC (rev 4480) +++ trunk/thirdparty/chunga/chunga.asd 2009-12-01 22:41:14 UTC (rev 4481) @@ -29,7 +29,7 @@ (asdf:defsystem :chunga :serial t - :version "1.0.0" + :version "1.1.0" :depends-on (:trivial-gray-streams) :components ((:file "packages") (:file "specials") Modified: trunk/thirdparty/chunga/doc/index.html =================================================================== --- trunk/thirdparty/chunga/doc/index.html 2009-12-01 22:36:55 UTC (rev 4480) +++ trunk/thirdparty/chunga/doc/index.html 2009-12-01 22:41:14 UTC (rev 4481) @@ -108,7 +108,7 @@ Chunga together with this documentation can be downloaded from http://weitz.de/files/chunga.tar.gz. The -current version is 1.0.0. (This version is not compatible with +current version is 1.1.0. (This version is not compatible with pre-2009 releases of Hunchentoot or Drakma.) Chunga will only From bknr at bknr.net Tue Dec 1 22:41:49 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:41:49 +0100 Subject: [bknr-cvs] edi changed tags/thirdparty/chunga-1.1.0/ Message-ID: Revision: 4482 Author: edi URL: http://bknr.net/trac/changeset/4482 Tag chunga 1.1.0 A tags/thirdparty/chunga-1.1.0/ From bknr at bknr.net Tue Dec 1 22:44:55 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:44:55 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/drakma/ Message-ID: Revision: 4483 Author: edi URL: http://bknr.net/trac/changeset/4483 Release 1.1.0 U trunk/thirdparty/drakma/CHANGELOG.txt U trunk/thirdparty/drakma/doc/index.html U trunk/thirdparty/drakma/drakma.asd Modified: trunk/thirdparty/drakma/CHANGELOG.txt =================================================================== --- trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-01 22:41:49 UTC (rev 4482) +++ trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-01 22:44:55 UTC (rev 4483) @@ -1,3 +1,5 @@ +Version 1.1.0 +2009-12-01 Allowed additional headers to be function designators (suggested by Xiangjun Wu) Be more liberal when parsing cookies (thanks to Andrei Stebakov) Added HTTP method PATCH (thanks to Xiangjun Wu) Modified: trunk/thirdparty/drakma/doc/index.html =================================================================== --- trunk/thirdparty/drakma/doc/index.html 2009-12-01 22:41:49 UTC (rev 4482) +++ trunk/thirdparty/drakma/doc/index.html 2009-12-01 22:44:55 UTC (rev 4483) @@ -654,13 +654,13 @@ Drakma together with this documentation can be downloaded from http://weitz.de/files/drakma.tar.gz. -The current version is 1.0.0. Drakma can be installed +The current version is 1.1.0. Drakma can be installed via ASDF and depends on the open source libraries CL-BASE64 (use 3.3.2 or higher to avoid an unneeded dependency on KMRCL), Puri, FLEXI-STREAMS, -and Chunga (1.0.0 or higher). +and Chunga (1.1.0 or higher). If you're not using LispWorks, you'll also need usocket (0.3.2 or newer) and (except Modified: trunk/thirdparty/drakma/drakma.asd =================================================================== --- trunk/thirdparty/drakma/drakma.asd 2009-12-01 22:41:49 UTC (rev 4482) +++ trunk/thirdparty/drakma/drakma.asd 2009-12-01 22:44:55 UTC (rev 4483) @@ -38,7 +38,7 @@ (in-package :drakma-asd) -(defvar *drakma-version-string* "1.0.0" +(defvar *drakma-version-string* "1.1.0" "Drakma's version number as a string.") ;; we export its name so we can import it later From bknr at bknr.net Tue Dec 1 22:45:24 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:45:24 +0100 Subject: [bknr-cvs] edi changed tags/thirdparty/drakma-1.1.0/ Message-ID: Revision: 4484 Author: edi URL: http://bknr.net/trac/changeset/4484 Tag drakma 1.1.0 A tags/thirdparty/drakma-1.1.0/ From bknr at bknr.net Tue Dec 1 22:48:48 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:48:48 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/chunga/doc/index.html Message-ID: Revision: 4485 Author: edi URL: http://bknr.net/trac/changeset/4485 Typo U trunk/thirdparty/chunga/doc/index.html Modified: trunk/thirdparty/chunga/doc/index.html =================================================================== --- trunk/thirdparty/chunga/doc/index.html 2009-12-01 22:45:24 UTC (rev 4484) +++ trunk/thirdparty/chunga/doc/index.html 2009-12-01 22:48:48 UTC (rev 4485) @@ -548,7 +548,7 @@


    [Function]
    token-char-p char => generalized-boolean


    -Returns a true value if the Lisp character CHAR is a token constituent +Returns a true value if the Lisp character CHAR is a token constituent according to RFC 2616. From bknr at bknr.net Tue Dec 1 22:49:53 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 01 Dec 2009 23:49:53 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/chunga/doc/index.html Message-ID: Revision: 4486 Author: edi URL: http://bknr.net/trac/changeset/4486 ::rollseyes:: U trunk/thirdparty/chunga/doc/index.html Modified: trunk/thirdparty/chunga/doc/index.html =================================================================== --- trunk/thirdparty/chunga/doc/index.html 2009-12-01 22:48:48 UTC (rev 4485) +++ trunk/thirdparty/chunga/doc/index.html 2009-12-01 22:49:53 UTC (rev 4486) @@ -548,7 +548,7 @@


    [Function]
    token-char-p char => generalized-boolean


    -Returns a true value if the Lisp character CHAR is a token constituent +Returns a true value if the Lisp character char is a token constituent according to RFC 2616. From bknr at bknr.net Mon Dec 14 20:26:57 2009 From: bknr at bknr.net (BKNR Commits) Date: Mon, 14 Dec 2009 21:26:57 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/drakma/ Message-ID: Revision: 4487 Author: edi URL: http://bknr.net/trac/changeset/4487 Parameters without values U trunk/thirdparty/drakma/CHANGELOG.txt U trunk/thirdparty/drakma/doc/index.html U trunk/thirdparty/drakma/request.lisp U trunk/thirdparty/drakma/util.lisp Modified: trunk/thirdparty/drakma/CHANGELOG.txt =================================================================== --- trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-01 22:49:53 UTC (rev 4486) +++ trunk/thirdparty/drakma/CHANGELOG.txt 2009-12-14 20:26:57 UTC (rev 4487) @@ -1,3 +1,5 @@ +Allow for GET/POST parameters without a value (seen on Lotus webservers) + Version 1.1.0 2009-12-01 Allowed additional headers to be function designators (suggested by Xiangjun Wu) Modified: trunk/thirdparty/drakma/doc/index.html =================================================================== --- trunk/thirdparty/drakma/doc/index.html 2009-12-01 22:49:53 UTC (rev 4486) +++ trunk/thirdparty/drakma/doc/index.html 2009-12-14 20:26:57 UTC (rev 4487) @@ -789,7 +789,10 @@ each being a string) which denotes the parameters which are added to the query part of the URI or (in the case of a POST request) comprise the request body. (But -see content below.) The +see content below.) +The values can also be +NIL in which case only the name (without an equal sign) is used in +the query string. The name/value pairs are URL-encoded Modified: trunk/thirdparty/drakma/request.lisp =================================================================== --- trunk/thirdparty/drakma/request.lisp 2009-12-01 22:49:53 UTC (rev 4486) +++ trunk/thirdparty/drakma/request.lisp 2009-12-14 20:26:57 UTC (rev 4487) @@ -237,19 +237,20 @@ PARAMETERS is an alist of name/value pairs \(the car and the cdr each being a string) which denotes the parameters which are added to the query part of the URL or \(in the case of a POST request) comprise the -body of the request. (But see CONTENT below.) The name/value pairs -are URL-encoded using the FLEXI-STREAMS external format -EXTERNAL-FORMAT-OUT before they are sent to the server unless -FORM-DATA is true in which case the POST request body is sent as -`multipart/form-data' using EXTERNAL-FORMAT-OUT. The values of the -PARAMETERS alist can also be pathnames, open binary input streams, -unary functions, or lists where the first element is of one of the -former types. These values denote files which should be sent as part -of the request body. If files are present in PARAMETERS, the content -type of the request is always `multipart/form-data'. If the value is -a list, the part of the list behind the first element is treated as a -plist which can be used to specify a content type and/or a filename -for the file, i.e. such a value could look like, e.g., +body of the request. (But see CONTENT below.) The values can also be +NIL in which case only the name \(without an equal sign) is used in +the query string. The name/value pairs are URL-encoded using the +FLEXI-STREAMS external format EXTERNAL-FORMAT-OUT before they are sent +to the server unless FORM-DATA is true in which case the POST request +body is sent as `multipart/form-data' using EXTERNAL-FORMAT-OUT. The +values of the PARAMETERS alist can also be pathnames, open binary +input streams, unary functions, or lists where the first element is of +one of the former types. These values denote files which should be +sent as part of the request body. If files are present in PARAMETERS, +the content type of the request is always `multipart/form-data'. If +the value is a list, the part of the list behind the first element is +treated as a plist which can be used to specify a content type and/or +a filename for the file, i.e. such a value could look like, e.g., \(#p\"/tmp/my_file.doc\" :content-type \"application/msword\" :filename \"upload.doc\"). @@ -406,7 +407,10 @@ (setq proxy (list proxy 80)))) ;; make sure we don't get :CRLF on Windows (let ((*default-eol-style* :lf) - (file-parameters-p (find-if-not #'stringp parameters :key #'cdr)) + (file-parameters-p (find-if-not (lambda (thing) + (or (stringp thing) + (null thing))) + parameters :key #'cdr)) parameters-used-p) (when (and file-parameters-p (not (eq method :post))) (parameter-error "Don't know how to handle parameters in ~S, as this is not a POST request." Modified: trunk/thirdparty/drakma/util.lisp =================================================================== --- trunk/thirdparty/drakma/util.lisp 2009-12-01 22:49:53 UTC (rev 4486) +++ trunk/thirdparty/drakma/util.lisp 2009-12-14 20:26:57 UTC (rev 4487) @@ -111,18 +111,19 @@ (defun alist-to-url-encoded-string (alist external-format) "ALIST is supposed to be an alist of name/value pairs where both -names and values are strings. This function returns a string where -this list is represented as for the content type -`application/x-www-form-urlencoded', i.e. the values are URL-encoded -using the external format EXTERNAL-FORMAT, the pairs are joined with a -#\\& character, and each name is separated from its value with a #\\= -character." +names and values are strings \(or, for values, NIL). This function +returns a string where this list is represented as for the content +type `application/x-www-form-urlencoded', i.e. the values are +URL-encoded using the external format EXTERNAL-FORMAT, the pairs are +joined with a #\\& character, and each name is separated from its +value with a #\\= character. If the value is NIL, no #\\= is used." (with-output-to-string (out) (loop for first = t then nil for (name . value) in alist unless first do (write-char #\& out) - do (format out "~A=~A" + do (format out "~A~:[~;=~A~]" (url-encode name external-format) + value (url-encode value external-format))))) (defun default-port (uri) From bknr at bknr.net Tue Dec 22 22:14:36 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 22 Dec 2009 23:14:36 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/ Message-ID: Revision: 4488 Author: edi URL: http://bknr.net/trac/changeset/4488 Get rid of *within-request-p* U trunk/thirdparty/hunchentoot/doc/index.xml U trunk/thirdparty/hunchentoot/packages.lisp U trunk/thirdparty/hunchentoot/request.lisp U trunk/thirdparty/hunchentoot/specials.lisp Modified: trunk/thirdparty/hunchentoot/doc/index.xml =================================================================== --- trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-14 20:26:57 UTC (rev 4487) +++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-22 22:14:35 UTC (rev 4488) @@ -953,7 +953,7 @@ a function designator for a unary function. In this case, the handler will be returned - by DISPATCH-EASY-HANDLERS , + by DISPATCH-EASY-HANDLERS, if uri is a string and the script name of the current request is uri, or @@ -2897,7 +2897,6 @@ - @@ -2907,6 +2906,7 @@ + This should be a pathname denoting a directory where temporary files can be stored. It is used for file Modified: trunk/thirdparty/hunchentoot/packages.lisp =================================================================== --- trunk/thirdparty/hunchentoot/packages.lisp 2009-12-14 20:26:57 UTC (rev 4487) +++ trunk/thirdparty/hunchentoot/packages.lisp 2009-12-22 22:14:35 UTC (rev 4488) @@ -64,7 +64,6 @@ "*METHODS-FOR-POST-PARAMETERS*" "*REPLY*" "*REQUEST*" - "WITHIN-REQUEST-P" "*REWRITE-FOR-SESSION-URLS*" "*SESSION*" "*SESSION-GC-FREQUENCY*" Modified: trunk/thirdparty/hunchentoot/request.lisp =================================================================== --- trunk/thirdparty/hunchentoot/request.lisp 2009-12-14 20:26:57 UTC (rev 4487) +++ trunk/thirdparty/hunchentoot/request.lisp 2009-12-22 22:14:35 UTC (rev 4488) @@ -224,8 +224,7 @@ (let (*tmp-files* *headers-sent*) (unwind-protect (with-mapped-conditions () - (let* ((*request* request) - (*within-request-p* t)) + (let* ((*request* request)) (multiple-value-bind (body error) (catch 'handler-done (invoke-process-request-with-error-handling @@ -253,7 +252,7 @@ (defun within-request-p () "True if we're in the context of a request, otherwise nil." - *within-request-p*) + (and (boundp '*request*) *request*)) (defun parse-multipart-form-data (request external-format) "Parse the REQUEST body as multipart/form-data, assuming that its Modified: trunk/thirdparty/hunchentoot/specials.lisp =================================================================== --- trunk/thirdparty/hunchentoot/specials.lisp 2009-12-14 20:26:57 UTC (rev 4487) +++ trunk/thirdparty/hunchentoot/specials.lisp 2009-12-22 22:14:35 UTC (rev 4488) @@ -234,11 +234,6 @@ (defvar-unbound *request* "The current REQUEST object while in the context of a request.") -(defvar *within-request-p* nil - "True while in the context of a request (while *request* is bound), -otherwise nil. Outside callers should use exported function -within-request-p to test this.") - (defvar-unbound *reply* "The current REPLY object while in the context of a request.") From bknr at bknr.net Tue Dec 22 22:28:12 2009 From: bknr at bknr.net (BKNR Commits) Date: Tue, 22 Dec 2009 23:28:12 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/ Message-ID: Revision: 4489 Author: edi URL: http://bknr.net/trac/changeset/4489 Revoke commit 4477 U trunk/thirdparty/hunchentoot/doc/index.xml U trunk/thirdparty/hunchentoot/packages.lisp U trunk/thirdparty/hunchentoot/request.lisp Modified: trunk/thirdparty/hunchentoot/doc/index.xml =================================================================== --- trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-22 22:14:35 UTC (rev 4488) +++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-22 22:28:12 UTC (rev 4489) @@ -1594,33 +1594,17 @@ This function is called by PROCESS-CONNECTION -after the incoming headers have been read. It -calls DISPATCH-REQUEST and sends its output to -the client. It also sets up simple error handling for the request -handler. -

    -The return value of this function is ignored. -

    -
    - - - - request - - nil - - -This function is called by PROCESS-REQUEST. It -selects and calls a -
    handler to process the request. -

    -This might be a good place to introduce around methods which bind -special variables or do other interesting things that are relevant to -the particular request. Note -that DISPATCH-REQUEST is called once per -connection and loops in case of a persistent connection, +after the incoming headers have been read. It selects and calls a +handler and sends the output of this handler +to the client. It also sets up simple error handling for the request +handler. Note that PROCESS-CONNECTION is called +once per connection and loops in case of a persistent connection while PROCESS-REQUEST is called anew for each request. +

    +Like PROCESS-CONNECTION, this might be a good +place to introduce around methods which bind special variables or do +other interesting things.

    The return value of this function is ignored. Modified: trunk/thirdparty/hunchentoot/packages.lisp =================================================================== --- trunk/thirdparty/hunchentoot/packages.lisp 2009-12-22 22:14:35 UTC (rev 4488) +++ trunk/thirdparty/hunchentoot/packages.lisp 2009-12-22 22:28:12 UTC (rev 4489) @@ -167,7 +167,6 @@ "DELETE-AUX-REQUEST-VALUE" "DELETE-SESSION-VALUE" "DISPATCH-EASY-HANDLERS" - "DISPATCH-REQUEST" "ESCAPE-FOR-HTML" "EXECUTE-ACCEPTOR" "GET-PARAMETER" Modified: trunk/thirdparty/hunchentoot/request.lisp =================================================================== --- trunk/thirdparty/hunchentoot/request.lisp 2009-12-22 22:14:35 UTC (rev 4488) +++ trunk/thirdparty/hunchentoot/request.lisp 2009-12-22 22:28:12 UTC (rev 4489) @@ -95,22 +95,21 @@ can subclass REQUEST in order to implement your own behaviour. See the REQUEST-CLASS slot of the ACCEPTOR class.")) -(defgeneric dispatch-request (request) - (:documentation "This function is called by PROCESS-REQUEST. It -selects and calls a handler to process the request. - -This might be a good place to introduce around methods which bind -special variables or do other interesting things that are relevant to -the particular request. Note that DISPATCH-REQUEST is called once per -connection and loops in case of a persistent connection, while -PROCESS-REQUEST is called anew for each request.")) - (defgeneric process-request (request) (:documentation "This function is called by PROCESS-CONNECTION after -the incoming headers have been read. It calls DISPATCH-REQUEST and -sends its output to the client. It also sets up simple error handling -for the request handler.")) +the incoming headers have been read. It selects and calls a handler +and sends the output of this handler to the client using START-OUTPUT. +It also sets up simple error handling for the request handler. Note +that PROCESS-CONNECTION is called once per connection and loops in +case of a persistent connection while PROCESS-REQUEST is called anew +for each request. +Like PROCESS-CONNECTION, this might be a good place to introduce +around methods which bind special variables or do other interesting +things. + +The return value of this function is ignored.")) + (defun convert-hack (string external-format) "The rfc2388 package is buggy in that it operates on a character stream and thus only accepts encodings which are 8 bit transparent. @@ -211,12 +210,6 @@ ;; we assume it's not our fault... (setf (return-code*) +http-bad-request+))))) -(defmethod dispatch-request (request) - "Standard implementation of dispatching a request to the appropriate -handler." - (funcall (acceptor-request-dispatcher *acceptor*) - request)) - (defmethod process-request (request) "Standard implementation for processing a request. You should not change or replace this functionality unless you know what you're @@ -233,7 +226,7 @@ ;; skip dispatch if bad request (when (eql (return-code *reply*) +http-ok+) ;; now do the work - (dispatch-request request))))) + (funcall (acceptor-request-dispatcher *acceptor*) *request*))))) (when error (setf (return-code *reply*) +http-internal-server-error+)) From bknr at bknr.net Sun Dec 27 21:10:35 2009 From: bknr at bknr.net (BKNR Commits) Date: Sun, 27 Dec 2009 22:10:35 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/ Message-ID: Revision: 4490 Author: edi URL: http://bknr.net/trac/changeset/4490 Resurrect *catch-errors-p* and more Some documentation still has to be updated U trunk/thirdparty/hunchentoot/CHANGELOG U trunk/thirdparty/hunchentoot/acceptor.lisp U trunk/thirdparty/hunchentoot/conditions.lisp U trunk/thirdparty/hunchentoot/doc/index.xml U trunk/thirdparty/hunchentoot/easy-handlers.lisp U trunk/thirdparty/hunchentoot/headers.lisp D trunk/thirdparty/hunchentoot/hunchentoot-test.asd U trunk/thirdparty/hunchentoot/hunchentoot.asd U trunk/thirdparty/hunchentoot/lispworks.lisp U trunk/thirdparty/hunchentoot/packages.lisp U trunk/thirdparty/hunchentoot/request.lisp U trunk/thirdparty/hunchentoot/specials.lisp U trunk/thirdparty/hunchentoot/taskmaster.lisp U trunk/thirdparty/hunchentoot/url-rewrite/primitives.lisp Change set too large, please see URL above From bknr at bknr.net Sun Dec 27 21:53:14 2009 From: bknr at bknr.net (BKNR Commits) Date: Sun, 27 Dec 2009 22:53:14 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/ Message-ID: Revision: 4491 Author: edi URL: http://bknr.net/trac/changeset/4491 Documentation U trunk/thirdparty/hunchentoot/doc/index.xml U trunk/thirdparty/hunchentoot/request.lisp Modified: trunk/thirdparty/hunchentoot/doc/index.xml =================================================================== --- trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-27 21:10:34 UTC (rev 4490) +++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-27 21:53:14 UTC (rev 4491) @@ -613,18 +613,11 @@ stream object in socket. It reads the request headers, sets up the request and reply objects, and hands over to PROCESS-REQUEST which -selects and calls a handler for the request and sends its reply to the -client. This is done in a loop until the stream has to be closed or -until a connection timeout occurs. - -

    -It is probably not a good idea to re-implement this method until you -really, really know what you're doing, but you can for example write -an around method specialized for your subclass -of ACCEPTOR which binds or rebinds special -variables which can then be accessed by -your handlers. -

    +calls HANDLE-REQUEST to select and call a handler +for the request and sends its reply to the client. This is done in a +loop until the stream has to be closed or until a connection timeout +occurs. It is probably not a good idea to re-implement this method +until you really, really know what you're doing.
    @@ -766,35 +759,41 @@ -The main job of PROCESS-REQUEST is to select and +The main job of HANDLE-REQUEST is to select and call a function which handles the request, i.e. which looks at the data the client has sent and prepares an appropriate reply to send -back. This is implemented as follows: +back. This is by default implemented as follows:

    Each acceptor has a request dispatcher which is a unary function that accepts -a REQUEST object. This function is called by -PROCESS-REQUEST. The idea is that this function -looks at the request object and depending on its contents decides to -call another function which "does the work". This "other" function is -by convention called a request -handler. (Obviously, this is really only a convention as -process-request doesn't "know" what the request dispatcher does. You -could as well say that the request dispatcher and the request handler -have the same job.) +a REQUEST object. This function is called by the +default method of HANDLE-REQUEST. The idea is +that this function looks at the request object and depending on its +contents decides to call another function which "does the work". This +"other" function is by convention called a request handler. (Obviously, this is +really only a convention as HANDLE-REQUEST +doesn't "know" what the request dispatcher does. You could as well +say that the request dispatcher and the request handler have the same +job.)

    -The default behaviour, unless you implement your own request +The default behaviour, unless your acceptor has its own request dispatcher, is that Hunchentoot walks through the list -*dispatch-table* which consists of dispatch functions. Each -of these functions accepts the request object as its only argument and -either returns a request handler to handle the request -or NIL which means that the next dispatcher in the list -will be tried. If all dispatch functions return NIL, the -return code +*DISPATCH-TABLE* which consists of dispatch +functions. Each of these functions accepts the request object as +its only argument and either returns a request handler to handle the +request or NIL which means that the next dispatcher in +the list will be tried. If all dispatch functions +return NIL, the return code +HTTP-NOT-FOUND+ will be sent to the client.

    +The default method of HANDLE-REQUEST also sets up +standard error handling before it calls the acceptor's request +dispatcher. +

    +

    All functions and variables in this section are related to the standard request dispatch mechanism described above and are meaningless if you're using your own request dispatcher. @@ -1570,24 +1569,48 @@ This function is called by PROCESS-CONNECTION -after the incoming headers have been read. It selects and calls a -handler and sends the output of this handler -to the client. It also sets up simple error handling for the request -handler. Note that PROCESS-CONNECTION is called -once per connection and loops in case of a persistent connection -while PROCESS-REQUEST is called anew for each -request. +after the incoming headers have been read. It +calls HANDLE-REQUEST (and is more or less just a +thin wrapper around it) to select and call a +handler and send the output of this handler to +the client. Note that PROCESS-CONNECTION is +called once per connection and loops in case of a persistent +connection while PROCESS-REQUEST is called anew +for each request.

    -Like PROCESS-CONNECTION, this might be a good -place to introduce around methods which bind special variables or do -other interesting things. +The return value of this function is ignored.

    -The return value of this function is ignored. +Like PROCESS-CONNECTION, this is another function +the behaviour of which you should only modify if you really, really +know what you're doing.

    + + acceptor request + + content + + +This function is called by PROCESS-REQUEST once +the request has been read and a REQUEST object +has been created. Its job is to actually handle the request, i.e. to +return something to the client. +

    +The default method calls the +acceptor's request dispatcher, but you +can of course implement a different behaviour. The default method +also sets up standard error handling for +the handler. +

    +

    +Might be a good place to bind or rebind special variables which can +then be accessed by your handlers. +

    +
    +
    Modified: trunk/thirdparty/hunchentoot/request.lisp =================================================================== --- trunk/thirdparty/hunchentoot/request.lisp 2009-12-27 21:10:34 UTC (rev 4490) +++ trunk/thirdparty/hunchentoot/request.lisp 2009-12-27 21:53:14 UTC (rev 4491) @@ -97,16 +97,14 @@ (defgeneric process-request (request) (:documentation "This function is called by PROCESS-CONNECTION after -the incoming headers have been read. It selects and calls a handler -and sends the output of this handler to the client using START-OUTPUT. -It also sets up simple error handling for the request handler. Note -that PROCESS-CONNECTION is called once per connection and loops in -case of a persistent connection while PROCESS-REQUEST is called anew -for each request. +the incoming headers have been read. It calls HANDLE-REQUEST to +select and call a handler and sends the output of this handler to the +client using START-OUTPUT. Note that PROCESS-CONNECTION is called +once per connection and loops in case of a persistent connection while +PROCESS-REQUEST is called anew for each request. -Like PROCESS-CONNECTION, this might be a good place to introduce -around methods which bind special variables or do other interesting -things. +Essentially, you can view process-request as a thin wrapper around +HANDLE-REQUEST. The return value of this function is ignored.")) From bknr at bknr.net Sun Dec 27 23:12:40 2009 From: bknr at bknr.net (BKNR Commits) Date: Mon, 28 Dec 2009 00:12:40 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/ Message-ID: Revision: 4492 Author: edi URL: http://bknr.net/trac/changeset/4492 Backtraces U trunk/thirdparty/hunchentoot/CHANGELOG U trunk/thirdparty/hunchentoot/acceptor.lisp U trunk/thirdparty/hunchentoot/conditions.lisp U trunk/thirdparty/hunchentoot/doc/index.xml U trunk/thirdparty/hunchentoot/hunchentoot.asd U trunk/thirdparty/hunchentoot/packages.lisp U trunk/thirdparty/hunchentoot/specials.lisp U trunk/thirdparty/hunchentoot/util.lisp Modified: trunk/thirdparty/hunchentoot/CHANGELOG =================================================================== --- trunk/thirdparty/hunchentoot/CHANGELOG 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/CHANGELOG 2009-12-27 23:12:39 UTC (rev 4492) @@ -1,5 +1,6 @@ Architectural changes - see HANDLE-REQUEST (thanks to Andreas Fuchs and Frode Fjeld) Re-introduced *CATCH-ERRORS-P* and MAYBE-INVOKE-DEBUGGER +Integration with trivial-backtrace (see *LOG-LISP-BACKTRACES-P*) Treat :UNSPECIFIC like NIL in pathname components (reported by Frode Fjeld) Prepare for LispWorks 6 (Nico de Jager) Fix reading of post parameters (Peter Seibel) Modified: trunk/thirdparty/hunchentoot/acceptor.lisp =================================================================== --- trunk/thirdparty/hunchentoot/acceptor.lisp 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/acceptor.lisp 2009-12-27 23:12:39 UTC (rev 4492) @@ -437,7 +437,10 @@ (handler-bind ((error (lambda (cond) (when *log-lisp-errors-p* - (log-message *lisp-errors-log-level* "~A" cond)) + (log-message *lisp-errors-log-level* + "~A~:[~*~;~%~:*~A~]" + cond + (and *log-lisp-backtraces-p* (get-backtrace)))) ;; if the headers were already sent, the error ;; happened within the body and we have to close ;; the stream @@ -449,4 +452,5 @@ (lambda (cond) (when *log-lisp-warnings-p* (log-message *lisp-warnings-log-level* "~A" cond))))) - (funcall (acceptor-request-dispatcher *acceptor*) *request*))) \ No newline at end of file + (with-debugger + (funcall (acceptor-request-dispatcher *acceptor*) *request*)))) Modified: trunk/thirdparty/hunchentoot/conditions.lisp =================================================================== --- trunk/thirdparty/hunchentoot/conditions.lisp 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/conditions.lisp 2009-12-27 23:12:39 UTC (rev 4492) @@ -113,4 +113,13 @@ (defmacro handler-case* (expression &rest clauses) "Like HANDLER-CASE, but observes *CATCH-ERRORS-P*." `(handler-case (with-debugger ,expression) - , at clauses)) \ No newline at end of file + , at clauses)) + +(defun get-backtrace () + "Returns a string with a backtrace of what the Lisp system thinks is +the \"current\" error." + (handler-case + (with-output-to-string (s) + (trivial-backtrace:print-backtrace-to-stream s)) + (error (condition) + (format nil "Could not generate backtrace: ~A." condition)))) Modified: trunk/thirdparty/hunchentoot/doc/index.xml =================================================================== --- trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-27 23:12:39 UTC (rev 4492) @@ -85,6 +85,7 @@
  • Kevin Rosenberg's CL-BASE64,
  • Janis Dzerins' RFC2388,
  • Peter Seibel's CL-FAD,
  • +
  • Gary King's trivial-backtrace,
  • Erik Huelsmann's usocket (unless you're using LispWorks),
  • Greg Pfeil's Bordeaux Threads (unless you're using LispWorks), @@ -2588,6 +2589,13 @@ + + Whether Lisp backtraces should be logged. Only + has an effect if *LOG-LISP-ERRORS-P* is true + as well. + + + Whether Lisp warnings in request handlers should be logged. Modified: trunk/thirdparty/hunchentoot/hunchentoot.asd =================================================================== --- trunk/thirdparty/hunchentoot/hunchentoot.asd 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/hunchentoot.asd 2009-12-27 23:12:39 UTC (rev 4492) @@ -51,6 +51,7 @@ #-(or :lispworks :hunchentoot-no-ssl) :cl+ssl :md5 :rfc2388 + :trivial-backtrace #-:lispworks :usocket #-:lispworks :bordeaux-threads) :components ((:module url-rewrite Modified: trunk/thirdparty/hunchentoot/packages.lisp =================================================================== --- trunk/thirdparty/hunchentoot/packages.lisp 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/packages.lisp 2009-12-27 23:12:39 UTC (rev 4492) @@ -59,6 +59,7 @@ "*LISP-ERRORS-LOG-LEVEL*" "*LISP-WARNINGS-LOG-LEVEL*" "*LISTENER*" + "*LOG-LISP-BACKTRACES-P*" "*LOG-LISP-ERRORS-P*" "*LOG-LISP-WARNINGS-P*" "*MESSAGE-LOG-PATHNAME*" @@ -71,6 +72,7 @@ "*SESSION-MAX-TIME*" "*SESSION-REMOVAL-HOOK*" "*SESSION-SECRET*" + "*SHOW-LISP-BACKTRACES-P*" "*SHOW-LISP-ERRORS-P*" "*TMP-DIRECTORY*" "*USE-REMOTE-ADDR-FOR-SESSIONS*" Modified: trunk/thirdparty/hunchentoot/specials.lisp =================================================================== --- trunk/thirdparty/hunchentoot/specials.lisp 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/specials.lisp 2009-12-27 23:12:39 UTC (rev 4492) @@ -199,6 +199,10 @@ (defvar *log-lisp-errors-p* t "Whether Lisp errors in request handlers should be logged.") +(defvar *log-lisp-backtraces-p* t + "Whether Lisp backtraces should be logged. Only has an effect if +*LOG-LISP-ERRORS-P* is true as well.") + (defvar *log-lisp-warnings-p* t "Whether Lisp warnings in request handlers should be logged.") Modified: trunk/thirdparty/hunchentoot/util.lisp =================================================================== --- trunk/thirdparty/hunchentoot/util.lisp 2009-12-27 21:53:14 UTC (rev 4491) +++ trunk/thirdparty/hunchentoot/util.lisp 2009-12-27 23:12:39 UTC (rev 4492) @@ -327,4 +327,4 @@ `(progn , at body) #-:lispworks `(usocket:with-mapped-conditions () - , at body)) \ No newline at end of file + , at body)) From bknr at bknr.net Sun Dec 27 23:14:59 2009 From: bknr at bknr.net (BKNR Commits) Date: Mon, 28 Dec 2009 00:14:59 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/CHANGELOG Message-ID: Revision: 4493 Author: edi URL: http://bknr.net/trac/changeset/4493 Missing changelog entry U trunk/thirdparty/hunchentoot/CHANGELOG Modified: trunk/thirdparty/hunchentoot/CHANGELOG =================================================================== --- trunk/thirdparty/hunchentoot/CHANGELOG 2009-12-27 23:12:39 UTC (rev 4492) +++ trunk/thirdparty/hunchentoot/CHANGELOG 2009-12-27 23:14:59 UTC (rev 4493) @@ -3,7 +3,7 @@ Integration with trivial-backtrace (see *LOG-LISP-BACKTRACES-P*) Treat :UNSPECIFIC like NIL in pathname components (reported by Frode Fjeld) Prepare for LispWorks 6 (Nico de Jager) -Fix reading of post parameters (Peter Seibel) +Fix reading of post parameters (Peter Seibel and Stephen P. Compall) Fix STOP by supplying the :READY-ONLY keyword to USOCKET:WAIT-FOR-INPUT Enable SSL key passwords for Lisps other than LW (Vsevolod) From bknr at bknr.net Mon Dec 28 16:40:27 2009 From: bknr at bknr.net (BKNR Commits) Date: Mon, 28 Dec 2009 17:40:27 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/ Message-ID: Revision: 4494 Author: edi URL: http://bknr.net/trac/changeset/4494 Fix reset-sessions U trunk/thirdparty/hunchentoot/doc/index.xml U trunk/thirdparty/hunchentoot/session.lisp Modified: trunk/thirdparty/hunchentoot/doc/index.xml =================================================================== --- trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-27 23:14:59 UTC (rev 4493) +++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-12-28 16:40:26 UTC (rev 4494) @@ -2134,10 +2134,15 @@ + optional + acceptor | - Removes all stored sessions. + Removes all stored sessions + of acceptor. The default + for acceptor + is *ACCEPTOR*. Modified: trunk/thirdparty/hunchentoot/session.lisp =================================================================== --- trunk/thirdparty/hunchentoot/session.lisp 2009-12-27 23:14:59 UTC (rev 4493) +++ trunk/thirdparty/hunchentoot/session.lisp 2009-12-28 16:40:26 UTC (rev 4494) @@ -353,10 +353,10 @@ cease to be valid." (setq *session-secret* (create-random-string 10 36))) -(defun reset-sessions () - "Removes ALL stored sessions." - (with-session-lock-held ((session-db-lock *acceptor*)) - (loop for (nil . session) in (session-db *acceptor*) +(defun reset-sessions (&optional (acceptor *acceptor*)) + "Removes ALL stored sessions of ACCEPTOR." + (with-session-lock-held ((session-db-lock acceptor)) + (loop for (nil . session) in (session-db acceptor) do (funcall *session-removal-hook* session)) (setq *session-db* nil)) (values)) \ No newline at end of file From bknr at bknr.net Mon Dec 28 16:41:17 2009 From: bknr at bknr.net (BKNR Commits) Date: Mon, 28 Dec 2009 17:41:17 +0100 Subject: [bknr-cvs] edi changed trunk/thirdparty/hunchentoot/CHANGELOG Message-ID: Revision: 4495 Author: edi URL: http://bknr.net/trac/changeset/4495 changelog U trunk/thirdparty/hunchentoot/CHANGELOG Modified: trunk/thirdparty/hunchentoot/CHANGELOG =================================================================== --- trunk/thirdparty/hunchentoot/CHANGELOG 2009-12-28 16:40:26 UTC (rev 4494) +++ trunk/thirdparty/hunchentoot/CHANGELOG 2009-12-28 16:41:17 UTC (rev 4495) @@ -2,10 +2,11 @@ Re-introduced *CATCH-ERRORS-P* and MAYBE-INVOKE-DEBUGGER Integration with trivial-backtrace (see *LOG-LISP-BACKTRACES-P*) Treat :UNSPECIFIC like NIL in pathname components (reported by Frode Fjeld) -Prepare for LispWorks 6 (Nico de Jager) -Fix reading of post parameters (Peter Seibel and Stephen P. Compall) -Fix STOP by supplying the :READY-ONLY keyword to USOCKET:WAIT-FOR-INPUT -Enable SSL key passwords for Lisps other than LW (Vsevolod) +Fixed RESET-SESSIONS +Prepared for LispWorks 6 (Nico de Jager) +Fixed reading of post parameters (Peter Seibel and Stephen P. Compall) +Fixed STOP by supplying the :READY-ONLY keyword to USOCKET:WAIT-FOR-INPUT +Enabled SSL key passwords for Lisps other than LW (Vsevolod) Version 1.0.0 2009-02-19