Fixes and cleanups
parent
39e2b3450d
commit
9b9b2747a3
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2007 Daniel Ehrenberg
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: delegate sequences.private sequences assocs prettyprint.sections
|
||||
io definitions kernel continuations ;
|
||||
io definitions kernel continuations listener ;
|
||||
IN: delegate.protocols
|
||||
|
||||
PROTOCOL: sequence-protocol
|
||||
|
@ -12,8 +12,10 @@ PROTOCOL: assoc-protocol
|
|||
at* assoc-size >alist set-at assoc-clone-like { assoc-find 1 }
|
||||
delete-at clear-assoc new-assoc assoc-like ;
|
||||
|
||||
PROTOCOL: stream-protocol
|
||||
stream-read1 stream-read stream-read-until dispose
|
||||
PROTOCOL: input-stream-protocol
|
||||
stream-read1 stream-read stream-read-until stream-read-quot ;
|
||||
|
||||
PROTOCOL: output-stream-protocol
|
||||
stream-flush stream-write1 stream-write stream-format
|
||||
stream-nl make-span-stream make-block-stream stream-readln
|
||||
make-cell-stream stream-write-table ;
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
USING: assocs http kernel math math.parser namespaces sequences
|
||||
io io.sockets io.streams.string io.files io.timeouts strings
|
||||
splitting calendar continuations accessors vectors math.order
|
||||
io.encodings.8-bit io.encodings.binary fry debugger inspector ;
|
||||
io.encodings.8-bit io.encodings.binary io.streams.duplex
|
||||
fry debugger inspector ;
|
||||
IN: http.client
|
||||
|
||||
: max-redirects 10 ;
|
||||
|
|
|
@ -82,10 +82,8 @@ IN: http.server.auth.admin
|
|||
|
||||
same-password-twice
|
||||
|
||||
user new "username" value >>username select-tuple [
|
||||
user-exists? on
|
||||
validation-failed
|
||||
] when
|
||||
user new "username" value >>username select-tuple
|
||||
[ user-exists ] when
|
||||
|
||||
"username" value <user>
|
||||
"realname" value >>realname
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2003, 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: io io.sockets io.files logging continuations kernel
|
||||
math math.parser namespaces parser sequences strings
|
||||
prettyprint debugger quotations calendar
|
||||
USING: io io.sockets io.files io.streams.duplex logging
|
||||
continuations kernel math math.parser namespaces parser
|
||||
sequences strings prettyprint debugger quotations calendar
|
||||
threads concurrency.combinators assocs ;
|
||||
IN: io.server
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
! Copyright (C) 2005, 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel continuations io io.encodings io.encodings.private
|
||||
io.timeouts debugger inspector listener accessors ;
|
||||
io.timeouts debugger inspector listener accessors delegate
|
||||
delegate.protocols ;
|
||||
IN: io.streams.duplex
|
||||
|
||||
! We ensure that the stream can only be closed once, to preserve
|
||||
|
@ -28,50 +29,9 @@ M: stream-closed-twice summary
|
|||
|
||||
PRIVATE>
|
||||
|
||||
M: duplex-stream stream-flush
|
||||
out stream-flush ;
|
||||
CONSULT: input-stream-protocol duplex-stream in ;
|
||||
|
||||
M: duplex-stream stream-readln
|
||||
in stream-readln ;
|
||||
|
||||
M: duplex-stream stream-read1
|
||||
in stream-read1 ;
|
||||
|
||||
M: duplex-stream stream-read-until
|
||||
in stream-read-until ;
|
||||
|
||||
M: duplex-stream stream-read-partial
|
||||
in stream-read-partial ;
|
||||
|
||||
M: duplex-stream stream-read
|
||||
in stream-read ;
|
||||
|
||||
M: duplex-stream stream-write1
|
||||
out stream-write1 ;
|
||||
|
||||
M: duplex-stream stream-write
|
||||
out stream-write ;
|
||||
|
||||
M: duplex-stream stream-nl
|
||||
out stream-nl ;
|
||||
|
||||
M: duplex-stream stream-format
|
||||
out stream-format ;
|
||||
|
||||
M: duplex-stream make-span-stream
|
||||
out make-span-stream ;
|
||||
|
||||
M: duplex-stream make-block-stream
|
||||
out make-block-stream ;
|
||||
|
||||
M: duplex-stream make-cell-stream
|
||||
out make-cell-stream ;
|
||||
|
||||
M: duplex-stream stream-write-table
|
||||
out stream-write-table ;
|
||||
|
||||
M: duplex-stream stream-read-quot
|
||||
in stream-read-quot ;
|
||||
CONSULT: output-stream-protocol duplex-stream out ;
|
||||
|
||||
M: duplex-stream set-timeout
|
||||
[ in set-timeout ] [ out set-timeout ] 2bi ;
|
||||
|
|
|
@ -4,13 +4,13 @@ IN: io.unix.pipes.tests
|
|||
|
||||
[ { 0 0 } ] [ { "ls" "grep x" } with-pipeline ] unit-test
|
||||
|
||||
! [ ] [
|
||||
! {
|
||||
! "ls"
|
||||
! [
|
||||
! input-stream [ utf8 <decoder> ] change
|
||||
! input-stream get lines reverse [ print ] each f
|
||||
! ]
|
||||
! "grep x"
|
||||
! } with-pipeline
|
||||
! ] unit-test
|
||||
[ { 0 f 0 } ] [
|
||||
{
|
||||
"ls"
|
||||
[
|
||||
input-stream [ utf8 <decoder> ] change
|
||||
input-stream get lines reverse [ print ] each f
|
||||
]
|
||||
"grep x"
|
||||
} with-pipeline
|
||||
] unit-test
|
||||
|
|
Loading…
Reference in New Issue