Index: stml2.scm ================================================================== --- stml2.scm +++ stml2.scm @@ -959,12 +959,12 @@ ;; (define-class () ;; (form-data ;; )) (define (make-formdat:formdat)(vector (make-hash-table))) -(define-inline (formdat:formdat-get-data vec) (vector-ref vec 0)) -(define-inline (formdat:formdat-set-data! vec val)(vector-set! vec 0 val)) +(define (formdat:formdat-get-data vec) (vector-ref vec 0)) +(define (formdat:formdat-set-data! vec val)(vector-set! vec 0 val)) (define (formdat:initialize self) (formdat:formdat-set-data! self (make-hash-table))) (define (formdat:get self key) @@ -1095,11 +1095,12 @@ ;; returns a hash with entries for all forms - could well use a proplist? (define (formdat:load-all) (let ((request-method (get-environment-variable "REQUEST_METHOD"))) (if (and request-method (string=? request-method "POST")) - (formdat:load-all-port (current-input-port))))) + (formdat:load-all-port (current-input-port)) + (make-formdat:formdat)))) ;; (s:process-cgi-input (caaar dat)) (define (formdat:load-all-port inp) (let* ((formdat (make-formdat:formdat)) (debugp #f)) @@ -1147,10 +1148,11 @@ (not (null? (car alldats))) (not (null? (caar alldats)))) (formdat:load formdat (s:process-cgi-input (caaar alldats))))) ;; munged)) ;; (format debugp "formdat : name: ~A content: ~A\n" name content) (if debugp (close-output-port debugp)) + ;; (sdat-formdat-set! s:session formdat) formdat)))) #| (define inp (open-input-file "tests/example.post.in")) (define dat (read-string #f inp)) @@ -2083,11 +2085,11 @@ (close-input-port fp) initargs)))) ;; call the controller if it exists ;; -;; WARNING - this code needs a defence agains recursive calling!!!!! +;; WARNING - this code needs a defense agains recursive calling!!!!! ;; ;; I suggest a limit of 100 calls. Plenty for allowing multiple instances ;; of a page inside another page. ;; ;; parts = 'both | 'control | 'view @@ -2314,11 +2316,13 @@ '() (cdr params))) (formdat (sdat-formdat self)) (res (if (not formdat) #f (if (or (string? key)(number? key)(symbol? key)) - (if (and (vector? formdat)(eq? (vector-length formdat) 1)(hash-table? (vector-ref formdat 0))) + (if (and (vector? formdat) + (eq? (vector-length formdat) 1) + (hash-table? (vector-ref formdat 0))) (formdat:get formdat key) (begin (session:log self "ERROR: formdat: " formdat " is not of class ") #f)) (begin