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
13
m/reader.go
13
m/reader.go
@ -126,13 +126,14 @@ func (reader *Reader) readStream(stream io.Reader, originalFileName *string, onD
|
|||||||
for keepReadingLine {
|
for keepReadingLine {
|
||||||
lineBytes, keepReadingLine, err = bufioReader.ReadLine()
|
lineBytes, keepReadingLine, err = bufioReader.ReadLine()
|
||||||
|
|
||||||
// Async write, it might already have been written to
|
|
||||||
select {
|
|
||||||
case reader.doneWaitingForFirstByte <- true:
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
// Async write, we probably already wrote to it during the last
|
||||||
|
// iteration
|
||||||
|
select {
|
||||||
|
case reader.doneWaitingForFirstByte <- true:
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
completeLine = append(completeLine, lineBytes...)
|
completeLine = append(completeLine, lineBytes...)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user