Fix header/body separation

db4
Slava Pestov 2008-02-14 02:20:32 -06:00
parent ce076166fe
commit 5adf72b81d
2 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,7 @@
USING: combinators kernel prettyprint io io.timeouts io.server USING: combinators kernel prettyprint io io.timeouts io.server
sequences namespaces io.sockets continuations ; sequences namespaces io.sockets continuations ;
IN: smtp.server
SYMBOL: data-mode SYMBOL: data-mode
@ -55,7 +56,7 @@ SYMBOL: data-mode
data-mode off data-mode off
"220 OK\r\n" write flush t "220 OK\r\n" write flush t
] } ] }
{ [ data-mode get ] [ t ] } { [ data-mode get ] [ global [ print ] bind t ] }
{ [ t ] [ { [ t ] [
"500 ERROR\r\n" write flush t "500 ERROR\r\n" write flush t
] } ] }
@ -68,5 +69,6 @@ SYMBOL: data-mode
60000 stdio get set-timeout 60000 stdio get set-timeout
"220 hello\r\n" write flush "220 hello\r\n" write flush
process process
global [ flush ] bind
] with-stream ] with-stream
] with-disposal ; ] with-disposal ;

View File

@ -139,7 +139,7 @@ LOG: smtp-response DEBUG
: prepare-message ( body headers -- body' ) : prepare-message ( body headers -- body' )
[ [
prepare-headers prepare-headers
" " , "" ,
dup string? [ string-lines ] when % dup string? [ string-lines ] when %
] { } make ; ] { } make ;