*(dnsforward): fix in-memory log entries sort orderr

This commit is contained in:
Andrey Meshkov
2020-02-21 13:01:41 +03:00
parent 87c0410914
commit 9d8a95f836
2 changed files with 15 additions and 9 deletions

View File

@@ -206,7 +206,10 @@ func (l *queryLog) getData(params getDataParams) map[string]interface{} {
l.bufferLock.Lock()
total += len(l.buffer)
memoryEntries := make([]*logEntry, 0)
for _, entry := range l.buffer {
// go through the buffer in the reverse order
for i := len(l.buffer) - 1; i >= 0; i-- {
entry := l.buffer[i]
if !matchesGetDataParams(entry, params) {
continue
}