Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2008-09-28 18:18:40 -05:00
commit ef1e4d5aa0
9 changed files with 15 additions and 23 deletions

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays combinators html.elements io USING: accessors arrays combinators html.elements io
io.streams.string kernel math memoize namespaces peg peg.ebnf io.streams.string kernel math memoize namespaces peg peg.ebnf
prettyprint sequences sequences.deep strings xml.entities sequences sequences.deep strings xml.entities
vectors splitting xmode.code2html urls ; vectors splitting xmode.code2html urls ;
IN: farkup IN: farkup

View File

@ -42,7 +42,7 @@ IN: furnace.chloe-tags
: compile-a-url ( tag -- ) : compile-a-url ( tag -- )
{ {
[ "href" required-attr compile-attr ] [ "href" optional-attr compile-attr ]
[ "rest" optional-attr compile-attr ] [ "rest" optional-attr compile-attr ]
[ "query" optional-attr compile-attr ] [ "query" optional-attr compile-attr ]
[ "value" optional-attr compile-attr ] [ "value" optional-attr compile-attr ]

View File

@ -3,15 +3,13 @@
USING: accessors kernel combinators math namespaces make USING: accessors kernel combinators math namespaces make
assocs sequences splitting sorting sets debugger assocs sequences splitting sorting sets debugger
strings vectors hashtables quotations arrays byte-arrays strings vectors hashtables quotations arrays byte-arrays
math.parser calendar calendar.format present math.parser calendar calendar.format present urls logging
io io.encodings io.encodings.iana io.encodings.binary io io.encodings io.encodings.iana io.encodings.binary
io.encodings.8-bit io.encodings.8-bit
unicode.case unicode.categories qualified unicode.case unicode.categories qualified
urls
http.parsers ; http.parsers ;
EXCLUDE: fry => , ; EXCLUDE: fry => , ;
@ -98,6 +96,8 @@ TUPLE: cookie name value version comment path domain expires max-age http-only s
drop drop
] { } make ; ] { } make ;
\ parse-cookie DEBUG add-input-logging
: check-cookie-string ( string -- string' ) : check-cookie-string ( string -- string' )
dup "=;'\"\r\n" intersect empty? dup "=;'\"\r\n" intersect empty?
[ "Bad cookie name or value" throw ] unless ; [ "Bad cookie name or value" throw ] unless ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: combinators.short-circuit math math.order math.parser USING: combinators.short-circuit math math.order math.parser
kernel sequences sequences.deep peg peg.parsers assocs arrays kernel sequences sequences.deep peg peg.parsers assocs arrays
hashtables strings unicode.case namespaces make ascii ; hashtables strings unicode.case namespaces make ascii logging ;
IN: http.parsers IN: http.parsers
: except ( quot -- parser ) : except ( quot -- parser )
@ -61,6 +61,8 @@ PEG: parse-request-line ( string -- triple )
'space' , 'space' ,
] seq* just ; ] seq* just ;
\ parse-request-line DEBUG add-input-logging
: 'text' ( -- parser ) : 'text' ( -- parser )
[ ctl? ] except ; [ ctl? ] except ;

View File

@ -78,6 +78,8 @@ M: threaded-server handle-client* handler>> call ;
[ timeout>> timeouts ] [ handle-client* ] bi [ timeout>> timeouts ] [ handle-client* ] bi
] with-stream ; ] with-stream ;
\ handle-client ERROR add-error-logging
: thread-name ( server-name addrspec -- string ) : thread-name ( server-name addrspec -- string )
unparse-short " connection from " swap 3append ; unparse-short " connection from " swap 3append ;

View File

@ -27,8 +27,10 @@ M: ssl-handle handle-fd file>> handle-fd ;
{ {
{ SSL_ERROR_NONE [ 2drop f ] } { SSL_ERROR_NONE [ 2drop f ] }
{ SSL_ERROR_WANT_READ [ 2drop +input+ ] } { SSL_ERROR_WANT_READ [ 2drop +input+ ] }
{ SSL_ERROR_WANT_ACCEPT [ 2drop +input+ ] }
{ SSL_ERROR_WANT_WRITE [ 2drop +output+ ] } { SSL_ERROR_WANT_WRITE [ 2drop +output+ ] }
{ SSL_ERROR_SYSCALL [ syscall-error ] } { SSL_ERROR_SYSCALL [ syscall-error ] }
{ SSL_ERROR_ZERO_RETURN [ (ssl-error) ] }
{ SSL_ERROR_SSL [ (ssl-error) ] } { SSL_ERROR_SSL [ (ssl-error) ] }
} case ; } case ;

View File

@ -5,7 +5,7 @@
<t:style t:include="resource:extra/webapps/planet/planet.css" /> <t:style t:include="resource:extra/webapps/planet/planet.css" />
<div class="navbar"> <div class="navbar">
<t:a t:href="$planet/list">Front Page</t:a> <t:a t:href="$planet">Front Page</t:a>
| <t:a t:href="$planet/feed.xml">Atom Feed</t:a> | <t:a t:href="$planet/feed.xml">Atom Feed</t:a>
| <t:a t:href="$planet/admin">Admin</t:a> | <t:a t:href="$planet/admin">Admin</t:a>

View File

@ -144,13 +144,8 @@ posting "POSTINGS"
f <blog> f <blog>
[ deposit-blog-slots ] [ deposit-blog-slots ]
[ insert-tuple ] [ insert-tuple ]
[ bi
<url> URL" $planet/admin" <redirect>
"$planet/admin/edit-blog" >>path
swap id>> "id" set-query-param
<redirect>
]
tri
] >>submit ; ] >>submit ;
: <edit-blog-action> ( -- action ) : <edit-blog-action> ( -- action )

View File

@ -17,12 +17,9 @@ furnace.auth.features.registration
furnace.auth.features.deactivate-user furnace.auth.features.deactivate-user
furnace.boilerplate furnace.boilerplate
furnace.redirection furnace.redirection
webapps.blogs
webapps.pastebin webapps.pastebin
webapps.planet webapps.planet
webapps.todo
webapps.wiki webapps.wiki
webapps.wee-url
webapps.user-admin ; webapps.user-admin ;
IN: websites.concatenative IN: websites.concatenative
@ -33,11 +30,8 @@ IN: websites.concatenative
init-furnace-tables init-furnace-tables
{ {
post comment
paste annotation paste annotation
blog posting blog posting
todo
short-url
article revision article revision
} ensure-tables } ensure-tables
] with-db ; ] with-db ;
@ -46,12 +40,9 @@ TUPLE: factor-website < dispatcher ;
: <factor-website> ( -- responder ) : <factor-website> ( -- responder )
factor-website new-dispatcher factor-website new-dispatcher
<blogs> "blogs" add-responder
<todo-list> "todo" add-responder
<pastebin> "pastebin" add-responder <pastebin> "pastebin" add-responder
<planet> "planet" add-responder <planet> "planet" add-responder
<wiki> "wiki" add-responder <wiki> "wiki" add-responder
<wee-url> "wee-url" add-responder
<user-admin> "user-admin" add-responder <user-admin> "user-admin" add-responder
URL" /wiki/view/Front Page" <redirect-responder> "" add-responder URL" /wiki/view/Front Page" <redirect-responder> "" add-responder
"Factor website" <login-realm> "Factor website" <login-realm>