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
|
(values
|
||||||
(fn handler [reqlen]
|
(fn handler [reqlen]
|
||||||
(let [bytes (f:read reqlen)]
|
(let [bytes (f:read reqlen)]
|
||||||
(if eof?
|
(if bytes
|
||||||
false
|
|
||||||
bytes
|
|
||||||
(values true bytes)
|
(values true bytes)
|
||||||
(do
|
(values false nil))))
|
||||||
;; if the file length is divisible by the block
|
|
||||||
;; length, need to send an empty block at eof
|
|
||||||
(set eof? true)
|
|
||||||
(values true "")))))
|
|
||||||
size))
|
size))
|
||||||
(error "host not allowed")))
|
(error "host not allowed")))
|
||||||
nil
|
nil
|
||||||
|
|
Loading…
Reference in a new issue