[bknr-cvs] edi changed trunk/thirdparty/chunga/

BKNR Commits bknr at bknr.net
Wed May 19 15:37:07 UTC 2010


Revision: 4540
Author: edi
URL: http://bknr.net/trac/changeset/4540

Quoted cookie values

U   trunk/thirdparty/chunga/CHANGELOG.txt
U   trunk/thirdparty/chunga/read.lisp

Modified: trunk/thirdparty/chunga/CHANGELOG.txt
===================================================================
--- trunk/thirdparty/chunga/CHANGELOG.txt	2010-05-19 15:31:48 UTC (rev 4539)
+++ trunk/thirdparty/chunga/CHANGELOG.txt	2010-05-19 15:37:07 UTC (rev 4540)
@@ -1,3 +1,5 @@
+Read quoted cookie values (Red Daly)
+
 Version 1.1.0
 2009-12-01
 Exported TOKEN-CHAR-P

Modified: trunk/thirdparty/chunga/read.lisp
===================================================================
--- trunk/thirdparty/chunga/read.lisp	2010-05-19 15:31:48 UTC (rev 4539)
+++ trunk/thirdparty/chunga/read.lisp	2010-05-19 15:37:07 UTC (rev 4540)
@@ -246,12 +246,16 @@
 (defun read-cookie-value (stream &key (separators ";"))
   "Reads a cookie parameter value from STREAM which is returned as a
 string.  Simply reads until a semicolon is seen \(or an element of
-SEPARATORS)."
-  (trim-whitespace
-   (with-output-to-string (out)
-     (loop for char = (peek-char* stream nil)
-           until (or (null char) (find char separators :test #'char=))
-           do (write-char (read-char* stream) out)))))
+SEPARATORS).  Also reads quoted strings if the first non-whitespace
+character is a quotation mark \(as in RFC 2109) at
+http://www.w3.org/Protocols/rfc2109/rfc2109"
+  (if (char= #\" (peek-char* stream))
+      (read-quoted-string stream)
+      (trim-whitespace
+       (with-output-to-string (out)
+         (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)
   "Reads a typical \(in RFC 2616) name/value or attribute/value





More information about the Bknr-cvs mailing list