mirror of
https://github.com/walles/moar.git
synced 2024-08-16 15:30:34 +03:00
Only report first byte on read success
This commit is contained in:
parent
350c370db6
commit
f05d6a0e83
@ -126,13 +126,14 @@ func (reader *Reader) readStream(stream io.Reader, originalFileName *string, onD
|
||||
for keepReadingLine {
|
||||
lineBytes, keepReadingLine, err = bufioReader.ReadLine()
|
||||
|
||||
// Async write, it might already have been written to
|
||||
if err == nil {
|
||||
// Async write, we probably already wrote to it during the last
|
||||
// iteration
|
||||
select {
|
||||
case reader.doneWaitingForFirstByte <- true:
|
||||
default:
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
completeLine = append(completeLine, lineBytes...)
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user