Changes to get things working with latest factor updates. Post requests
are currently broken.cvs
parent
7e86800c9f
commit
00c2d5f058
|
|
@ -32,7 +32,7 @@ USE: stack
|
||||||
USE: stdio
|
USE: stdio
|
||||||
USE: combinators
|
USE: combinators
|
||||||
USE: namespaces
|
USE: namespaces
|
||||||
USE: vocabularies
|
USE: words
|
||||||
USE: lists
|
USE: lists
|
||||||
USE: streams
|
USE: streams
|
||||||
USE: strings
|
USE: strings
|
||||||
|
|
|
||||||
|
|
@ -116,8 +116,8 @@ USE: unparser
|
||||||
drop ;
|
drop ;
|
||||||
|
|
||||||
! Install the examples
|
! Install the examples
|
||||||
"counter1" [ drop 0 counter-example ] install-cont-responder
|
"counter1" [ drop 0 counter-example ] install-cont-responder
|
||||||
"counter2" [ drop counter-example2 ] install-cont-responder
|
"counter2" [ drop counter-example2 ] install-cont-responder
|
||||||
"test1" [ drop test-cont-responder ] install-cont-responder
|
"test1" [ drop test-cont-responder ] install-cont-responder
|
||||||
"test2" [ drop test-cont-responder2 ] install-cont-responder
|
"test2" [ drop test-cont-responder2 ] install-cont-responder
|
||||||
"test3" [ drop test-cont-responder3 ] install-cont-responder
|
"test3" [ drop test-cont-responder3 ] install-cont-responder
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ USE: combinators
|
||||||
USE: stdio
|
USE: stdio
|
||||||
USE: namespaces
|
USE: namespaces
|
||||||
USE: words
|
USE: words
|
||||||
USE: vocabularies
|
|
||||||
USE: logic
|
USE: logic
|
||||||
|
|
||||||
! These words in cont-html are used to provide a means of writing
|
! These words in cont-html are used to provide a means of writing
|
||||||
|
|
|
||||||
|
|
@ -234,8 +234,10 @@ DEFER: show
|
||||||
call-exit-continuation
|
call-exit-continuation
|
||||||
] callcc1
|
] callcc1
|
||||||
nip ;
|
nip ;
|
||||||
|
USE: prettyprint
|
||||||
|
USE: inspector
|
||||||
|
|
||||||
: cont-get-responder ( id -- )
|
: cont-get-responder ( id-or-f -- )
|
||||||
#! httpd responder that retrieves a continuation and calls it.
|
#! httpd responder that retrieves a continuation and calls it.
|
||||||
dup f-or-"" [
|
dup f-or-"" [
|
||||||
#! No continuation id given
|
#! No continuation id given
|
||||||
|
|
@ -250,7 +252,7 @@ DEFER: show
|
||||||
#! Use the given continuation
|
#! Use the given continuation
|
||||||
[ f swap resume-continuation ] with-exit-continuation
|
[ f swap resume-continuation ] with-exit-continuation
|
||||||
] ifte
|
] ifte
|
||||||
[ print ] when* drop ;
|
[ write flush ] when* drop ;
|
||||||
|
|
||||||
: post-request>alist ( post-request -- alist )
|
: post-request>alist ( post-request -- alist )
|
||||||
#! Return an alist containing name/value pairs from the
|
#! Return an alist containing name/value pairs from the
|
||||||
|
|
@ -313,17 +315,21 @@ DEFER: show
|
||||||
#! Install a cont-responder with the given name
|
#! Install a cont-responder with the given name
|
||||||
#! that will initially run the given quotation.
|
#! that will initially run the given quotation.
|
||||||
#!
|
#!
|
||||||
#! Convert the quotation os it is run within a session namespace
|
#! Convert the quotation so it is run within a session namespace
|
||||||
#! and that namespace is initialized first.
|
#! and that namespace is initialized first.
|
||||||
[ init-session-namespace ] swap append unit [ with-new-session ] append
|
[ init-session-namespace ] swap append unit [ with-new-session ] append
|
||||||
"httpd-responders" get [
|
"httpd-responders" get [
|
||||||
<responder> [
|
<responder> [
|
||||||
[ cont-get-responder ] "get" set
|
[ cont-get-responder ] "get" set
|
||||||
[ cont-post-responder ] "post" set
|
[ cont-post-responder ] "post" set
|
||||||
|
over "responder-name" set
|
||||||
|
over "responder" set
|
||||||
reset-continuation-table
|
reset-continuation-table
|
||||||
"disable-initial-redirect?" t put
|
"disable-initial-redirect?" t put
|
||||||
|
] extend dup >r rot set
|
||||||
|
r> [
|
||||||
f swap register-continuation "root-continuation" set
|
f swap register-continuation "root-continuation" set
|
||||||
dup "responder-name" set
|
] bind
|
||||||
] extend put
|
|
||||||
] bind ;
|
] bind ;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ USE: logic
|
||||||
USE: combinators
|
USE: combinators
|
||||||
USE: live-updater
|
USE: live-updater
|
||||||
USE: prettyprint
|
USE: prettyprint
|
||||||
USE: vocabularies
|
USE: words
|
||||||
|
|
||||||
: <evaluator> ( stack msg history -- )
|
: <evaluator> ( stack msg history -- )
|
||||||
#! Create an 'evaluator' object that holds
|
#! Create an 'evaluator' object that holds
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ USE: live-updater
|
||||||
USE: namespaces
|
USE: namespaces
|
||||||
USE: cont-html
|
USE: cont-html
|
||||||
USE: html
|
USE: html
|
||||||
USE: vocabularies
|
USE: words
|
||||||
USE: stdio
|
USE: stdio
|
||||||
USE: stack
|
USE: stack
|
||||||
USE: kernel
|
USE: kernel
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue