Overview
Comment:Moved back to built in date calc instead of unix calls, test fix (doesn't work)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0c8348626c0aa5f42b57d8dad5e394d23a15c8e
User & Date: matt on 2012-08-04 03:48:19
Other Links: manifest | tags
Context
2012-08-04
18:56
Improved message for broken stml check-in: 8f51206e58 user: matt tags: trunk
03:48
Moved back to built in date calc instead of unix calls, test fix (doesn't work) check-in: b0c8348626 user: matt tags: trunk
2012-08-02
21:26
Initial cleared out version of the manual. check-in: e1712c7156 user: matt tags: trunk
Changes

Modified cookie.scm from [bf01624c2b] to [49ca0d00a6].

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
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);"))
;; #>
;; #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"))
(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)

Modified session.scm from [c951925aba] to [bc08001dad].

323
324
325
326
327
328
329


330
331
332
333
334
335
336




337
338
339

340

341
342
343
344
345
346
347
323
324
325
326
327
328
329
330
331
332
333
334




335
336
337
338
339
340
341
342

343
344
345
346
347
348
349
350







+
+



-
-
-
-
+
+
+
+



+
-
+







    (dbi:for-each-row (lambda (tuple)
			(set! result (vector-ref tuple 0))) ;; (vector-ref tuple 0)))
		      (sdat-get-conn self)
		      (s:sqlparam query session-key))
    result))

;; delete all records for a session
;; 
;; NEEDS TO BE TRANSACTIONIZED!
;;
(define (session:delete-session self session-key)
  (let ((session-id (session:get-session-id self session-key))
        (qry        (conc "BEGIN;"
			  "DELETE FROM session_vars WHERE session_id=?;"
                          "DELETE FROM sessions WHERE id=?;"
			  "COMMIT;"))
        (qry1        ;; (conc "BEGIN;"
			  "DELETE FROM session_vars WHERE session_id=?;")
	(qry2             "DELETE FROM sessions WHERE id=?;")
		     ;;  "COMMIT;"))
        (conn              (sdat-get-conn self)))
    (if session-id
        (begin
          (dbi:exec conn qry1 session-id) ;; session-id)
          (dbi:exec conn qry session-id session-id)
	  (dbi:exec conn qry2 session-id)
	  (session:initialize self)
	  (session:setup self)))
    (not (session:get-session-id self session-key))))

;; (define (session:delete-session self session-key)
;;   (let ((session-id (session:get-session-id self session-key))
;;         (queries    (list "BEGIN;"