Fix http server

db4
Slava Pestov 2008-02-01 22:47:01 -06:00
parent e7ec34050b
commit 2d381ed84e
3 changed files with 7 additions and 7 deletions

View File

@ -25,7 +25,7 @@ M: template-lexer skip-word
{
{ [ 2dup nth CHAR: " = ] [ drop 1+ ] }
{ [ 2dup swap tail-slice "%>" head? ] [ drop 2 + ] }
{ [ t ] [ [ blank? ] skip ] }
{ [ t ] [ f skip ] }
} cond
] change-column ;

View File

@ -29,7 +29,7 @@ SYMBOL: log-stream
: with-log-file ( file quot -- )
>r <file-appender> r>
[ with-log-stream ] with-disposal ; inline
[ with-log-stream ] curry with-disposal ; inline
: with-log-stdio ( quot -- )
stdio get swap with-log-stream ;
@ -47,11 +47,11 @@ SYMBOL: log-stream
dup log-client
[ swap with-stream ] 2curry concurrency:spawn drop ; inline
: accept-loop ( server quot -- server quot )
: accept-loop ( server quot -- )
[ swap accept with-client ] 2keep accept-loop ; inline
: server-loop ( server quot -- )
[ accept-loop ] compose with-disposal ; inline
[ accept-loop ] curry with-disposal ; inline
: spawn-server ( addrspec quot -- )
"Waiting for connections on " pick unparse append

View File

@ -1,8 +1,8 @@
! Copyright (C) 2007 Slava Pestov.
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: namespaces kernel assocs io.files combinators
arrays io.launcher io http.server.responders webapps.file
sequences strings math.parser ;
sequences strings math.parser unicode.case ;
IN: webapps.cgi
SYMBOL: cgi-root
@ -31,7 +31,7 @@ SYMBOL: cgi-root
"method" get >upper "REQUEST_METHOD" set
"raw-query" get "QUERY_STRING" set
"Cookie" header-param "HTTP_COOKIE" set
"Cookie" header-param "HTTP_COOKIE" set
"User-Agent" header-param "HTTP_USER_AGENT" set
"Accept" header-param "HTTP_ACCEPT" set