Merge branch 'master' of git://factorcode.org/git/factor
commit
52f5701f6c
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
USING: kernel combinators sequences sets math
|
USING: kernel combinators sequences sets math threads
|
||||||
io.sockets unicode.case accessors
|
io.sockets unicode.case accessors
|
||||||
combinators.cleave combinators.lib
|
combinators.cleave combinators.lib
|
||||||
newfx
|
newfx fry
|
||||||
dns dns.util dns.misc ;
|
dns dns.util dns.misc ;
|
||||||
|
|
||||||
IN: dns.server
|
IN: dns.server
|
||||||
|
@ -52,6 +52,7 @@ IN: dns.server
|
||||||
{
|
{
|
||||||
{ [ dup type>> NS = ] [ rdata>> {1} ] }
|
{ [ dup type>> NS = ] [ rdata>> {1} ] }
|
||||||
{ [ dup type>> MX = ] [ rdata>> exchange>> {1} ] }
|
{ [ dup type>> MX = ] [ rdata>> exchange>> {1} ] }
|
||||||
|
{ [ dup type>> CNAME = ] [ rdata>> {1} ] }
|
||||||
{ [ t ] [ drop f ] }
|
{ [ t ] [ drop f ] }
|
||||||
}
|
}
|
||||||
cond ;
|
cond ;
|
||||||
|
@ -203,15 +204,18 @@ DEFER: query->rrs
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: loop ( -- )
|
: (handle-request) ( byte-array addr-spec -- )
|
||||||
socket receive
|
>r
|
||||||
swap
|
|
||||||
parse-message
|
parse-message
|
||||||
find-answer
|
find-answer
|
||||||
message->ba
|
message->ba
|
||||||
swap
|
r>
|
||||||
socket send
|
socket send ;
|
||||||
loop ;
|
|
||||||
|
: handle-request ( byte-array addr-spec -- )
|
||||||
|
'[ , , (handle-request) ] in-thread ;
|
||||||
|
|
||||||
|
: loop ( -- ) socket receive handle-request loop ;
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
|
|
||||||
USING: kernel sequences assocs qualified circular ;
|
USING: kernel sequences assocs qualified circular sets ;
|
||||||
|
|
||||||
USING: math multi-methods ;
|
USING: math multi-methods ;
|
||||||
|
|
||||||
QUALIFIED: sequences
|
QUALIFIED: sequences
|
||||||
QUALIFIED: assocs
|
QUALIFIED: assocs
|
||||||
QUALIFIED: circular
|
QUALIFIED: circular
|
||||||
|
QUALIFIED: sets
|
||||||
|
|
||||||
IN: newfx
|
IN: newfx
|
||||||
|
|
||||||
|
@ -190,3 +191,8 @@ METHOD: as-mutate { object object assoc } set-at ;
|
||||||
! A note about the 'mutate' qualifier. Other words also technically mutate
|
! A note about the 'mutate' qualifier. Other words also technically mutate
|
||||||
! their primary object. However, the 'mutate' qualifier is supposed to
|
! their primary object. However, the 'mutate' qualifier is supposed to
|
||||||
! indicate that this is the main objective of the word, as a side effect.
|
! indicate that this is the main objective of the word, as a side effect.
|
||||||
|
|
||||||
|
: adjoin ( seq elt -- seq ) over sets:adjoin ;
|
||||||
|
: adjoin-on ( elt seq -- seq ) tuck sets:adjoin ;
|
||||||
|
: adjoined ( set elt -- ) swap sets:adjoin ;
|
||||||
|
: adjoined-on ( elt set -- ) sets:adjoin ;
|
Loading…
Reference in New Issue