Check for EOF even when there are no credits

This commit is contained in:
Tony Garnock-Jones 2021-06-15 14:03:26 +02:00
parent 2b18bb5b36
commit 3fe5d3a343
1 changed files with 3 additions and 1 deletions

View File

@ -152,7 +152,9 @@
[_ (enqueue credits (cons +inf.0 mode))]))]))
(match (dequeue* credits)
[(list)
never-evt]
(handle-evt (eof-evt i)
(lambda _ignored
(eof-and-finish)))]
[(list (cons count (and mode (Mode-bytes))) q)
(define buffer (make-bytes (inexact->exact (min count 131072))))
(handle-evt (read-bytes-avail!-evt buffer i)