*(dnsforward): fix reading in-memory entries

This commit is contained in:
Andrey Meshkov
2020-02-21 16:50:20 +03:00
parent 9d8a95f836
commit df427b6822
3 changed files with 11 additions and 7 deletions

View File

@@ -15,7 +15,11 @@ import (
// if we failed to find the desired record
var ErrSeekNotFound = errors.New("Seek not found the record")
const bufferSize = 256 * 1024 // 256 KB is the buffer size
// TODO: Find a way to grow buffer instead of relying on this value when reading strings
const maxEntrySize = 16 * 1024
// buffer should be enough for at least this number of entries
const bufferSize = 100 * maxEntrySize
// QLogFile represents a single query log file
// It allows reading from the file in the reverse order