=str #19775 FilePublisher should not report EOF multiple times
This commit is contained in:
parent
a83f08d4ab
commit
d5f8186f05
1 changed files with 1 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ private[akka] final class FilePublisher(f: File, completionPromise: Promise[IORe
|
|||
|
||||
/** BLOCKING I/O READ */
|
||||
@tailrec def readAhead(maxChunks: Int, chunks: Vector[ByteString]): Vector[ByteString] =
|
||||
if (chunks.size <= maxChunks && isActive) {
|
||||
if (chunks.size <= maxChunks && isActive && !eofEncountered) {
|
||||
(try chan.read(buf) catch { case NonFatal(ex) ⇒ onErrorThenStop(ex); Int.MinValue }) match {
|
||||
case -1 ⇒ // EOF
|
||||
eofReachedAtOffset = chan.position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue