forked from DGNum/liminix
simpler eof handling
This commit is contained in:
parent
b84a6e0aa5
commit
1b372bcb2b
1 changed files with 2 additions and 8 deletions
|
@ -33,15 +33,9 @@
|
|||
(values
|
||||
(fn handler [reqlen]
|
||||
(let [bytes (f:read reqlen)]
|
||||
(if eof?
|
||||
false
|
||||
bytes
|
||||
(if bytes
|
||||
(values true bytes)
|
||||
(do
|
||||
;; if the file length is divisible by the block
|
||||
;; length, need to send an empty block at eof
|
||||
(set eof? true)
|
||||
(values true "")))))
|
||||
(values false nil))))
|
||||
size))
|
||||
(error "host not allowed")))
|
||||
nil
|
||||
|
|
Loading…
Reference in a new issue