rename FORM-QUERY of surflets to FORM-QUERY-LIST
to avoid name puzzlement with the simple-surflet-api that already exports this name (and we cannot change this, as this is adapted to PLT)
This commit is contained in:
parent
4af92bc379
commit
31f0044e2c
|
@ -78,7 +78,7 @@
|
|||
send-html/finish
|
||||
send-html
|
||||
|
||||
form-query
|
||||
form-query-list
|
||||
get-bindings
|
||||
extract-bindings
|
||||
extract-single-binding
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
;;; (("button" . "on") ("reply" . "Oh, yes"))
|
||||
;;; This works only for GET and POST methods.
|
||||
|
||||
(define (form-query q)
|
||||
(define (form-query-list q)
|
||||
(if q
|
||||
(parse-html-form-query q)
|
||||
'()))
|
||||
|
@ -49,13 +49,15 @@
|
|||
(let ((request-method (surflet-request-method surflet-request)))
|
||||
(cond
|
||||
((string=? request-method "GET")
|
||||
(form-query (http-url-search (surflet-request-url surflet-request))))
|
||||
(form-query-list (http-url-search
|
||||
(surflet-request-url surflet-request))))
|
||||
((string=? request-method "POST")
|
||||
(or (cached-bindings surflet-request)
|
||||
(let* ((content-length (get-content-length (surflet-request-headers surflet-request)))
|
||||
(let* ((content-length (get-content-length
|
||||
(surflet-request-headers surflet-request)))
|
||||
(input-port (surflet-request-input-port surflet-request))
|
||||
(form-data (read-string content-length input-port)))
|
||||
(let ((form-bindings (form-query form-data)))
|
||||
(let ((form-bindings (form-query-list form-data)))
|
||||
(obtain-lock *cache-lock*)
|
||||
(set! *POST-bindings-cache* (cons (cons (make-weak-pointer surflet-request)
|
||||
form-bindings)
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
(hr)
|
||||
(p (URL "/" "Return to main menu") (br)
|
||||
(URL "add-html.scm" "Start new calculation."))))))))
|
||||
(let* ((bindings (form-query
|
||||
(let* ((bindings (form-query-list
|
||||
(http-url-search (surflet-request-url result))))
|
||||
(number (string->number
|
||||
(extract-single-binding "number" bindings))))
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
,(make-submit-button))
|
||||
(hr)
|
||||
(p (URL "/" "Return to main menu.")))))))
|
||||
(bindings (form-query (http-url-search (surflet-request-url req)))))
|
||||
(bindings (get-bindings req)))
|
||||
(input-field-value byte-input-fields bindings)))
|
||||
|
||||
(define (main req)
|
||||
|
|
Loading…
Reference in New Issue