Changes to get things working with latest factor updates. Post requests

are currently broken.
cvs
Chris Double 2004-08-19 22:04:10 +00:00
parent 7e86800c9f
commit 00c2d5f058
6 changed files with 20 additions and 15 deletions

View File

@ -32,7 +32,7 @@ USE: stack
USE: stdio
USE: combinators
USE: namespaces
USE: vocabularies
USE: words
USE: lists
USE: streams
USE: strings

View File

@ -116,8 +116,8 @@ USE: unparser
drop ;
! Install the examples
"counter1" [ drop 0 counter-example ] install-cont-responder
"counter2" [ drop counter-example2 ] install-cont-responder
"test1" [ drop test-cont-responder ] install-cont-responder
"test2" [ drop test-cont-responder2 ] install-cont-responder
"test3" [ drop test-cont-responder3 ] install-cont-responder
"counter1" [ drop 0 counter-example ] install-cont-responder
"counter2" [ drop counter-example2 ] install-cont-responder
"test1" [ drop test-cont-responder ] install-cont-responder
"test2" [ drop test-cont-responder2 ] install-cont-responder
"test3" [ drop test-cont-responder3 ] install-cont-responder

View File

@ -31,7 +31,6 @@ USE: combinators
USE: stdio
USE: namespaces
USE: words
USE: vocabularies
USE: logic
! These words in cont-html are used to provide a means of writing

View File

@ -234,8 +234,10 @@ DEFER: show
call-exit-continuation
] callcc1
nip ;
USE: prettyprint
USE: inspector
: cont-get-responder ( id -- )
: cont-get-responder ( id-or-f -- )
#! httpd responder that retrieves a continuation and calls it.
dup f-or-"" [
#! No continuation id given
@ -250,7 +252,7 @@ DEFER: show
#! Use the given continuation
[ f swap resume-continuation ] with-exit-continuation
] ifte
[ print ] when* drop ;
[ write flush ] when* drop ;
: post-request>alist ( post-request -- alist )
#! Return an alist containing name/value pairs from the
@ -313,17 +315,21 @@ DEFER: show
#! Install a cont-responder with the given name
#! 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.
[ init-session-namespace ] swap append unit [ with-new-session ] append
"httpd-responders" get [
<responder> [
[ cont-get-responder ] "get" set
[ cont-post-responder ] "post" set
over "responder-name" set
over "responder" set
reset-continuation-table
"disable-initial-redirect?" t put
] extend dup >r rot set
r> [
f swap register-continuation "root-continuation" set
dup "responder-name" set
] extend put
] bind
] bind ;

View File

@ -40,7 +40,7 @@ USE: logic
USE: combinators
USE: live-updater
USE: prettyprint
USE: vocabularies
USE: words
: <evaluator> ( stack msg history -- )
#! Create an 'evaluator' object that holds

View File

@ -29,7 +29,7 @@ USE: live-updater
USE: namespaces
USE: cont-html
USE: html
USE: vocabularies
USE: words
USE: stdio
USE: stack
USE: kernel