detect non streaming mode on the first read
This commit is contained in:
@@ -11,7 +11,7 @@ type ReaderPattern struct {
|
|||||||
func NewReaderPattern() *ReaderPattern {
|
func NewReaderPattern() *ReaderPattern {
|
||||||
return &ReaderPattern{
|
return &ReaderPattern{
|
||||||
isStreaming: true,
|
isStreaming: true,
|
||||||
lastReadOffset: 0,
|
lastReadOffset: -1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,6 +19,11 @@ func (rp *ReaderPattern) MonitorReadAt(offset int64, size int) {
|
|||||||
if rp.lastReadOffset > offset {
|
if rp.lastReadOffset > offset {
|
||||||
rp.isStreaming = false
|
rp.isStreaming = false
|
||||||
}
|
}
|
||||||
|
if rp.lastReadOffset == -1 {
|
||||||
|
if offset != 0 {
|
||||||
|
rp.isStreaming = false
|
||||||
|
}
|
||||||
|
}
|
||||||
rp.lastReadOffset = offset
|
rp.lastReadOffset = offset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user