Skip to content

Commit e4a8c04

Browse files
committed
Use io.ReadFull to ensure full content is read when checking position hash
1 parent c766261 commit e4a8c04

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGES.txt

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ Bug Handling
8484
* Fixed panic that was occurring when loading a config file or directory that
8585
exists but which registers no plugins (#1597).
8686

87+
* Fixed bug where LogStreamerInput would sometimes loop infinitely reading the
88+
same file over and over when reading gzipped log files.
89+
8790
0.10.0b1 (2015-08-07)
8891
=====================
8992

logstreamer/reader.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ func SeekInFile(path string, position *LogstreamLocation) (*os.File, io.Reader,
410410
expectedN int64
411411
)
412412
if seekPos >= 0 {
413-
n, err = reader.Read(buf)
413+
n, err = io.ReadFull(reader, buf)
414414
expectedN = int64(LINEBUFFERLEN)
415415
} else {
416416
n, err = reader.Read(buf[-seekPos:])

0 commit comments

Comments
 (0)