Pull request: querylog: fix logic

Merge in DNS/adguard-home from fix-querylog-logs to master

Squashed commit of the following:

commit db6edb86f1f024c85efd3bca3ceb6dfc6ce04edd
Merge: d1981696 a3968658
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Dec 13 13:48:25 2021 +0300

    Merge branch 'master' into fix-querylog-logs

commit d1981696782ca9adc5213f76cdbe2dc9f859f921
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Dec 10 21:14:04 2021 +0300

    querylog: fix logic
This commit is contained in:
Ainar Garipov
2021-12-13 13:55:41 +03:00
parent a396865869
commit 0bd436f4b0
6 changed files with 40 additions and 29 deletions

View File

@@ -54,7 +54,7 @@ func NewQLogFile(path string) (*QLogFile, error) {
}, nil
}
// SeekTS performs binary search in the query log file looking for a record
// seekTS performs binary search in the query log file looking for a record
// with the specified timestamp. Once the record is found, it sets
// "position" so that the next ReadNext call returned that record.
//
@@ -71,7 +71,7 @@ func NewQLogFile(path string) (*QLogFile, error) {
// so that when we call "ReadNext" this line was returned.
// * Depth of the search (how many times we compared timestamps).
// * If we could not find it, it returns one of the errors described above.
func (q *QLogFile) SeekTS(timestamp int64) (int64, int, error) {
func (q *QLogFile) seekTS(timestamp int64) (int64, int, error) {
q.lock.Lock()
defer q.lock.Unlock()