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.
USING: accessors arrays combinators html.elements io
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 ;
IN: farkup

View File

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

View File

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

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.short-circuit math math.order math.parser
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
: except ( quot -- parser )
@ -61,6 +61,8 @@ PEG: parse-request-line ( string -- triple )
'space' ,
] seq* just ;
\ parse-request-line DEBUG add-input-logging
: 'text' ( -- parser )
[ ctl? ] except ;

View File

@ -78,6 +78,8 @@ M: threaded-server handle-client* handler>> call ;
[ timeout>> timeouts ] [ handle-client* ] bi
] with-stream ;
\ handle-client ERROR add-error-logging
: thread-name ( server-name addrspec -- string )
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_WANT_READ [ 2drop +input+ ] }
{ SSL_ERROR_WANT_ACCEPT [ 2drop +input+ ] }
{ SSL_ERROR_WANT_WRITE [ 2drop +output+ ] }
{ SSL_ERROR_SYSCALL [ syscall-error ] }
{ SSL_ERROR_ZERO_RETURN [ (ssl-error) ] }
{ SSL_ERROR_SSL [ (ssl-error) ] }
} case ;

View File

@ -5,7 +5,7 @@
<t:style t:include="resource:extra/webapps/planet/planet.css" />
<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/admin">Admin</t:a>

View File

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

View File

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