43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
;; <http://www.netscape.com/newsref/std/cookie_spec.html>
(declare (unit cookie))
(require-extension srfi-1 srfi-13 srfi-14 regex)
;; (use srfi-1 srfi-13 srfi-14 regex)
;; (declare (export parse-cookie-string construct-cookie-string))
;; #>
;; #include <time.h>
;; <#
;;
;; (define fmt-time
;; (foreign-lambda* c-string ((long secs_since_epoch))
;; "static char buf[256];"
;; "time_t t = (time_t) secs_since_epoch;"
;; "strftime(buf, sizeof(buf), \"%a, %d-%b-%Y %H:%M:%S GMT\", gmtime(&t));"
;; "return(buf);"))
;;
(define (fmt-time seconds)
(time->string (seconds->utc-time seconds) "%D"))
;; utility fn. breaks ``attr=value;attr=value ... '' into alist.
;; version is a cookie version. if version>0, we allow comma as the
;; delimiter as well as semicolon.
(define (parse-av-pairs input version)
(define attr-regexp
(if (= version 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
;; <http://www.netscape.com/newsref/std/cookie_spec.html>
(declare (unit cookie))
(require-extension srfi-1 srfi-13 srfi-14 regex)
;; (use srfi-1 srfi-13 srfi-14 regex)
;; (declare (export parse-cookie-string construct-cookie-string))
#>
#include <time.h>
<#
(define fmt-time
(foreign-lambda* c-string ((long secs_since_epoch))
"static char buf[256];"
"time_t t = (time_t) secs_since_epoch;"
"strftime(buf, sizeof(buf), \"%a, %d-%b-%Y %H:%M:%S GMT\", gmtime(&t));"
"return(buf);"))
;; (define (fmt-time seconds)
;; (time->string (seconds->utc-time seconds) "%D"))
;; utility fn. breaks ``attr=value;attr=value ... '' into alist.
;; version is a cookie version. if version>0, we allow comma as the
;; delimiter as well as semicolon.
(define (parse-av-pairs input version)
(define attr-regexp
(if (= version 0)
|