docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
if errors.Is(err, errTSTooEarly) { | <mask> for i := len(r.qFiles) - 1; i >= 0; i-- {
<mask> q := r.qFiles[i]
<mask> _, _, err = q.seekTS(timestamp)
<mask> if err != nil {
<mask> if errors.Is(err, ErrTSTooEarly) {
<mask> // Look at the next file, since we've reached the end of this
<mask> // one. If there is no next file, it's not found.
<mask> err = ErrTSNotFound
<mask>
<mask> continue
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove err = ErrTSNotFound
</s> add err = errTSNotFound </s> remove // timestamp. If the record is found, it sets QLogReader's position to point to
// that line, so that the next ReadNext call returned this line.
func (r *QLogReader) seekTS(timestamp int64) (err error) {
</s> add // timestamp. If the record is found, it sets qLogReader's position to point
// to that line, so that the next ReadNext call returned this line.
func (r *qLogReader) seekTS(timestamp int64) (err error) { </s> remove } else if errors.Is(err, ErrTSTooLate) {
</s> add } else if errors.Is(err, errTSTooLate) { </s> remove // Look for the end of the prev line
// This is where we'll read from
</s> add // Look for the end of the prev line, this is where we'll read from. </s> remove // Now start looking for the new line character starting
// from the relativePos and going left
</s> add // Now start looking for the new line character starting from the
// relativePos and going left. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
err = errTSNotFound | <mask> if err != nil {
<mask> if errors.Is(err, ErrTSTooEarly) {
<mask> // Look at the next file, since we've reached the end of this
<mask> // one. If there is no next file, it's not found.
<mask> err = ErrTSNotFound
<mask>
<mask> continue
<mask> } else if errors.Is(err, ErrTSTooLate) {
<mask> // Just seek to the start then. timestamp is probably between
<mask> // the end of the previous one and the start of this one.
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove } else if errors.Is(err, ErrTSTooLate) {
</s> add } else if errors.Is(err, errTSTooLate) { </s> remove if errors.Is(err, ErrTSTooEarly) {
</s> add if errors.Is(err, errTSTooEarly) { </s> remove } else if errors.Is(err, ErrTSNotFound) {
</s> add } else if errors.Is(err, errTSNotFound) { </s> remove // timestamp. If the record is found, it sets QLogReader's position to point to
// that line, so that the next ReadNext call returned this line.
func (r *QLogReader) seekTS(timestamp int64) (err error) {
</s> add // timestamp. If the record is found, it sets qLogReader's position to point
// to that line, so that the next ReadNext call returned this line.
func (r *qLogReader) seekTS(timestamp int64) (err error) { </s> remove // Look for the end of the prev line
// This is where we'll read from
</s> add // Look for the end of the prev line, this is where we'll read from. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
} else if errors.Is(err, errTSTooLate) { | <mask> // one. If there is no next file, it's not found.
<mask> err = ErrTSNotFound
<mask>
<mask> continue
<mask> } else if errors.Is(err, ErrTSTooLate) {
<mask> // Just seek to the start then. timestamp is probably between
<mask> // the end of the previous one and the start of this one.
<mask> return r.SeekStart()
<mask> } else if errors.Is(err, ErrTSNotFound) {
<mask> return err
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove err = ErrTSNotFound
</s> add err = errTSNotFound </s> remove } else if errors.Is(err, ErrTSNotFound) {
</s> add } else if errors.Is(err, errTSNotFound) { </s> remove if errors.Is(err, ErrTSTooEarly) {
</s> add if errors.Is(err, errTSTooEarly) { </s> remove // This is unexpected, return an error right away
</s> add // This is unexpected, return an error right away. </s> remove // If the timestamp we're looking for is OLDER than what we found
// Then the line is somewhere on the LEFT side from the current probe position
</s> add // If the timestamp we're looking for is OLDER than what we found,
// then the line is somewhere on the LEFT side from the current
// probe position. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
} else if errors.Is(err, errTSNotFound) { | <mask> } else if errors.Is(err, ErrTSTooLate) {
<mask> // Just seek to the start then. timestamp is probably between
<mask> // the end of the previous one and the start of this one.
<mask> return r.SeekStart()
<mask> } else if errors.Is(err, ErrTSNotFound) {
<mask> return err
<mask> } else {
<mask> return fmt.Errorf("seekts: file at index %d: %w", i, err)
<mask> }
<mask> }
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove } else if errors.Is(err, ErrTSTooLate) {
</s> add } else if errors.Is(err, errTSTooLate) { </s> remove err = ErrTSNotFound
</s> add err = errTSNotFound </s> remove if lineIdx == lastProbeLineIdx {
if lineIdx == 0 {
return 0, depth, ErrTSTooEarly
}
// If we're testing the same line twice then most likely
// the scope is too narrow and we won't find anything
// anymore in any other file.
return 0, depth, fmt.Errorf("looking up timestamp %d in %q: %w", timestamp, q.file.Name(), ErrTSNotFound)
} else if lineIdx == fileInfo.Size() {
return 0, depth, ErrTSTooLate
</s> add // Check if the line index if invalid.
err = q.validateQLogLineIdx(lineIdx, lastProbeLineIdx, timestamp, fileInfo.Size())
if err != nil {
return 0, depth, err </s> remove log.Error("querylog: opening qlog reader: %s", err)
return entries, oldest, 0
}
defer func() {
closeErr := r.Close()
if closeErr != nil {
log.Error("querylog: closing file: %s", err)
}
}()
if params.olderThan.IsZero() {
err = r.SeekStart()
} else {
err = r.seekTS(params.olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
</s> add return nil, fmt.Errorf("opening qlog reader: %s", err) </s> remove return &QLogFile{
file: f,
}, nil
</s> add return &qLogFile{file: f}, nil
}
// validateQLogLineIdx returns error if the line index is not valid to continue
// search.
func (q *qLogFile) validateQLogLineIdx(lineIdx, lastProbeLineIdx, ts, fSize int64) (err error) {
if lineIdx == lastProbeLineIdx {
if lineIdx == 0 {
return errTSTooEarly
}
// If we're testing the same line twice then most likely the scope is
// too narrow and we won't find anything anymore in any other file.
return fmt.Errorf("looking up timestamp %d in %q: %w", ts, q.file.Name(), errTSNotFound)
} else if lineIdx == fSize {
return errTSTooLate
}
return nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// qLogFile. | <mask> }
<mask>
<mask> // The search is finished, and the searched element has been found.
<mask> // Update currentFile only, position is already set properly in
<mask> // QLogFile.
<mask> r.currentFile = i
<mask>
<mask> return nil
<mask> }
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Please note that this is a stateful object.
// Internally, it contains a pointer to a particular query log file, and
// to a specific position in this file, and it reads lines in reverse order
// starting from that position.
type QLogReader struct {
// qFiles - array with the query log files
// The order is - from oldest to newest
qFiles []*QLogFile
currentFile int // Index of the current file
</s> add // Please note that this is a stateful object. Internally, it contains a
// pointer to a particular query log file, and to a specific position in this
// file, and it reads lines in reverse order starting from that position.
type qLogReader struct {
// qFiles is an array with the query log files. The order is from oldest
// to newest.
qFiles []*qLogFile
// currentFile is the index of the current file.
currentFile int </s> remove totalLimit := params.offset + params.limit
oldestNano := int64(0)
</s> add return r, nil
} </s> remove // Hurray, returning the result
</s> add // Hurray, returning the result. </s> remove // Returns nil if we were able to change the current position.
// Returns error in any other case.
func (r *QLogReader) SeekStart() error {
</s> add // Returns nil if we were able to change the current position. Returns error
// in any other cases.
func (r *qLogReader) SeekStart() error { </s> remove } else if errors.Is(err, ErrTSTooLate) {
</s> add } else if errors.Is(err, errTSTooLate) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// SeekStart changes the current position to the end of the newest file.
// Please note that we're reading query log in the reverse order and that's why
// the log starts actually at the end of file. | <mask>
<mask> return nil
<mask> }
<mask>
<mask> // SeekStart changes the current position to the end of the newest file
<mask> // Please note that we're reading query log in the reverse order
<mask> // and that's why log start is actually the end of file
<mask> //
<mask> // Returns nil if we were able to change the current position.
<mask> // Returns error in any other case.
<mask> func (r *QLogReader) SeekStart() error {
<mask> if len(r.qFiles) == 0 {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Returns nil if we were able to change the current position.
// Returns error in any other case.
func (r *QLogReader) SeekStart() error {
</s> add // Returns nil if we were able to change the current position. Returns error
// in any other cases.
func (r *qLogReader) SeekStart() error { </s> remove // Returns nil if we were able to change the current position.
// Returns error in any other case.
func (q *QLogFile) SeekStart() (int64, error) {
</s> add // Returns nil if we were able to change the current position. Returns error
// in any other case.
func (q *qLogFile) SeekStart() (int64, error) { </s> remove // SeekStart changes the current position to the end of the file
// Please note that we're reading query log in the reverse order
// and that's why log start is actually the end of file
</s> add // SeekStart changes the current position to the end of the file. Please note,
// that we're reading query log in the reverse order and that's why log start
// is actually the end of file. </s> remove // ReadNext reads the next line (in the reverse order) from the query log files.
// and shifts the current position left to the next (actually prev) line (or the next file).
// returns io.EOF if there's nothing to read more.
func (r *QLogReader) ReadNext() (string, error) {
</s> add // ReadNext reads the next line (in the reverse order) from the query log
// files. Then shifts the current position left to the next (actually prev)
// line (or the next file).
//
// Returns io.EOF if there is nothing more to read.
func (r *qLogReader) ReadNext() (string, error) { </s> remove // Please note that this is a stateful object.
// Internally, it contains a pointer to a particular query log file, and
// to a specific position in this file, and it reads lines in reverse order
// starting from that position.
type QLogReader struct {
// qFiles - array with the query log files
// The order is - from oldest to newest
qFiles []*QLogFile
currentFile int // Index of the current file
</s> add // Please note that this is a stateful object. Internally, it contains a
// pointer to a particular query log file, and to a specific position in this
// file, and it reads lines in reverse order starting from that position.
type qLogReader struct {
// qFiles is an array with the query log files. The order is from oldest
// to newest.
qFiles []*qLogFile
// currentFile is the index of the current file.
currentFile int | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// Returns nil if we were able to change the current position. Returns error
// in any other cases.
func (r *qLogReader) SeekStart() error { | <mask> // SeekStart changes the current position to the end of the newest file
<mask> // Please note that we're reading query log in the reverse order
<mask> // and that's why log start is actually the end of file
<mask> //
<mask> // Returns nil if we were able to change the current position.
<mask> // Returns error in any other case.
<mask> func (r *QLogReader) SeekStart() error {
<mask> if len(r.qFiles) == 0 {
<mask> return nil
<mask> }
<mask>
<mask> r.currentFile = len(r.qFiles) - 1
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // SeekStart changes the current position to the end of the newest file
// Please note that we're reading query log in the reverse order
// and that's why log start is actually the end of file
</s> add // SeekStart changes the current position to the end of the newest file.
// Please note that we're reading query log in the reverse order and that's why
// the log starts actually at the end of file. </s> remove // Returns nil if we were able to change the current position.
// Returns error in any other case.
func (q *QLogFile) SeekStart() (int64, error) {
</s> add // Returns nil if we were able to change the current position. Returns error
// in any other case.
func (q *qLogFile) SeekStart() (int64, error) { </s> remove // SeekStart changes the current position to the end of the file
// Please note that we're reading query log in the reverse order
// and that's why log start is actually the end of file
</s> add // SeekStart changes the current position to the end of the file. Please note,
// that we're reading query log in the reverse order and that's why log start
// is actually the end of file. </s> remove // ReadNext reads the next line (in the reverse order) from the query log files.
// and shifts the current position left to the next (actually prev) line (or the next file).
// returns io.EOF if there's nothing to read more.
func (r *QLogReader) ReadNext() (string, error) {
</s> add // ReadNext reads the next line (in the reverse order) from the query log
// files. Then shifts the current position left to the next (actually prev)
// line (or the next file).
//
// Returns io.EOF if there is nothing more to read.
func (r *qLogReader) ReadNext() (string, error) { </s> remove // Please note that this is a stateful object.
// Internally, it contains a pointer to a particular query log file, and
// to a specific position in this file, and it reads lines in reverse order
// starting from that position.
type QLogReader struct {
// qFiles - array with the query log files
// The order is - from oldest to newest
qFiles []*QLogFile
currentFile int // Index of the current file
</s> add // Please note that this is a stateful object. Internally, it contains a
// pointer to a particular query log file, and to a specific position in this
// file, and it reads lines in reverse order starting from that position.
type qLogReader struct {
// qFiles is an array with the query log files. The order is from oldest
// to newest.
qFiles []*qLogFile
// currentFile is the index of the current file.
currentFile int | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// ReadNext reads the next line (in the reverse order) from the query log
// files. Then shifts the current position left to the next (actually prev)
// line (or the next file).
//
// Returns io.EOF if there is nothing more to read.
func (r *qLogReader) ReadNext() (string, error) { | <mask>
<mask> return err
<mask> }
<mask>
<mask> // ReadNext reads the next line (in the reverse order) from the query log files.
<mask> // and shifts the current position left to the next (actually prev) line (or the next file).
<mask> // returns io.EOF if there's nothing to read more.
<mask> func (r *QLogReader) ReadNext() (string, error) {
<mask> if len(r.qFiles) == 0 {
<mask> return "", io.EOF
<mask> }
<mask>
<mask> for r.currentFile >= 0 {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // ReadNext reads the next line (in the reverse order) from the file
// and shifts the current position left to the next (actually prev) line.
// returns io.EOF if there's nothing to read more
func (q *QLogFile) ReadNext() (string, error) {
</s> add // ReadNext reads the next line (in the reverse order) from the file and shifts
// the current position left to the next (actually prev) line.
//
// Returns io.EOF if there's nothing more to read.
func (q *qLogFile) ReadNext() (string, error) { </s> remove // Returns nil if we were able to change the current position.
// Returns error in any other case.
func (r *QLogReader) SeekStart() error {
</s> add // Returns nil if we were able to change the current position. Returns error
// in any other cases.
func (r *qLogReader) SeekStart() error { </s> remove // Shift position
</s> add // Shift position. </s> remove // timestamp. If the record is found, it sets QLogReader's position to point to
// that line, so that the next ReadNext call returned this line.
func (r *QLogReader) seekTS(timestamp int64) (err error) {
</s> add // timestamp. If the record is found, it sets qLogReader's position to point
// to that line, so that the next ReadNext call returned this line.
func (r *qLogReader) seekTS(timestamp int64) (err error) { </s> remove // SeekStart changes the current position to the end of the newest file
// Please note that we're reading query log in the reverse order
// and that's why log start is actually the end of file
</s> add // SeekStart changes the current position to the end of the newest file.
// Please note that we're reading query log in the reverse order and that's why
// the log starts actually at the end of file. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// Shift to the older file. | <mask> for r.currentFile >= 0 {
<mask> q := r.qFiles[r.currentFile]
<mask> line, err := q.ReadNext()
<mask> if err != nil {
<mask> // Shift to the older file
<mask> r.currentFile--
<mask> if r.currentFile < 0 {
<mask> break
<mask> }
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Shift position
</s> add // Shift position. </s> remove // there's usually a line break before the line
// so we should shift one more char left from the line
// line\nline
</s> add // There's usually a line break before the line, so we should shift one
// more char left from the line "\nline". </s> remove var e *logEntry
var ts int64
e, ts, err = l.readNextEntry(r, params, cache)
if err != nil {
if err == io.EOF {
</s> add ent, ts, rErr := l.readNextEntry(r, params, cache)
if rErr != nil {
if rErr == io.EOF { </s> remove // Place the position to the very end of file
</s> add // Place the position to the very end of file. </s> remove // ReadNext reads the next line (in the reverse order) from the query log files.
// and shifts the current position left to the next (actually prev) line (or the next file).
// returns io.EOF if there's nothing to read more.
func (r *QLogReader) ReadNext() (string, error) {
</s> add // ReadNext reads the next line (in the reverse order) from the query log
// files. Then shifts the current position left to the next (actually prev)
// line (or the next file).
//
// Returns io.EOF if there is nothing more to read.
func (r *qLogReader) ReadNext() (string, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// Set its position to the start right away. | <mask> }
<mask>
<mask> q = r.qFiles[r.currentFile]
<mask>
<mask> // Set it's position to the start right away
<mask> _, err = q.SeekStart()
<mask>
<mask> // This is unexpected, return an error right away
<mask> if err != nil {
<mask> return "", err
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // This is unexpected, return an error right away
</s> add // This is unexpected, return an error right away. </s> remove } else if errors.Is(err, ErrTSTooLate) {
</s> add } else if errors.Is(err, errTSTooLate) { </s> remove // Seek to this position
</s> add // Seek to this position. </s> remove // Shift to the older file
</s> add // Shift to the older file. </s> remove if errors.Is(err, ErrTSTooEarly) {
</s> add if errors.Is(err, errTSTooEarly) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// This is unexpected, return an error right away. | <mask>
<mask> // Set it's position to the start right away
<mask> _, err = q.SeekStart()
<mask>
<mask> // This is unexpected, return an error right away
<mask> if err != nil {
<mask> return "", err
<mask> }
<mask> } else {
<mask> return line, nil
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Set it's position to the start right away
</s> add // Set its position to the start right away. </s> remove } else if errors.Is(err, ErrTSTooLate) {
</s> add } else if errors.Is(err, errTSTooLate) { </s> remove } else if errors.Is(err, ErrTSNotFound) {
</s> add } else if errors.Is(err, errTSNotFound) { </s> remove // Nothing to read anymore
</s> add // Nothing to read anymore. </s> remove // Shift position
</s> add // Shift position. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// Nothing to read anymore. | <mask> return line, nil
<mask> }
<mask> }
<mask>
<mask> // Nothing to read anymore
<mask> return "", io.EOF
<mask> }
<mask>
<mask> // Close closes the QLogReader
<mask> func (r *QLogReader) Close() error {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Close closes the QLogReader
func (r *QLogReader) Close() error {
</s> add // Close closes the qLogReader.
func (r *qLogReader) Close() error { </s> remove // Close frees the underlying resources
func (q *QLogFile) Close() error {
</s> add // Close frees the underlying resources.
func (q *qLogFile) Close() error { </s> remove // ReadNext reads the next line (in the reverse order) from the query log files.
// and shifts the current position left to the next (actually prev) line (or the next file).
// returns io.EOF if there's nothing to read more.
func (r *QLogReader) ReadNext() (string, error) {
</s> add // ReadNext reads the next line (in the reverse order) from the query log
// files. Then shifts the current position left to the next (actually prev)
// line (or the next file).
//
// Returns io.EOF if there is nothing more to read.
func (r *qLogReader) ReadNext() (string, error) { </s> remove // closeQFiles - helper method to close multiple QLogFile instances
func closeQFiles(qFiles []*QLogFile) error {
</s> add // closeQFiles is a helper method to close multiple qLogFile instances.
func closeQFiles(qFiles []*qLogFile) error { </s> remove // This is unexpected, return an error right away
</s> add // This is unexpected, return an error right away. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// Close closes the qLogReader.
func (r *qLogReader) Close() error { | <mask> // Nothing to read anymore
<mask> return "", io.EOF
<mask> }
<mask>
<mask> // Close closes the QLogReader
<mask> func (r *QLogReader) Close() error {
<mask> return closeQFiles(r.qFiles)
<mask> }
<mask>
<mask> // closeQFiles - helper method to close multiple QLogFile instances
<mask> func closeQFiles(qFiles []*QLogFile) error {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // closeQFiles - helper method to close multiple QLogFile instances
func closeQFiles(qFiles []*QLogFile) error {
</s> add // closeQFiles is a helper method to close multiple qLogFile instances.
func closeQFiles(qFiles []*qLogFile) error { </s> remove // Nothing to read anymore
</s> add // Nothing to read anymore. </s> remove // Close frees the underlying resources
func (q *QLogFile) Close() error {
</s> add // Close frees the underlying resources.
func (q *qLogFile) Close() error { </s> remove // ReadNext reads the next line (in the reverse order) from the query log files.
// and shifts the current position left to the next (actually prev) line (or the next file).
// returns io.EOF if there's nothing to read more.
func (r *QLogReader) ReadNext() (string, error) {
</s> add // ReadNext reads the next line (in the reverse order) from the query log
// files. Then shifts the current position left to the next (actually prev)
// line (or the next file).
//
// Returns io.EOF if there is nothing more to read.
func (r *qLogReader) ReadNext() (string, error) { </s> remove // Returns nil if we were able to change the current position.
// Returns error in any other case.
func (r *QLogReader) SeekStart() error {
</s> add // Returns nil if we were able to change the current position. Returns error
// in any other cases.
func (r *qLogReader) SeekStart() error { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// closeQFiles is a helper method to close multiple qLogFile instances.
func closeQFiles(qFiles []*qLogFile) error { | <mask> func (r *QLogReader) Close() error {
<mask> return closeQFiles(r.qFiles)
<mask> }
<mask>
<mask> // closeQFiles - helper method to close multiple QLogFile instances
<mask> func closeQFiles(qFiles []*QLogFile) error {
<mask> var errs []error
<mask>
<mask> for _, q := range qFiles {
<mask> err := q.Close()
<mask> if err != nil {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Close closes the QLogReader
func (r *QLogReader) Close() error {
</s> add // Close closes the qLogReader.
func (r *qLogReader) Close() error { </s> remove q, err := NewQLogFile(f)
</s> add q, err := newQLogFile(f) </s> remove // Nothing to read anymore
</s> add // Nothing to read anymore. </s> remove // NewQLogReader initializes a QLogReader instance
// with the specified files
func NewQLogReader(files []string) (*QLogReader, error) {
qFiles := make([]*QLogFile, 0)
</s> add // newQLogReader initializes a qLogReader instance with the specified files.
func newQLogReader(files []string) (*qLogReader, error) {
qFiles := make([]*qLogFile, 0) </s> remove // timestamp. If the record is found, it sets QLogReader's position to point to
// that line, so that the next ReadNext call returned this line.
func (r *QLogReader) seekTS(timestamp int64) (err error) {
</s> add // timestamp. If the record is found, it sets qLogReader's position to point
// to that line, so that the next ReadNext call returned this line.
func (r *qLogReader) seekTS(timestamp int64) (err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
return errors.List("error while closing qLogReader", errs...) | <mask> }
<mask> }
<mask>
<mask> if len(errs) > 0 {
<mask> return errors.List("error while closing QLogReader", errs...)
<mask> }
<mask>
<mask> return nil
<mask> }
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove cerr := closeQFiles(qFiles)
if cerr != nil {
log.Debug("querylog: closing files: %s", cerr)
</s> add cErr := closeQFiles(qFiles)
if cErr != nil {
log.Debug("querylog: closing files: %s", cErr) </s> remove log.Error("querylog: opening qlog reader: %s", err)
return entries, oldest, 0
}
defer func() {
closeErr := r.Close()
if closeErr != nil {
log.Error("querylog: closing file: %s", err)
}
}()
if params.olderThan.IsZero() {
err = r.SeekStart()
} else {
err = r.seekTS(params.olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
</s> add return nil, fmt.Errorf("opening qlog reader: %s", err) </s> remove if d, ok := delimToken.(json.Delim); ok {
if d != '[' {
log.Debug("decodeResultRules: unexpected delim %q", d)
}
} else {
</s> add if d, ok := delimToken.(json.Delim); !ok { </s> remove // Seek to this position
</s> add // Seek to this position. </s> remove i := 0
for {
var keyToken json.Token
keyToken, err = dec.Token()
if err != nil {
if err != io.EOF {
log.Debug("decodeResultRules err: %s", err)
}
return
</s> add err = decodeResultRuleToken(dec, ent)
if err != nil {
if err != io.EOF && !errors.Is(err, ErrEndOfToken) {
log.Debug("decodeResultRules err: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader.go |
// newTestQLogReader creates new *qLogReader for tests and registers the | <mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> // newTestQLogReader creates new *QLogReader for tests and registers the
<mask> // required cleanup functions.
<mask> func newTestQLogReader(t *testing.T, filesNum, linesNum int) (reader *QLogReader) {
<mask> t.Helper()
<mask>
<mask> testFiles := prepareTestFiles(t, filesNum, linesNum)
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove func newTestQLogReader(t *testing.T, filesNum, linesNum int) (reader *QLogReader) {
</s> add func newTestQLogReader(t *testing.T, filesNum, linesNum int) (reader *qLogReader) { </s> remove // newTestQLogFile creates new *QLogFile for tests and registers the required
</s> add // newTestQLogFile creates new *qLogFile for tests and registers the required </s> remove func newTestQLogFile(t *testing.T, linesNum int) (file *QLogFile) {
</s> add func newTestQLogFile(t *testing.T, linesNum int) (file *qLogFile) { </s> remove // Create the new QLogReader instance.
reader, err := NewQLogReader(testFiles)
</s> add // Create the new qLogReader instance.
reader, err := newQLogReader(testFiles) </s> remove // Create the new QLogFile instance.
file, err := NewQLogFile(testFile)
</s> add // Create the new qLogFile instance.
file, err := newQLogFile(testFile) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go |
func newTestQLogReader(t *testing.T, filesNum, linesNum int) (reader *qLogReader) { | <mask> )
<mask>
<mask> // newTestQLogReader creates new *QLogReader for tests and registers the
<mask> // required cleanup functions.
<mask> func newTestQLogReader(t *testing.T, filesNum, linesNum int) (reader *QLogReader) {
<mask> t.Helper()
<mask>
<mask> testFiles := prepareTestFiles(t, filesNum, linesNum)
<mask>
<mask> // Create the new QLogReader instance.
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // newTestQLogReader creates new *QLogReader for tests and registers the
</s> add // newTestQLogReader creates new *qLogReader for tests and registers the </s> remove func newTestQLogFile(t *testing.T, linesNum int) (file *QLogFile) {
</s> add func newTestQLogFile(t *testing.T, linesNum int) (file *qLogFile) { </s> remove // newTestQLogFile creates new *QLogFile for tests and registers the required
</s> add // newTestQLogFile creates new *qLogFile for tests and registers the required </s> remove // Create the new QLogReader instance.
reader, err := NewQLogReader(testFiles)
</s> add // Create the new qLogReader instance.
reader, err := newQLogReader(testFiles) </s> remove // Create the new QLogFile instance.
file, err := NewQLogFile(testFile)
</s> add // Create the new qLogFile instance.
file, err := newQLogFile(testFile) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go |
// Create the new qLogReader instance.
reader, err := newQLogReader(testFiles) | <mask> t.Helper()
<mask>
<mask> testFiles := prepareTestFiles(t, filesNum, linesNum)
<mask>
<mask> // Create the new QLogReader instance.
<mask> reader, err := NewQLogReader(testFiles)
<mask> require.NoError(t, err)
<mask>
<mask> assert.NotNil(t, reader)
<mask> testutil.CleanupAndRequireSuccess(t, reader.Close)
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Create the new QLogFile instance.
file, err := NewQLogFile(testFile)
</s> add // Create the new qLogFile instance.
file, err := newQLogFile(testFile) </s> remove func newTestQLogReader(t *testing.T, filesNum, linesNum int) (reader *QLogReader) {
</s> add func newTestQLogReader(t *testing.T, filesNum, linesNum int) (reader *qLogReader) { </s> remove // newTestQLogReader creates new *QLogReader for tests and registers the
</s> add // newTestQLogReader creates new *qLogReader for tests and registers the </s> remove // Create the new QLogFile instance.
</s> add // Create the new qLogFile instance. </s> remove func newTestQLogFile(t *testing.T, linesNum int) (file *QLogFile) {
</s> add func newTestQLogFile(t *testing.T, linesNum int) (file *qLogFile) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go |
want error | <mask>
<mask> testCases := []struct {
<mask> name string
<mask> time string
<mask> }{{
<mask> name: "not_too_old",
<mask> time: "2020-02-18T22:39:35.920973+03:00",
<mask> want: nil,
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove want error
</s> add </s> remove want error
</s> add </s> remove wantErr error
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go |
<mask>
<mask> testCases := []struct {
<mask> name string
<mask> time string
<mask> want error
<mask> }{{
<mask> name: "not_too_old",
<mask> time: "2020-02-18T22:39:35.920973+03:00",
<mask> want: nil,
<mask> }, {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove want error
</s> add </s> remove wantErr error
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go | |
want: errTSNotFound, | <mask> want: nil,
<mask> }, {
<mask> name: "non-existent_long_ago",
<mask> time: "2000-02-19T01:23:16.920973+03:00",
<mask> want: ErrTSNotFound,
<mask> }, {
<mask> name: "non-existent_far_ahead",
<mask> time: "2100-02-19T01:23:16.920973+03:00",
<mask> want: nil,
<mask> }, {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove want: ErrTSNotFound,
</s> add want: errTSNotFound, </s> remove want error
</s> add </s> remove want error
</s> add </s> remove wantErr: ErrTSTooLate,
</s> add wantErr: errTSTooLate, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go |
want: errTSNotFound, | <mask> want: nil,
<mask> }, {
<mask> name: "non-existent_but_could",
<mask> time: "2020-02-18T22:36:37.000000+03:00",
<mask> want: ErrTSNotFound,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> ts, err := time.Parse(time.RFC3339Nano, tc.time)
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove wantErr: ErrTSTooEarly,
</s> add wantErr: errTSTooEarly, </s> remove want: ErrTSNotFound,
</s> add want: errTSNotFound, </s> remove want error
</s> add </s> remove want error
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go |
want error | <mask> const filesNum = 1
<mask> r := newTestQLogReader(t, filesNum, linesNum)
<mask>
<mask> testCases := []struct {
<mask> name string
<mask> start int
<mask> }{{
<mask> name: "ok",
<mask> start: 0,
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove want error
</s> add </s> remove wantErr error
</s> add </s> remove want error
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go |
<mask>
<mask> testCases := []struct {
<mask> name string
<mask> start int
<mask> want error
<mask> }{{
<mask> name: "ok",
<mask> start: 0,
<mask> want: nil,
<mask> }, {
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove want error
</s> add </s> remove wantErr error
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/qlogreader_test.go | |
"fmt" | <mask>
<mask> import (
<mask> "io"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Timestamp not found errors.
</s> add </s> remove // searchParams represent the search query sent by the client
</s> add // searchParams represent the search query sent by the client. | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
"github.com/AdguardTeam/golibs/errors" | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "golang.org/x/exp/slices"
<mask> )
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // Timestamp not found errors.
</s> add </s> remove // QLogReader allows reading from multiple query log files in the reverse order.
</s> add // qLogReader allows reading from multiple query log files in the reverse
// order. | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
// seekRecord changes the current position to the next record older than the
// provided parameter.
func (r *qLogReader) seekRecord(olderThan time.Time) (err error) {
if olderThan.IsZero() {
return r.SeekStart()
}
err = r.seekTS(olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
return err
}
// setQLogReader creates a reader with the specified files and sets the
// position to the next record older than the provided parameter.
func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error) { | <mask>
<mask> return entries, oldest
<mask> }
<mask>
<mask> // searchFiles looks up log records from all log files. It optionally uses the
<mask> // client cache, if provided. searchFiles does not scan more than
<mask> // maxFileScanEntries so callers may need to call it several times to get all
<mask> // results. oldest and total are the time of the oldest processed entry and the
<mask> // total number of processed entries, including discarded ones, correspondingly.
<mask> func (l *queryLog) searchFiles(
<mask> params *searchParams,
<mask> cache clientCache,
<mask> ) (entries []*logEntry, oldest time.Time, total int) {
<mask> files := []string{
<mask> l.logFile + ".1",
<mask> l.logFile,
<mask> }
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // criteria. It optionally uses the client cache, if provided. e is nil if the
// entry doesn't match the search criteria. ts is the timestamp of the
</s> add // criteria. It optionally uses the client cache, if provided. e is nil if
// the entry doesn't match the search criteria. ts is the timestamp of the </s> remove r *QLogReader,
</s> add r *qLogReader, </s> remove // By default, we do not scan more than maxFileScanEntries at once. The
// idea is to make search calls faster so that the UI could handle it and
// show something quicker. This behavior can be overridden if
// maxFileScanEntries is set to 0.
</s> add // readEntries reads entries from the reader to totalLimit. By default, we do
// not scan more than maxFileScanEntries at once. The idea is to make search
// calls faster so that the UI could handle it and show something quicker.
// This behavior can be overridden if maxFileScanEntries is set to 0.
func (l *queryLog) readEntries(
r *qLogReader,
params *searchParams,
cache clientCache,
totalLimit int,
) (entries []*logEntry, oldestNano int64, total int) { </s> remove // olderThen - return entries that are older than this value
// if not set - disregard it and return any value
olderThan time.Time
</s> add // offset for the search.
offset int
// limit the number of records returned.
limit int </s> remove offset int // offset for the search
limit int // limit the number of records returned
maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
</s> add // maxFileScanEntries is a maximum of log entries to scan in query log
// files. If not set, then no limit.
maxFileScanEntries int | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
r, err := newQLogReader(files) | <mask> l.logFile + ".1",
<mask> l.logFile,
<mask> }
<mask>
<mask> r, err := NewQLogReader(files)
<mask> if err != nil {
<mask> log.Error("querylog: opening qlog reader: %s", err)
<mask>
<mask> return entries, oldest, 0
<mask> }
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove log.Error("querylog: opening qlog reader: %s", err)
return entries, oldest, 0
}
defer func() {
closeErr := r.Close()
if closeErr != nil {
log.Error("querylog: closing file: %s", err)
}
}()
if params.olderThan.IsZero() {
err = r.SeekStart()
} else {
err = r.seekTS(params.olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
</s> add return nil, fmt.Errorf("opening qlog reader: %s", err) </s> remove return entries, oldest, 0
</s> add return nil, nil </s> remove log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
</s> add defer func() { err = errors.WithDeferred(err, r.Close()) }()
log.Debug("querylog: cannot seek to %s: %s", olderThan, err) </s> remove totalLimit := params.offset + params.limit
oldestNano := int64(0)
</s> add return r, nil
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
return nil, fmt.Errorf("opening qlog reader: %s", err) | <mask> }
<mask>
<mask> r, err := NewQLogReader(files)
<mask> if err != nil {
<mask> log.Error("querylog: opening qlog reader: %s", err)
<mask>
<mask> return entries, oldest, 0
<mask> }
<mask>
<mask> defer func() {
<mask> closeErr := r.Close()
<mask> if closeErr != nil {
<mask> log.Error("querylog: closing file: %s", err)
<mask> }
<mask> }()
<mask>
<mask> if params.olderThan.IsZero() {
<mask> err = r.SeekStart()
<mask> } else {
<mask> err = r.seekTS(params.olderThan.UnixNano())
<mask> if err == nil {
<mask> // Read to the next record, because we only need the one that goes
<mask> // after it.
<mask> _, err = r.ReadNext()
<mask> }
<mask> }
<mask>
<mask> if err != nil {
<mask> log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
</s> add defer func() { err = errors.WithDeferred(err, r.Close()) }()
log.Debug("querylog: cannot seek to %s: %s", olderThan, err) </s> remove r, err := NewQLogReader(files)
</s> add r, err := newQLogReader(files) </s> remove return entries, oldest, 0
</s> add return nil, nil </s> remove // searchFiles looks up log records from all log files. It optionally uses the
// client cache, if provided. searchFiles does not scan more than
// maxFileScanEntries so callers may need to call it several times to get all
// results. oldest and total are the time of the oldest processed entry and the
// total number of processed entries, including discarded ones, correspondingly.
func (l *queryLog) searchFiles(
params *searchParams,
cache clientCache,
) (entries []*logEntry, oldest time.Time, total int) {
</s> add // seekRecord changes the current position to the next record older than the
// provided parameter.
func (r *qLogReader) seekRecord(olderThan time.Time) (err error) {
if olderThan.IsZero() {
return r.SeekStart()
}
err = r.seekTS(olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
return err
}
// setQLogReader creates a reader with the specified files and sets the
// position to the next record older than the provided parameter.
func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"ke... | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
err = r.seekRecord(olderThan) | <mask> return nil, fmt.Errorf("opening qlog reader: %s", err)
<mask> }
<mask>
<mask> if err != nil {
<mask> defer func() { err = errors.WithDeferred(err, r.Close()) }()
<mask> log.Debug("querylog: cannot seek to %s: %s", olderThan, err)
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
</s> add defer func() { err = errors.WithDeferred(err, r.Close()) }()
log.Debug("querylog: cannot seek to %s: %s", olderThan, err) </s> remove log.Error("querylog: opening qlog reader: %s", err)
return entries, oldest, 0
}
defer func() {
closeErr := r.Close()
if closeErr != nil {
log.Error("querylog: closing file: %s", err)
}
}()
if params.olderThan.IsZero() {
err = r.SeekStart()
} else {
err = r.seekTS(params.olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
</s> add return nil, fmt.Errorf("opening qlog reader: %s", err) </s> remove return entries, oldest, 0
</s> add return nil, nil </s> remove r, err := NewQLogReader(files)
</s> add r, err := newQLogReader(files) </s> remove cerr := closeQFiles(qFiles)
if cerr != nil {
log.Debug("querylog: closing files: %s", cerr)
</s> add cErr := closeQFiles(qFiles)
if cErr != nil {
log.Debug("querylog: closing files: %s", cErr) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
defer func() { err = errors.WithDeferred(err, r.Close()) }()
log.Debug("querylog: cannot seek to %s: %s", olderThan, err) | <mask> }
<mask> }
<mask>
<mask> if err != nil {
<mask> log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
<mask>
<mask> return entries, oldest, 0
<mask> }
<mask>
<mask> totalLimit := params.offset + params.limit
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove return entries, oldest, 0
</s> add return nil, nil </s> remove log.Error("querylog: opening qlog reader: %s", err)
return entries, oldest, 0
}
defer func() {
closeErr := r.Close()
if closeErr != nil {
log.Error("querylog: closing file: %s", err)
}
}()
if params.olderThan.IsZero() {
err = r.SeekStart()
} else {
err = r.seekTS(params.olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
</s> add return nil, fmt.Errorf("opening qlog reader: %s", err) </s> remove r, err := NewQLogReader(files)
</s> add r, err := newQLogReader(files) </s> remove totalLimit := params.offset + params.limit
oldestNano := int64(0)
</s> add return r, nil
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
return nil, nil | <mask>
<mask> if err != nil {
<mask> log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
<mask>
<mask> return entries, oldest, 0
<mask> }
<mask>
<mask> totalLimit := params.offset + params.limit
<mask> oldestNano := int64(0)
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
</s> add defer func() { err = errors.WithDeferred(err, r.Close()) }()
log.Debug("querylog: cannot seek to %s: %s", olderThan, err) </s> remove log.Error("querylog: opening qlog reader: %s", err)
return entries, oldest, 0
}
defer func() {
closeErr := r.Close()
if closeErr != nil {
log.Error("querylog: closing file: %s", err)
}
}()
if params.olderThan.IsZero() {
err = r.SeekStart()
} else {
err = r.seekTS(params.olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
</s> add return nil, fmt.Errorf("opening qlog reader: %s", err) </s> remove totalLimit := params.offset + params.limit
oldestNano := int64(0)
</s> add return r, nil
} </s> remove r, err := NewQLogReader(files)
</s> add r, err := newQLogReader(files) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
return r, nil
} | <mask>
<mask> return entries, oldest, 0
<mask> }
<mask>
<mask> totalLimit := params.offset + params.limit
<mask> oldestNano := int64(0)
<mask>
<mask> // By default, we do not scan more than maxFileScanEntries at once. The
<mask> // idea is to make search calls faster so that the UI could handle it and
<mask> // show something quicker. This behavior can be overridden if
<mask> // maxFileScanEntries is set to 0.
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // By default, we do not scan more than maxFileScanEntries at once. The
// idea is to make search calls faster so that the UI could handle it and
// show something quicker. This behavior can be overridden if
// maxFileScanEntries is set to 0.
</s> add // readEntries reads entries from the reader to totalLimit. By default, we do
// not scan more than maxFileScanEntries at once. The idea is to make search
// calls faster so that the UI could handle it and show something quicker.
// This behavior can be overridden if maxFileScanEntries is set to 0.
func (l *queryLog) readEntries(
r *qLogReader,
params *searchParams,
cache clientCache,
totalLimit int,
) (entries []*logEntry, oldestNano int64, total int) { </s> remove var e *logEntry
var ts int64
e, ts, err = l.readNextEntry(r, params, cache)
if err != nil {
if err == io.EOF {
</s> add ent, ts, rErr := l.readNextEntry(r, params, cache)
if rErr != nil {
if rErr == io.EOF { </s> remove return entries, oldest, 0
</s> add return nil, nil </s> remove offset int // offset for the search
limit int // limit the number of records returned
maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
</s> add // maxFileScanEntries is a maximum of log entries to scan in query log
// files. If not set, then no limit.
maxFileScanEntries int </s> remove // olderThen - return entries that are older than this value
// if not set - disregard it and return any value
olderThan time.Time
</s> add // offset for the search.
offset int
// limit the number of records returned.
limit int | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
// readEntries reads entries from the reader to totalLimit. By default, we do
// not scan more than maxFileScanEntries at once. The idea is to make search
// calls faster so that the UI could handle it and show something quicker.
// This behavior can be overridden if maxFileScanEntries is set to 0.
func (l *queryLog) readEntries(
r *qLogReader,
params *searchParams,
cache clientCache,
totalLimit int,
) (entries []*logEntry, oldestNano int64, total int) { | <mask>
<mask> totalLimit := params.offset + params.limit
<mask> oldestNano := int64(0)
<mask>
<mask> // By default, we do not scan more than maxFileScanEntries at once. The
<mask> // idea is to make search calls faster so that the UI could handle it and
<mask> // show something quicker. This behavior can be overridden if
<mask> // maxFileScanEntries is set to 0.
<mask> for total < params.maxFileScanEntries || params.maxFileScanEntries <= 0 {
<mask> var e *logEntry
<mask> var ts int64
<mask>
<mask> e, ts, err = l.readNextEntry(r, params, cache)
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove var e *logEntry
var ts int64
e, ts, err = l.readNextEntry(r, params, cache)
if err != nil {
if err == io.EOF {
</s> add ent, ts, rErr := l.readNextEntry(r, params, cache)
if rErr != nil {
if rErr == io.EOF { </s> remove totalLimit := params.offset + params.limit
oldestNano := int64(0)
</s> add return r, nil
} </s> remove offset int // offset for the search
limit int // limit the number of records returned
maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
</s> add // maxFileScanEntries is a maximum of log entries to scan in query log
// files. If not set, then no limit.
maxFileScanEntries int </s> remove // olderThen - return entries that are older than this value
// if not set - disregard it and return any value
olderThan time.Time
</s> add // offset for the search.
offset int
// limit the number of records returned.
limit int </s> remove // searchFiles looks up log records from all log files. It optionally uses the
// client cache, if provided. searchFiles does not scan more than
// maxFileScanEntries so callers may need to call it several times to get all
// results. oldest and total are the time of the oldest processed entry and the
// total number of processed entries, including discarded ones, correspondingly.
func (l *queryLog) searchFiles(
params *searchParams,
cache clientCache,
) (entries []*logEntry, oldest time.Time, total int) {
</s> add // seekRecord changes the current position to the next record older than the
// provided parameter.
func (r *qLogReader) seekRecord(olderThan time.Time) (err error) {
if olderThan.IsZero() {
return r.SeekStart()
}
err = r.seekTS(olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
return err
}
// setQLogReader creates a reader with the specified files and sets the
// position to the next record older than the provided parameter.
func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
ent, ts, rErr := l.readNextEntry(r, params, cache)
if rErr != nil {
if rErr == io.EOF { | <mask> // idea is to make search calls faster so that the UI could handle it and
<mask> // show something quicker. This behavior can be overridden if
<mask> // maxFileScanEntries is set to 0.
<mask> for total < params.maxFileScanEntries || params.maxFileScanEntries <= 0 {
<mask> var e *logEntry
<mask> var ts int64
<mask>
<mask> e, ts, err = l.readNextEntry(r, params, cache)
<mask> if err != nil {
<mask> if err == io.EOF {
<mask> oldestNano = 0
<mask>
<mask> break
<mask> }
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // By default, we do not scan more than maxFileScanEntries at once. The
// idea is to make search calls faster so that the UI could handle it and
// show something quicker. This behavior can be overridden if
// maxFileScanEntries is set to 0.
</s> add // readEntries reads entries from the reader to totalLimit. By default, we do
// not scan more than maxFileScanEntries at once. The idea is to make search
// calls faster so that the UI could handle it and show something quicker.
// This behavior can be overridden if maxFileScanEntries is set to 0.
func (l *queryLog) readEntries(
r *qLogReader,
params *searchParams,
cache clientCache,
totalLimit int,
) (entries []*logEntry, oldestNano int64, total int) { </s> remove totalLimit := params.offset + params.limit
oldestNano := int64(0)
</s> add return r, nil
} </s> remove if e != nil {
entries = append(entries, e)
if len(entries) == totalLimit {
break
}
</s> add if ent == nil {
continue
}
entries = append(entries, ent)
if len(entries) == totalLimit {
break </s> remove return &QLogFile{
file: f,
}, nil
</s> add return &qLogFile{file: f}, nil
}
// validateQLogLineIdx returns error if the line index is not valid to continue
// search.
func (q *qLogFile) validateQLogLineIdx(lineIdx, lastProbeLineIdx, ts, fSize int64) (err error) {
if lineIdx == lastProbeLineIdx {
if lineIdx == 0 {
return errTSTooEarly
}
// If we're testing the same line twice then most likely the scope is
// too narrow and we won't find anything anymore in any other file.
return fmt.Errorf("looking up timestamp %d in %q: %w", ts, q.file.Name(), errTSNotFound)
} else if lineIdx == fSize {
return errTSTooLate
}
return nil </s> remove // Shift to the older file
</s> add // Shift to the older file. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
log.Error("querylog: reading next entry: %s", rErr) | <mask>
<mask> break
<mask> }
<mask>
<mask> log.Error("querylog: reading next entry: %s", err)
<mask> }
<mask>
<mask> oldestNano = ts
<mask> total++
<mask>
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove if e != nil {
entries = append(entries, e)
if len(entries) == totalLimit {
break
}
</s> add if ent == nil {
continue
}
entries = append(entries, ent)
if len(entries) == totalLimit {
break </s> remove log.Error("querylog: opening qlog reader: %s", err)
return entries, oldest, 0
}
defer func() {
closeErr := r.Close()
if closeErr != nil {
log.Error("querylog: closing file: %s", err)
}
}()
if params.olderThan.IsZero() {
err = r.SeekStart()
} else {
err = r.seekTS(params.olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
</s> add return nil, fmt.Errorf("opening qlog reader: %s", err) </s> remove r, err := NewQLogReader(files)
</s> add r, err := newQLogReader(files) </s> remove return entries, oldest, 0
</s> add return nil, nil </s> remove log.Debug("querylog: cannot seek to %s: %s", params.olderThan, err)
</s> add defer func() { err = errors.WithDeferred(err, r.Close()) }()
log.Debug("querylog: cannot seek to %s: %s", olderThan, err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
if ent == nil {
continue
}
entries = append(entries, ent)
if len(entries) == totalLimit {
break | <mask>
<mask> oldestNano = ts
<mask> total++
<mask>
<mask> if e != nil {
<mask> entries = append(entries, e)
<mask> if len(entries) == totalLimit {
<mask> break
<mask> }
<mask> }
<mask> }
<mask>
<mask> if oldestNano != 0 {
<mask> oldest = time.Unix(0, oldestNano)
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove var e *logEntry
var ts int64
e, ts, err = l.readNextEntry(r, params, cache)
if err != nil {
if err == io.EOF {
</s> add ent, ts, rErr := l.readNextEntry(r, params, cache)
if rErr != nil {
if rErr == io.EOF { </s> remove return entries, oldest, 0
</s> add return nil, nil </s> remove log.Error("querylog: reading next entry: %s", err)
</s> add log.Error("querylog: reading next entry: %s", rErr) </s> remove // Shift position
</s> add // Shift position. </s> remove // Save the last found idx
</s> add // Save the last found idx. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
// criteria. It optionally uses the client cache, if provided. e is nil if
// the entry doesn't match the search criteria. ts is the timestamp of the | <mask> return c
<mask> }
<mask>
<mask> // readNextEntry reads the next log entry and checks if it matches the search
<mask> // criteria. It optionally uses the client cache, if provided. e is nil if the
<mask> // entry doesn't match the search criteria. ts is the timestamp of the
<mask> // processed entry.
<mask> func (l *queryLog) readNextEntry(
<mask> r *QLogReader,
<mask> params *searchParams,
<mask> cache clientCache,
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove r *QLogReader,
</s> add r *qLogReader, </s> remove // searchFiles looks up log records from all log files. It optionally uses the
// client cache, if provided. searchFiles does not scan more than
// maxFileScanEntries so callers may need to call it several times to get all
// results. oldest and total are the time of the oldest processed entry and the
// total number of processed entries, including discarded ones, correspondingly.
func (l *queryLog) searchFiles(
params *searchParams,
cache clientCache,
) (entries []*logEntry, oldest time.Time, total int) {
</s> add // seekRecord changes the current position to the next record older than the
// provided parameter.
func (r *qLogReader) seekRecord(olderThan time.Time) (err error) {
if olderThan.IsZero() {
return r.SeekStart()
}
err = r.seekTS(olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
return err
}
// setQLogReader creates a reader with the specified files and sets the
// position to the next record older than the provided parameter.
func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error) { </s> remove // By default, we do not scan more than maxFileScanEntries at once. The
// idea is to make search calls faster so that the UI could handle it and
// show something quicker. This behavior can be overridden if
// maxFileScanEntries is set to 0.
</s> add // readEntries reads entries from the reader to totalLimit. By default, we do
// not scan more than maxFileScanEntries at once. The idea is to make search
// calls faster so that the UI could handle it and show something quicker.
// This behavior can be overridden if maxFileScanEntries is set to 0.
func (l *queryLog) readEntries(
r *qLogReader,
params *searchParams,
cache clientCache,
totalLimit int,
) (entries []*logEntry, oldestNano int64, total int) { </s> remove // 1. It starts with the position in the middle of a file
// 2. Shifts back to the beginning of the line
// 3. Checks the log record timestamp
// 4. If it is lower than the timestamp we are looking for,
// it shifts seek position to 3/4 of the file. Otherwise, to 1/4 of the file.
// 5. It performs the search again, every time the search scope is narrowed twice.
</s> add // 1. It starts with the position in the middle of a file.
// 2. Shifts back to the beginning of the line.
// 3. Checks the log record timestamp.
// 4. If it is lower than the timestamp we are looking for, it shifts seek
// position to 3/4 of the file. Otherwise, to 1/4 of the file.
// 5. It performs the search again, every time the search scope is narrowed
// twice. </s> remove // Hurray, returning the result
</s> add // Hurray, returning the result. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
r *qLogReader, | <mask> // criteria. It optionally uses the client cache, if provided. e is nil if the
<mask> // entry doesn't match the search criteria. ts is the timestamp of the
<mask> // processed entry.
<mask> func (l *queryLog) readNextEntry(
<mask> r *QLogReader,
<mask> params *searchParams,
<mask> cache clientCache,
<mask> ) (e *logEntry, ts int64, err error) {
<mask> var line string
<mask> line, err = r.ReadNext()
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // criteria. It optionally uses the client cache, if provided. e is nil if the
// entry doesn't match the search criteria. ts is the timestamp of the
</s> add // criteria. It optionally uses the client cache, if provided. e is nil if
// the entry doesn't match the search criteria. ts is the timestamp of the </s> remove // searchFiles looks up log records from all log files. It optionally uses the
// client cache, if provided. searchFiles does not scan more than
// maxFileScanEntries so callers may need to call it several times to get all
// results. oldest and total are the time of the oldest processed entry and the
// total number of processed entries, including discarded ones, correspondingly.
func (l *queryLog) searchFiles(
params *searchParams,
cache clientCache,
) (entries []*logEntry, oldest time.Time, total int) {
</s> add // seekRecord changes the current position to the next record older than the
// provided parameter.
func (r *qLogReader) seekRecord(olderThan time.Time) (err error) {
if olderThan.IsZero() {
return r.SeekStart()
}
err = r.seekTS(olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
return err
}
// setQLogReader creates a reader with the specified files and sets the
// position to the next record older than the provided parameter.
func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error) { </s> remove // By default, we do not scan more than maxFileScanEntries at once. The
// idea is to make search calls faster so that the UI could handle it and
// show something quicker. This behavior can be overridden if
// maxFileScanEntries is set to 0.
</s> add // readEntries reads entries from the reader to totalLimit. By default, we do
// not scan more than maxFileScanEntries at once. The idea is to make search
// calls faster so that the UI could handle it and show something quicker.
// This behavior can be overridden if maxFileScanEntries is set to 0.
func (l *queryLog) readEntries(
r *qLogReader,
params *searchParams,
cache clientCache,
totalLimit int,
) (entries []*logEntry, oldestNano int64, total int) { </s> remove return 0, depth, fmt.Errorf("looking up timestamp %d in %q: record %q has empty timestamp", timestamp, q.file.Name(), line)
</s> add return 0, depth, fmt.Errorf(
"looking up timestamp %d in %q: record %q has empty timestamp",
timestamp,
q.file.Name(),
line,
) </s> remove // Hurray, returning the result
</s> add // Hurray, returning the result. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/search.go |
// searchParams represent the search query sent by the client. | <mask> package querylog
<mask>
<mask> import "time"
<mask>
<mask> // searchParams represent the search query sent by the client
<mask> type searchParams struct {
<mask> // searchCriteria - list of search criteria that we use to get filter results
<mask> searchCriteria []searchCriterion
<mask>
<mask> // olderThen - return entries that are older than this value
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // searchCriteria - list of search criteria that we use to get filter results
</s> add // olderThen represents a parameter for entries that are older than this
// parameter value. If not set, disregard it and return any value.
olderThan time.Time
// searchCriteria is a list of search criteria that we use to get filter
// results. </s> remove // olderThen - return entries that are older than this value
// if not set - disregard it and return any value
olderThan time.Time
</s> add // offset for the search.
offset int
// limit the number of records returned.
limit int </s> remove offset int // offset for the search
limit int // limit the number of records returned
maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
</s> add // maxFileScanEntries is a maximum of log entries to scan in query log
// files. If not set, then no limit.
maxFileScanEntries int </s> remove // readProbeLine reads a line that includes the specified position
// this method is supposed to be used when we use binary search in the Seek method
// in the case of consecutive reads, use readNext (it uses a better buffer)
func (q *QLogFile) readProbeLine(position int64) (string, int64, int64, error) {
// First of all, we should read a buffer that will include the query log line
// In order to do this, we'll define the boundaries
</s> add // readProbeLine reads a line that includes the specified position. This
// method is supposed to be used when we use binary search in the Seek method.
// In the case of consecutive reads, use readNext, cause it uses better buffer.
func (q *qLogFile) readProbeLine(position int64) (string, int64, int64, error) {
// First of all, we should read a buffer that will include the query log
// line. In order to do this, we'll define the boundaries. </s> remove // * It returns the position of the the line with the timestamp we were looking for
// 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) {
</s> add // - It returns the position of the line with the timestamp we were looking
// for 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) (pos int64, depth int, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/searchparams.go |
// olderThen represents a parameter for entries that are older than this
// parameter value. If not set, disregard it and return any value.
olderThan time.Time
// searchCriteria is a list of search criteria that we use to get filter
// results. | <mask> import "time"
<mask>
<mask> // searchParams represent the search query sent by the client
<mask> type searchParams struct {
<mask> // searchCriteria - list of search criteria that we use to get filter results
<mask> searchCriteria []searchCriterion
<mask>
<mask> // olderThen - return entries that are older than this value
<mask> // if not set - disregard it and return any value
<mask> olderThan time.Time
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // searchParams represent the search query sent by the client
</s> add // searchParams represent the search query sent by the client. </s> remove // olderThen - return entries that are older than this value
// if not set - disregard it and return any value
olderThan time.Time
</s> add // offset for the search.
offset int
// limit the number of records returned.
limit int </s> remove offset int // offset for the search
limit int // limit the number of records returned
maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
</s> add // maxFileScanEntries is a maximum of log entries to scan in query log
// files. If not set, then no limit.
maxFileScanEntries int </s> remove // * It returns the position of the the line with the timestamp we were looking for
// 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) {
</s> add // - It returns the position of the line with the timestamp we were looking
// for 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) (pos int64, depth int, err error) { </s> remove // readProbeLine reads a line that includes the specified position
// this method is supposed to be used when we use binary search in the Seek method
// in the case of consecutive reads, use readNext (it uses a better buffer)
func (q *QLogFile) readProbeLine(position int64) (string, int64, int64, error) {
// First of all, we should read a buffer that will include the query log line
// In order to do this, we'll define the boundaries
</s> add // readProbeLine reads a line that includes the specified position. This
// method is supposed to be used when we use binary search in the Seek method.
// In the case of consecutive reads, use readNext, cause it uses better buffer.
func (q *qLogFile) readProbeLine(position int64) (string, int64, int64, error) {
// First of all, we should read a buffer that will include the query log
// line. In order to do this, we'll define the boundaries. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/searchparams.go |
// offset for the search.
offset int
// limit the number of records returned.
limit int | <mask> type searchParams struct {
<mask> // searchCriteria - list of search criteria that we use to get filter results
<mask> searchCriteria []searchCriterion
<mask>
<mask> // olderThen - return entries that are older than this value
<mask> // if not set - disregard it and return any value
<mask> olderThan time.Time
<mask>
<mask> offset int // offset for the search
<mask> limit int // limit the number of records returned
<mask> maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
<mask> }
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove offset int // offset for the search
limit int // limit the number of records returned
maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
</s> add // maxFileScanEntries is a maximum of log entries to scan in query log
// files. If not set, then no limit.
maxFileScanEntries int </s> remove // searchCriteria - list of search criteria that we use to get filter results
</s> add // olderThen represents a parameter for entries that are older than this
// parameter value. If not set, disregard it and return any value.
olderThan time.Time
// searchCriteria is a list of search criteria that we use to get filter
// results. </s> remove // searchParams represent the search query sent by the client
</s> add // searchParams represent the search query sent by the client. </s> remove // Please note that this is a stateful object.
// Internally, it contains a pointer to a particular query log file, and
// to a specific position in this file, and it reads lines in reverse order
// starting from that position.
type QLogReader struct {
// qFiles - array with the query log files
// The order is - from oldest to newest
qFiles []*QLogFile
currentFile int // Index of the current file
</s> add // Please note that this is a stateful object. Internally, it contains a
// pointer to a particular query log file, and to a specific position in this
// file, and it reads lines in reverse order starting from that position.
type qLogReader struct {
// qFiles is an array with the query log files. The order is from oldest
// to newest.
qFiles []*qLogFile
// currentFile is the index of the current file.
currentFile int </s> remove // searchFiles looks up log records from all log files. It optionally uses the
// client cache, if provided. searchFiles does not scan more than
// maxFileScanEntries so callers may need to call it several times to get all
// results. oldest and total are the time of the oldest processed entry and the
// total number of processed entries, including discarded ones, correspondingly.
func (l *queryLog) searchFiles(
params *searchParams,
cache clientCache,
) (entries []*logEntry, oldest time.Time, total int) {
</s> add // seekRecord changes the current position to the next record older than the
// provided parameter.
func (r *qLogReader) seekRecord(olderThan time.Time) (err error) {
if olderThan.IsZero() {
return r.SeekStart()
}
err = r.seekTS(olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
return err
}
// setQLogReader creates a reader with the specified files and sets the
// position to the next record older than the provided parameter.
func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/searchparams.go |
// maxFileScanEntries is a maximum of log entries to scan in query log
// files. If not set, then no limit.
maxFileScanEntries int | <mask> // olderThen - return entries that are older than this value
<mask> // if not set - disregard it and return any value
<mask> olderThan time.Time
<mask>
<mask> offset int // offset for the search
<mask> limit int // limit the number of records returned
<mask> maxFileScanEntries int // maximum log entries to scan in query log files. if 0 - no limit
<mask> }
<mask>
<mask> // newSearchParams - creates an empty instance of searchParams
<mask> func newSearchParams() *searchParams {
<mask> return &searchParams{
</s> Pull request: querylog imp code
Merge in DNS/adguard-home from querylog-imp-code to master
Squashed commit of the following:
commit a58ad36508a2355b686d314dec51ac0b5e357281
Merge: df5494f2c 941eb1dd7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:26:55 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit df5494f2c337736690a3c2a547c2d71858d0378f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 15:24:43 2023 +0300
querylog: imp code
commit 8c3c2b76dd5858e7b107f222c112e9cde2477fb3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:14:15 2023 +0300
all: lint script
commit be04a4decfaf20a1649d32ecaab3c1c6bb205ffd
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 12:03:12 2023 +0300
querylog: imp code
commit fe7beacff3a5cfcf2332c4998b9c65820284eaf7
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:57:33 2023 +0300
querylog: imp docs
commit 2ae239c57d12524fbc092f582842af2ad726c1d0
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:46:54 2023 +0300
querylog: imp code
commit 417216cefbf154fa870f8f43468f35e0e345971f
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:25:44 2023 +0300
querylog: imp code
commit 514b6ee99113844a4e0dad30dc53703e3220c289
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Wed May 24 11:14:13 2023 +0300
querylog: imp docs
commit 321351a3abb524208daacd5a3a7fbf5f07ab259d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:38:31 2023 +0300
querylog: imp code
commit ee91de5c43210b5bc213f933d411adb894d2e586
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 16:01:32 2023 +0300
querylog: imp code
commit 862ff12177fb769d5cb2ec250eaee538dc91d70a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 15:07:24 2023 +0300
querylog: imp code
commit cc62c1c4ae8b813d03ccf51b596ba1ebf44d9a1f
Merge: 37ace34e9 24b41100c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 13:09:10 2023 +0300
Merge remote-tracking branch 'origin/master' into querylog-imp-code
commit 37ace34e91e5189bef6e774db960f40cdaa18270
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:23:08 2023 +0300
querylog: imp code
commit 8417815a6349f10b5dbad410ce28aab98bc479fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Mon May 22 11:08:29 2023 +0300
querylog: imp docs
commit 4e5cde74d25713f78675aa3e18083b4fb5e619f3
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:41:34 2023 +0300
querylog: imp code
commit 3494eab7006240f652a0217d305ac916bd6c3c83
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:13:08 2023 +0300
all: lint script
commit 704534ce6278e7d9b1bef30a3acc4e59f25693bc
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 16:12:04 2023 +0300
querylog: imp code
commit 48510102a2fa5187f78067d2b9157dac62f8bb56
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:52:57 2023 +0300
querylog: imp code
commit 89c273aea0e6758eb749a2d3bbaf1bc385a57797
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 15:40:50 2023 +0300
querylog: imp code
commit 0057fe64553ad38de0fda10efb9d3512c9a00e45
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri May 19 13:54:46 2023 +0300
querylog: imp code
... and 1 more commit </s> remove // olderThen - return entries that are older than this value
// if not set - disregard it and return any value
olderThan time.Time
</s> add // offset for the search.
offset int
// limit the number of records returned.
limit int </s> remove // searchCriteria - list of search criteria that we use to get filter results
</s> add // olderThen represents a parameter for entries that are older than this
// parameter value. If not set, disregard it and return any value.
olderThan time.Time
// searchCriteria is a list of search criteria that we use to get filter
// results. </s> remove // searchParams represent the search query sent by the client
</s> add // searchParams represent the search query sent by the client. </s> remove // Please note that this is a stateful object.
// Internally, it contains a pointer to a particular query log file, and
// to a specific position in this file, and it reads lines in reverse order
// starting from that position.
type QLogReader struct {
// qFiles - array with the query log files
// The order is - from oldest to newest
qFiles []*QLogFile
currentFile int // Index of the current file
</s> add // Please note that this is a stateful object. Internally, it contains a
// pointer to a particular query log file, and to a specific position in this
// file, and it reads lines in reverse order starting from that position.
type qLogReader struct {
// qFiles is an array with the query log files. The order is from oldest
// to newest.
qFiles []*qLogFile
// currentFile is the index of the current file.
currentFile int </s> remove // searchFiles looks up log records from all log files. It optionally uses the
// client cache, if provided. searchFiles does not scan more than
// maxFileScanEntries so callers may need to call it several times to get all
// results. oldest and total are the time of the oldest processed entry and the
// total number of processed entries, including discarded ones, correspondingly.
func (l *queryLog) searchFiles(
params *searchParams,
cache clientCache,
) (entries []*logEntry, oldest time.Time, total int) {
</s> add // seekRecord changes the current position to the next record older than the
// provided parameter.
func (r *qLogReader) seekRecord(olderThan time.Time) (err error) {
if olderThan.IsZero() {
return r.SeekStart()
}
err = r.seekTS(olderThan.UnixNano())
if err == nil {
// Read to the next record, because we only need the one that goes
// after it.
_, err = r.ReadNext()
}
return err
}
// setQLogReader creates a reader with the specified files and sets the
// position to the next record older than the provided parameter.
func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2 | internal/querylog/searchparams.go |
const hintClass = classNames('icons mr-4 icon--24 logs__question icon--lightgray', { | <mask> 'mt-2': isDetailed && !client_info?.name && !whoisAvailable,
<mask> 'white-space--nowrap': isDetailed,
<mask> });
<mask>
<mask> const hintClass = classNames('icons mr-4 icon--24 icon--lightgray', {
<mask> 'my-3': isDetailed,
<mask> });
<mask>
<mask> const renderBlockingButton = (isFiltered, domain) => {
<mask> const buttonType = isFiltered ? BLOCK_ACTIONS.UNBLOCK : BLOCK_ACTIONS.BLOCK;
</s> Pull request: 4815 fix query log modal on tablet
Updates #4815
Squashed commit of the following:
commit 148c39ac40963a593885b86a0c851b4010b68ab0
Merge: 3447611d ab6da05b
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Sep 20 13:21:06 2022 +0300
Merge branch 'master' into 4815-tablet-view
commit 3447611dc0b1c7d2cc1f8235d1c469dd92736166
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Sep 16 17:01:05 2022 +0300
client: fix query log modal on tablet </s> remove const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block', {
</s> add const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block logs__question', { </s> remove className={classNames('icons mr-4 icon--24 icon--lightgray', { 'my-3': isDetailed })}
</s> add className={classNames('icons mr-4 icon--24 icon--lightgray logs__question', { 'my-3': isDetailed })} </s> remove <Modal portalClassName='grid' isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: 0,
top: 47,
padding: '1rem 1.5rem 1rem',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}}
</s> add <Modal
portalClassName='grid'
isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: '50%',
top: 47,
padding: '1rem 1.5rem 1rem',
maxWidth: '720px',
transform: 'translateX(-50%)',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}} </s> remove
.grid .key-colon, .grid .title--border {
font-weight: 600;
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cc2388e0c888dff725fdc032c35143e346155c8a | client/src/components/Logs/Cells/ClientCell.js |
const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block logs__question', { | <mask> 'icon--disabled': !answer_dnssec,
<mask> 'my-3': isDetailed,
<mask> });
<mask>
<mask> const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block', {
<mask> 'icon--green': hasTracker,
<mask> 'icon--disabled': !hasTracker,
<mask> 'my-3': isDetailed,
<mask> });
<mask>
</s> Pull request: 4815 fix query log modal on tablet
Updates #4815
Squashed commit of the following:
commit 148c39ac40963a593885b86a0c851b4010b68ab0
Merge: 3447611d ab6da05b
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Sep 20 13:21:06 2022 +0300
Merge branch 'master' into 4815-tablet-view
commit 3447611dc0b1c7d2cc1f8235d1c469dd92736166
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Sep 16 17:01:05 2022 +0300
client: fix query log modal on tablet </s> remove const hintClass = classNames('icons mr-4 icon--24 icon--lightgray', {
</s> add const hintClass = classNames('icons mr-4 icon--24 logs__question icon--lightgray', { </s> remove className={classNames('icons mr-4 icon--24 icon--lightgray', { 'my-3': isDetailed })}
</s> add className={classNames('icons mr-4 icon--24 icon--lightgray logs__question', { 'my-3': isDetailed })} </s> remove <Modal portalClassName='grid' isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: 0,
top: 47,
padding: '1rem 1.5rem 1rem',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}}
</s> add <Modal
portalClassName='grid'
isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: '50%',
top: 47,
padding: '1rem 1.5rem 1rem',
maxWidth: '720px',
transform: 'translateX(-50%)',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}} </s> remove
.grid .key-colon, .grid .title--border {
font-weight: 600;
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cc2388e0c888dff725fdc032c35143e346155c8a | client/src/components/Logs/Cells/DomainCell.js |
@media (max-width: 1024px) {
.grid .key-colon, .grid .title--border {
font-weight: 600;
}
}
| <mask> .grid--title:not(:first-child) {
<mask> padding-top: 1rem;
<mask> }
<mask>
<mask> @media (max-width: 767.98px) {
<mask> .grid {
<mask> grid-template-columns: 35% 55%;
<mask> }
<mask>
</s> Pull request: 4815 fix query log modal on tablet
Updates #4815
Squashed commit of the following:
commit 148c39ac40963a593885b86a0c851b4010b68ab0
Merge: 3447611d ab6da05b
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Sep 20 13:21:06 2022 +0300
Merge branch 'master' into 4815-tablet-view
commit 3447611dc0b1c7d2cc1f8235d1c469dd92736166
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Sep 16 17:01:05 2022 +0300
client: fix query log modal on tablet </s> remove
.grid .key-colon, .grid .title--border {
font-weight: 600;
}
</s> add </s> remove const hintClass = classNames('icons mr-4 icon--24 icon--lightgray', {
</s> add const hintClass = classNames('icons mr-4 icon--24 logs__question icon--lightgray', { </s> remove const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block', {
</s> add const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block logs__question', { </s> remove <Modal portalClassName='grid' isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: 0,
top: 47,
padding: '1rem 1.5rem 1rem',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}}
</s> add <Modal
portalClassName='grid'
isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: '50%',
top: 47,
padding: '1rem 1.5rem 1rem',
maxWidth: '720px',
transform: 'translateX(-50%)',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}} </s> remove className={classNames('icons mr-4 icon--24 icon--lightgray', { 'my-3': isDetailed })}
</s> add className={classNames('icons mr-4 icon--24 icon--lightgray logs__question', { 'my-3': isDetailed })} | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cc2388e0c888dff725fdc032c35143e346155c8a | client/src/components/Logs/Cells/IconTooltip.css |
<mask> .grid > .value__time_table_header, .grid > .value__data, .grid > .value__encryption_status, .grid > .value__elapsed {
<mask> grid-column: 2 / span 1;
<mask> margin: 0 !important;
<mask> }
<mask>
<mask> .grid .key-colon, .grid .title--border {
<mask> font-weight: 600;
<mask> }
<mask> }
<mask>
<mask> .grid .key-colon:nth-child(odd)::after {
<mask> content: ":";
<mask> }
</s> Pull request: 4815 fix query log modal on tablet
Updates #4815
Squashed commit of the following:
commit 148c39ac40963a593885b86a0c851b4010b68ab0
Merge: 3447611d ab6da05b
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Sep 20 13:21:06 2022 +0300
Merge branch 'master' into 4815-tablet-view
commit 3447611dc0b1c7d2cc1f8235d1c469dd92736166
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Sep 16 17:01:05 2022 +0300
client: fix query log modal on tablet </s> remove <Modal portalClassName='grid' isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: 0,
top: 47,
padding: '1rem 1.5rem 1rem',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}}
</s> add <Modal
portalClassName='grid'
isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: '50%',
top: 47,
padding: '1rem 1.5rem 1rem',
maxWidth: '720px',
transform: 'translateX(-50%)',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}} </s> remove const hintClass = classNames('icons mr-4 icon--24 icon--lightgray', {
</s> add const hintClass = classNames('icons mr-4 icon--24 logs__question icon--lightgray', { </s> remove const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block', {
</s> add const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block logs__question', { </s> remove <svg
className="icon icon--24 icon-cross d-block d-md-none cursor--pointer"
onClick={closeModal}>
<use xlinkHref="#cross" />
</svg>
{processContent(detailedDataCurrent, buttonType)}
</s> add <div className="logs__modal-wrap">
<svg
className="icon icon--24 icon-cross d-block cursor--pointer"
onClick={closeModal}
>
<use xlinkHref="#cross" />
</svg>
{processContent(detailedDataCurrent, buttonType)}
</div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cc2388e0c888dff725fdc032c35143e346155c8a | client/src/components/Logs/Cells/IconTooltip.css | |
className={classNames('icons mr-4 icon--24 icon--lightgray logs__question', { 'my-3': isDetailed })} | <mask>
<mask> return (
<mask> <div className="logs__cell logs__cell--response" role="gridcell">
<mask> <IconTooltip
<mask> className={classNames('icons mr-4 icon--24 icon--lightgray', { 'my-3': isDetailed })}
<mask> columnClass='grid grid--limited'
<mask> tooltipClass='px-5 pb-5 pt-4 mw-75 custom-tooltip__response-details'
<mask> contentItemClass='text-truncate key-colon o-hidden'
<mask> xlinkHref='question'
<mask> title='response_details'
</s> Pull request: 4815 fix query log modal on tablet
Updates #4815
Squashed commit of the following:
commit 148c39ac40963a593885b86a0c851b4010b68ab0
Merge: 3447611d ab6da05b
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Sep 20 13:21:06 2022 +0300
Merge branch 'master' into 4815-tablet-view
commit 3447611dc0b1c7d2cc1f8235d1c469dd92736166
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Sep 16 17:01:05 2022 +0300
client: fix query log modal on tablet </s> remove const hintClass = classNames('icons mr-4 icon--24 icon--lightgray', {
</s> add const hintClass = classNames('icons mr-4 icon--24 logs__question icon--lightgray', { </s> remove <svg
className="icon icon--24 icon-cross d-block d-md-none cursor--pointer"
onClick={closeModal}>
<use xlinkHref="#cross" />
</svg>
{processContent(detailedDataCurrent, buttonType)}
</s> add <div className="logs__modal-wrap">
<svg
className="icon icon--24 icon-cross d-block cursor--pointer"
onClick={closeModal}
>
<use xlinkHref="#cross" />
</svg>
{processContent(detailedDataCurrent, buttonType)}
</div> </s> remove const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block', {
</s> add const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block logs__question', { </s> remove <Modal portalClassName='grid' isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: 0,
top: 47,
padding: '1rem 1.5rem 1rem',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}}
</s> add <Modal
portalClassName='grid'
isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: '50%',
top: 47,
padding: '1rem 1.5rem 1rem',
maxWidth: '720px',
transform: 'translateX(-50%)',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cc2388e0c888dff725fdc032c35143e346155c8a | client/src/components/Logs/Cells/ResponseCell.js |
<Modal
portalClassName='grid'
isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: '50%',
top: 47,
padding: '1rem 1.5rem 1rem',
maxWidth: '720px',
transform: 'translateX(-50%)',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}} | <mask> setDetailedDataCurrent={setDetailedDataCurrent}
<mask> setButtonType={setButtonType}
<mask> setModalOpened={setModalOpened}
<mask> />
<mask> <Modal portalClassName='grid' isOpen={isSmallScreen && isModalOpened}
<mask> onRequestClose={closeModal}
<mask> style={{
<mask> content: {
<mask> width: '100%',
<mask> height: 'fit-content',
<mask> left: 0,
<mask> top: 47,
<mask> padding: '1rem 1.5rem 1rem',
<mask> },
<mask> overlay: {
<mask> backgroundColor: 'rgba(0,0,0,0.5)',
<mask> },
<mask> }}
<mask> >
<mask> <svg
<mask> className="icon icon--24 icon-cross d-block d-md-none cursor--pointer"
<mask> onClick={closeModal}>
<mask> <use xlinkHref="#cross" />
</s> Pull request: 4815 fix query log modal on tablet
Updates #4815
Squashed commit of the following:
commit 148c39ac40963a593885b86a0c851b4010b68ab0
Merge: 3447611d ab6da05b
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Sep 20 13:21:06 2022 +0300
Merge branch 'master' into 4815-tablet-view
commit 3447611dc0b1c7d2cc1f8235d1c469dd92736166
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Sep 16 17:01:05 2022 +0300
client: fix query log modal on tablet </s> remove <svg
className="icon icon--24 icon-cross d-block d-md-none cursor--pointer"
onClick={closeModal}>
<use xlinkHref="#cross" />
</svg>
{processContent(detailedDataCurrent, buttonType)}
</s> add <div className="logs__modal-wrap">
<svg
className="icon icon--24 icon-cross d-block cursor--pointer"
onClick={closeModal}
>
<use xlinkHref="#cross" />
</svg>
{processContent(detailedDataCurrent, buttonType)}
</div> </s> remove const hintClass = classNames('icons mr-4 icon--24 icon--lightgray', {
</s> add const hintClass = classNames('icons mr-4 icon--24 logs__question icon--lightgray', { </s> remove
.grid .key-colon, .grid .title--border {
font-weight: 600;
}
</s> add </s> remove const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block', {
</s> add const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block logs__question', { </s> remove className={classNames('icons mr-4 icon--24 icon--lightgray', { 'my-3': isDetailed })}
</s> add className={classNames('icons mr-4 icon--24 icon--lightgray logs__question', { 'my-3': isDetailed })} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cc2388e0c888dff725fdc032c35143e346155c8a | client/src/components/Logs/index.js |
<div className="logs__modal-wrap">
<svg
className="icon icon--24 icon-cross d-block cursor--pointer"
onClick={closeModal}
>
<use xlinkHref="#cross" />
</svg>
{processContent(detailedDataCurrent, buttonType)}
</div> | <mask> backgroundColor: 'rgba(0,0,0,0.5)',
<mask> },
<mask> }}
<mask> >
<mask> <svg
<mask> className="icon icon--24 icon-cross d-block d-md-none cursor--pointer"
<mask> onClick={closeModal}>
<mask> <use xlinkHref="#cross" />
<mask> </svg>
<mask> {processContent(detailedDataCurrent, buttonType)}
<mask> </Modal>
<mask> </>;
<mask>
<mask> return (
<mask> <>
</s> Pull request: 4815 fix query log modal on tablet
Updates #4815
Squashed commit of the following:
commit 148c39ac40963a593885b86a0c851b4010b68ab0
Merge: 3447611d ab6da05b
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Sep 20 13:21:06 2022 +0300
Merge branch 'master' into 4815-tablet-view
commit 3447611dc0b1c7d2cc1f8235d1c469dd92736166
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Sep 16 17:01:05 2022 +0300
client: fix query log modal on tablet </s> remove <Modal portalClassName='grid' isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: 0,
top: 47,
padding: '1rem 1.5rem 1rem',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}}
</s> add <Modal
portalClassName='grid'
isOpen={isSmallScreen && isModalOpened}
onRequestClose={closeModal}
style={{
content: {
width: '100%',
height: 'fit-content',
left: '50%',
top: 47,
padding: '1rem 1.5rem 1rem',
maxWidth: '720px',
transform: 'translateX(-50%)',
},
overlay: {
backgroundColor: 'rgba(0,0,0,0.5)',
},
}} </s> remove className={classNames('icons mr-4 icon--24 icon--lightgray', { 'my-3': isDetailed })}
</s> add className={classNames('icons mr-4 icon--24 icon--lightgray logs__question', { 'my-3': isDetailed })} </s> remove const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block', {
</s> add const privacyIconClass = classNames('icons mx-2 icon--24 d-none d-sm-block logs__question', { </s> remove
.grid .key-colon, .grid .title--border {
font-weight: 600;
}
</s> add </s> remove const hintClass = classNames('icons mr-4 icon--24 icon--lightgray', {
</s> add const hintClass = classNames('icons mr-4 icon--24 logs__question icon--lightgray', { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cc2388e0c888dff725fdc032c35143e346155c8a | client/src/components/Logs/index.js |
"github.com/NYTimes/gziphandler" | <mask> "syscall"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/gobuffalo/packr"
<mask> )
<mask>
<mask> // VersionString will be set through ldflags, contains current version
<mask> var VersionString = "undefined"
<mask> var httpServer *http.Server
</s> + http server: enable gzip compression for static documents </s> remove github.com/stretchr/testify v1.2.2
</s> add github.com/stretchr/testify v1.3.0 | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | app.go |
http.Handle("/", postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(http.FileServer(box))))) | <mask>
<mask> // Initialize and run the admin Web interface
<mask> box := packr.NewBox("build/static")
<mask> // if not configured, redirect / to /install.html, otherwise redirect /install.html to /
<mask> http.Handle("/", postInstallHandler(optionalAuthHandler(http.FileServer(box))))
<mask> registerControlHandlers()
<mask>
<mask> // add handlers for /install paths, we only need them when we're not configured yet
<mask> if config.firstRun {
<mask> log.Info("This is the first launch of AdGuard Home, redirecting everything to /install.html ")
</s> + http server: enable gzip compression for static documents </s> remove github.com/stretchr/testify v1.2.2
</s> add github.com/stretchr/testify v1.3.0 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | app.go |
github.com/NYTimes/gziphandler v1.1.1 | <mask> github.com/AdguardTeam/dnsproxy v0.12.0
<mask> github.com/AdguardTeam/golibs v0.1.3
<mask> github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f // indirect
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
<mask> github.com/go-ole/go-ole v1.2.1 // indirect
<mask> github.com/go-test/deep v1.0.1
<mask> github.com/gobuffalo/packr v1.19.0
<mask> github.com/joomcode/errorx v0.1.0
</s> + http server: enable gzip compression for static documents </s> remove github.com/stretchr/testify v1.2.2
</s> add github.com/stretchr/testify v1.3.0 | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | go.mod |
github.com/stretchr/testify v1.3.0 | <mask> github.com/miekg/dns v1.1.1
<mask> github.com/shirou/gopsutil v2.18.10+incompatible
<mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
<mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0
<mask> github.com/stretchr/testify v1.2.2
<mask> go.uber.org/goleak v0.10.0
<mask> golang.org/x/net v0.0.0-20190119204137-ed066c81e75e
<mask> golang.org/x/sys v0.0.0-20190122071731-054c452bb702
<mask> gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
<mask> gopkg.in/yaml.v2 v2.2.1
</s> + http server: enable gzip compression for static documents | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | go.mod |
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= | <mask> github.com/AdguardTeam/golibs v0.1.2/go.mod h1:b0XkhgIcn2TxwX6C5AQMtpIFAgjPehNgxJErWkwA3ko=
<mask> github.com/AdguardTeam/golibs v0.1.3 h1:hmapdTtMtIk3T8eQDwTOLdqZLGDKNKk9325uC8z12xg=
<mask> github.com/AdguardTeam/golibs v0.1.3/go.mod h1:b0XkhgIcn2TxwX6C5AQMtpIFAgjPehNgxJErWkwA3ko=
<mask> github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f h1:5ZfJxyXo8KyX8DgGXC5B7ILL8y51fci/qYz2B4j8iLY=
<mask> github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
</s> + http server: enable gzip compression for static documents </s> remove github.com/stretchr/testify v1.2.2
</s> add github.com/stretchr/testify v1.3.0 | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | go.sum |
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | <mask> github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA=
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0 h1:vUdUwmQLnT/yuk8PsDhhMVkrfr4aMdcv/0GWzIqOjEY=
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk=
<mask> github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
<mask> github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
<mask> github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E=
<mask> github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
</s> + http server: enable gzip compression for static documents </s> remove github.com/stretchr/testify v1.2.2
</s> add github.com/stretchr/testify v1.3.0 | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | go.sum |
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | <mask> github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
<mask> github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
<mask> github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
<mask> github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
<mask> github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
<mask> github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
<mask> github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
</s> + http server: enable gzip compression for static documents </s> remove github.com/stretchr/testify v1.2.2
</s> add github.com/stretchr/testify v1.3.0 | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | go.sum |
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | <mask> github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
<mask> github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
<mask> github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
<mask> go.uber.org/goleak v0.10.0 h1:G3eWbSNIskeRqtsN/1uI5B+eP73y3JUuBsv9AZjehb4=
<mask> go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
<mask> golang.org/x/crypto v0.0.0-20190122013713-64072686203f h1:u1CmMhe3a44hy8VIgpInORnI01UVaUYheqR7x9BxT3c=
<mask> golang.org/x/crypto v0.0.0-20190122013713-64072686203f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
</s> + http server: enable gzip compression for static documents </s> remove github.com/stretchr/testify v1.2.2
</s> add github.com/stretchr/testify v1.3.0 | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cca61a33c6ee3b5f5f20eb821d53f59b8c75a1ca | go.sum |
// check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
| <mask> return Result{}, err
<mask> }
<mask> return result, nil
<mask> }
<mask> result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
<mask> return result, err
<mask> }
<mask>
<mask> func (d *Dnsfilter) checkParental(host string) (Result, error) {
<mask> if log.GetLevel() >= log.DEBUG {
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
</s> remove func (d *Dnsfilter) lookupCommon(host string, lookupstats *LookupStats, cache *fastcache.Cache, hashparamNeedSlash bool, format formatHandler, handleBody bodyHandler) (Result, error) {
// if host ends with a dot, trim it
host = strings.ToLower(strings.Trim(host, "."))
// check cache
cachedValue, isFound := getCachedResult(cache, host)
if isFound {
atomic.AddUint64(&lookupstats.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, cache)
return cachedValue, nil
}
</s> add func (d *Dnsfilter) lookupCommon(host string, lookupstats *LookupStats, hashparamNeedSlash bool, format formatHandler, handleBody bodyHandler) (Result, error) { </s> remove // error, don't save cache
</s> add </s> remove // error, don't save cache
return Result{}, nil
</s> add return Result{}, fmt.Errorf("HTTP status code: %d", resp.StatusCode) </s> remove setCacheResult(cache, host, result)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter.go |
// check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
| <mask> }
<mask> }
<mask> return result, nil
<mask> }
<mask> result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
<mask> return result, err
<mask> }
<mask>
<mask> type formatHandler func(hashparam string) string
<mask> type bodyHandler func(body []byte, hashes map[string]bool) (Result, error)
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove func (d *Dnsfilter) lookupCommon(host string, lookupstats *LookupStats, cache *fastcache.Cache, hashparamNeedSlash bool, format formatHandler, handleBody bodyHandler) (Result, error) {
// if host ends with a dot, trim it
host = strings.ToLower(strings.Trim(host, "."))
// check cache
cachedValue, isFound := getCachedResult(cache, host)
if isFound {
atomic.AddUint64(&lookupstats.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, cache)
return cachedValue, nil
}
</s> add func (d *Dnsfilter) lookupCommon(host string, lookupstats *LookupStats, hashparamNeedSlash bool, format formatHandler, handleBody bodyHandler) (Result, error) { </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
</s> remove // error, don't save cache
</s> add </s> remove setCacheResult(cache, host, result)
</s> add </s> remove // error, don't save cache
return Result{}, nil
</s> add return Result{}, fmt.Errorf("HTTP status code: %d", resp.StatusCode) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter.go |
func (d *Dnsfilter) lookupCommon(host string, lookupstats *LookupStats, hashparamNeedSlash bool, format formatHandler, handleBody bodyHandler) (Result, error) { | <mask> type formatHandler func(hashparam string) string
<mask> type bodyHandler func(body []byte, hashes map[string]bool) (Result, error)
<mask>
<mask> // real implementation of lookup/check
<mask> func (d *Dnsfilter) lookupCommon(host string, lookupstats *LookupStats, cache *fastcache.Cache, hashparamNeedSlash bool, format formatHandler, handleBody bodyHandler) (Result, error) {
<mask> // if host ends with a dot, trim it
<mask> host = strings.ToLower(strings.Trim(host, "."))
<mask>
<mask> // check cache
<mask> cachedValue, isFound := getCachedResult(cache, host)
<mask> if isFound {
<mask> atomic.AddUint64(&lookupstats.CacheHits, 1)
<mask> log.Tracef("%s: found in the lookup cache %p", host, cache)
<mask> return cachedValue, nil
<mask> }
<mask>
<mask> // convert hostname to hash parameters
<mask> hashparam, hashes := hostnameToHashParam(host, hashparamNeedSlash)
<mask>
<mask> // format URL with our hashes
<mask> url := format(hashparam)
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
</s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
</s> remove // error, don't save cache
return Result{}, nil
</s> add return Result{}, fmt.Errorf("HTTP status code: %d", resp.StatusCode) </s> remove // error, don't save cache
</s> add </s> remove setCacheResult(cache, host, Result{})
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter.go |
<mask> // handle status code
<mask> switch {
<mask> case resp.StatusCode == 204:
<mask> // empty result, save cache
<mask> setCacheResult(cache, host, Result{})
<mask> return Result{}, nil
<mask> case resp.StatusCode != 200:
<mask> // error, don't save cache
<mask> return Result{}, nil
<mask> }
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove // error, don't save cache
return Result{}, nil
</s> add return Result{}, fmt.Errorf("HTTP status code: %d", resp.StatusCode) </s> remove setCacheResult(cache, host, result)
</s> add </s> remove // error, don't save cache
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
</s> remove result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter.go | |
return Result{}, fmt.Errorf("HTTP status code: %d", resp.StatusCode) | <mask> // empty result, save cache
<mask> setCacheResult(cache, host, Result{})
<mask> return Result{}, nil
<mask> case resp.StatusCode != 200:
<mask> // error, don't save cache
<mask> return Result{}, nil
<mask> }
<mask>
<mask> result, err := handleBody(body, hashes)
<mask> if err != nil {
<mask> // error, don't save cache
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove setCacheResult(cache, host, Result{})
</s> add </s> remove // error, don't save cache
</s> add </s> remove setCacheResult(cache, host, result)
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
</s> remove result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter.go |
<mask> }
<mask>
<mask> result, err := handleBody(body, hashes)
<mask> if err != nil {
<mask> // error, don't save cache
<mask> return Result{}, err
<mask> }
<mask>
<mask> setCacheResult(cache, host, result)
<mask> return result, nil
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove // error, don't save cache
return Result{}, nil
</s> add return Result{}, fmt.Errorf("HTTP status code: %d", resp.StatusCode) </s> remove setCacheResult(cache, host, result)
</s> add </s> remove setCacheResult(cache, host, Result{})
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
</s> remove result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter.go | |
<mask> // error, don't save cache
<mask> return Result{}, err
<mask> }
<mask>
<mask> setCacheResult(cache, host, result)
<mask> return result, nil
<mask> }
<mask>
<mask> //
<mask> // Adding rule and matching against the rules
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove // error, don't save cache
</s> add </s> remove // error, don't save cache
return Result{}, nil
</s> add return Result{}, fmt.Errorf("HTTP status code: %d", resp.StatusCode) </s> remove setCacheResult(cache, host, Result{})
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
</s> remove result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter.go | |
<mask> d.checkMatch(t, "WMconvirus.narod.ru")
<mask> if gctx.stats.Safebrowsing.Requests != 1 {
<mask> t.Errorf("Safebrowsing lookup positive cache is not working: %v", gctx.stats.Safebrowsing.Requests)
<mask> }
<mask> d.checkMatch(t, "wmconvirus.narod.ru.")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru.")
<mask> d.checkMatchEmpty(t, "yandex.ru")
<mask> d.checkMatchEmpty(t, "pornhub.com")
<mask> l := gctx.stats.Safebrowsing.Requests
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "pornhub.com.")
d.checkMatch(t, "www.pornhub.com.")
</s> add </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter_test.go | |
<mask> t.Errorf("Safebrowsing lookup positive cache is not working: %v", gctx.stats.Safebrowsing.Requests)
<mask> }
<mask> d.checkMatch(t, "wmconvirus.narod.ru.")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru.")
<mask> d.checkMatchEmpty(t, "yandex.ru")
<mask> d.checkMatchEmpty(t, "pornhub.com")
<mask> l := gctx.stats.Safebrowsing.Requests
<mask> d.checkMatchEmpty(t, "pornhub.com")
<mask> if gctx.stats.Safebrowsing.Requests != l {
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "pornhub.com.")
d.checkMatch(t, "www.pornhub.com.")
</s> add </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter_test.go | |
<mask> for i := 0; i < 100; i++ {
<mask> t.Run(fmt.Sprintf("aaa%d", i), func(t *testing.T) {
<mask> t.Parallel()
<mask> d.checkMatch(t, "wmconvirus.narod.ru")
<mask> d.checkMatch(t, "wmconvirus.narod.ru.")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru.")
<mask> d.checkMatchEmpty(t, "yandex.ru")
<mask> d.checkMatchEmpty(t, "pornhub.com")
<mask> })
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "pornhub.com.")
d.checkMatch(t, "www.pornhub.com.")
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter_test.go | |
<mask> t.Parallel()
<mask> d.checkMatch(t, "wmconvirus.narod.ru")
<mask> d.checkMatch(t, "wmconvirus.narod.ru.")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru")
<mask> d.checkMatch(t, "test.wmconvirus.narod.ru.")
<mask> d.checkMatchEmpty(t, "yandex.ru")
<mask> d.checkMatchEmpty(t, "pornhub.com")
<mask> })
<mask> }
<mask> })
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "pornhub.com.")
d.checkMatch(t, "www.pornhub.com.")
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Parental, gctx.parentalCache, false, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.parentalCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Parental.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.parentalCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Parental, false, format, handleBody)
if err == nil {
setCacheResult(gctx.parentalCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter_test.go | |
<mask> if gctx.stats.Parental.Requests != 1 {
<mask> t.Errorf("Parental lookup positive cache is not working")
<mask> }
<mask> d.checkMatch(t, "www.pornhub.com")
<mask> d.checkMatch(t, "pornhub.com.")
<mask> d.checkMatch(t, "www.pornhub.com.")
<mask> d.checkMatchEmpty(t, "www.yandex.ru")
<mask> d.checkMatchEmpty(t, "yandex.ru")
<mask> l := gctx.stats.Parental.Requests
<mask> d.checkMatchEmpty(t, "yandex.ru")
<mask> if gctx.stats.Parental.Requests != l {
</s> * safebrowsing/parental: split some code
* dnsfilter.CheckHost() doesn't support host="hostname." (with a trailing dot) anymore </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "wmconvirus.narod.ru.")
</s> add </s> remove d.checkMatch(t, "test.wmconvirus.narod.ru.")
</s> add </s> remove result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, gctx.safebrowsingCache, true, format, handleBody)
</s> add // check cache
cachedValue, isFound := getCachedResult(gctx.safebrowsingCache, host)
if isFound {
atomic.AddUint64(&gctx.stats.Safebrowsing.CacheHits, 1)
log.Tracef("%s: found in the lookup cache %p", host, gctx.safebrowsingCache)
return cachedValue, nil
}
result, err := d.lookupCommon(host, &gctx.stats.Safebrowsing, true, format, handleBody)
if err == nil {
setCacheResult(gctx.safebrowsingCache, host, result)
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ccf72b60084b4818e64105b0687eb98434f14cf3 | dnsfilter/dnsfilter_test.go | |
// Theme is a UI theme for current user.
Theme Theme `yaml:"theme"` | <mask> ProxyURL string `yaml:"http_proxy"`
<mask> // Language is a two-letter ISO 639-1 language code.
<mask> Language string `yaml:"language"`
<mask> // DebugPProf defines if the profiling HTTP handler will listen on :6060.
<mask> DebugPProf bool `yaml:"debug_pprof"`
<mask>
<mask> // TTL for a web session (in hours)
<mask> // An active session is automatically refreshed once a day.
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | internal/home/config.go |
Theme: ThemeAuto, | <mask> },
<mask> OSConfig: &osConfig{},
<mask> SchemaVersion: currentSchemaVersion,
<mask> }
<mask>
<mask> // getConfigFilename returns path to the current config file
<mask> func (c *configuration) getConfigFilename() string {
<mask> configFile, err := filepath.EvalSymlinks(Context.configFilename)
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API </s> remove type profileJSON struct {
Name string `json:"name"`
}
func handleGetProfile(w http.ResponseWriter, r *http.Request) {
u := Context.auth.getCurrentUser(r)
resp := &profileJSON{
Name: u.Name,
}
_ = aghhttp.WriteJSONResponse(w, r, resp)
}
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | internal/home/config.go |
<mask>
<mask> _ = aghhttp.WriteJSONResponse(w, r, resp)
<mask> }
<mask>
<mask> type profileJSON struct {
<mask> Name string `json:"name"`
<mask> }
<mask>
<mask> func handleGetProfile(w http.ResponseWriter, r *http.Request) {
<mask> u := Context.auth.getCurrentUser(r)
<mask> resp := &profileJSON{
<mask> Name: u.Name,
<mask> }
<mask>
<mask> _ = aghhttp.WriteJSONResponse(w, r, resp)
<mask> }
<mask>
<mask> // ------------------------
<mask> // registration of handlers
<mask> // ------------------------
<mask> func registerControlHandlers() {
<mask> httpRegister(http.MethodGet, "/control/status", handleStatus)
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | internal/home/control.go | |
httpRegister(http.MethodPut, "/control/profile/update", handlePutProfile) | <mask> Context.mux.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON)))
<mask> httpRegister(http.MethodPost, "/control/update", handleUpdate)
<mask> httpRegister(http.MethodGet, "/control/profile", handleGetProfile)
<mask>
<mask> // No auth is necessary for DoH/DoT configurations
<mask> Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoH))
<mask> Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDoT))
<mask> RegisterAuthHandlers()
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API </s> remove type profileJSON struct {
Name string `json:"name"`
}
func handleGetProfile(w http.ResponseWriter, r *http.Request) {
u := Context.auth.getCurrentUser(r)
resp := &profileJSON{
Name: u.Name,
}
_ = aghhttp.WriteJSONResponse(w, r, resp)
}
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | internal/home/control.go |
// TODO(d.kolyshev): Deprecated, remove it later. | <mask> Language string `json:"language"`
<mask> }
<mask>
<mask> func handleI18nCurrentLanguage(w http.ResponseWriter, r *http.Request) {
<mask> log.Printf("home: language is %s", config.Language)
<mask>
<mask> _ = aghhttp.WriteJSONResponse(w, r, &languageJSON{
<mask> Language: config.Language,
<mask> })
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API </s> remove type profileJSON struct {
Name string `json:"name"`
}
func handleGetProfile(w http.ResponseWriter, r *http.Request) {
u := Context.auth.getCurrentUser(r)
resp := &profileJSON{
Name: u.Name,
}
_ = aghhttp.WriteJSONResponse(w, r, resp)
}
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | internal/home/i18n.go |
// TODO(d.kolyshev): Deprecated, remove it later. | <mask> })
<mask> }
<mask>
<mask> func handleI18nChangeLanguage(w http.ResponseWriter, r *http.Request) {
<mask> if aghhttp.WriteTextPlainDeprecated(w, r) {
<mask> return
<mask> }
<mask>
<mask> langReq := &languageJSON{}
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API </s> remove type profileJSON struct {
Name string `json:"name"`
}
func handleGetProfile(w http.ResponseWriter, r *http.Request) {
u := Context.auth.getCurrentUser(r)
resp := &profileJSON{
Name: u.Name,
}
_ = aghhttp.WriteJSONResponse(w, r, resp)
}
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | internal/home/i18n.go |
'deprecated': true
'description': >
Deprecated: Use `PUT /control/profile` instead. | <mask> '/i18n/change_language':
<mask> 'post':
<mask> 'tags':
<mask> - 'i18n'
<mask> 'operationId': 'changeLanguage'
<mask> 'summary': >
<mask> Change current language. Argument must be an ISO 639-1 two-letter code.
<mask> 'requestBody':
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | openapi/openapi.yaml |
'deprecated': true
'description': >
Deprecated: Use `GET /control/profile` instead. | <mask> 'description': 'OK.'
<mask> '/i18n/current_language':
<mask> 'get':
<mask> 'tags':
<mask> - 'i18n'
<mask> 'operationId': 'currentLanguage'
<mask> 'summary': >
<mask> Get currently set language. Result is ISO 639-1 two-letter code. Empty
<mask> result means default language.
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | openapi/openapi.yaml |
'/profile/update':
'put':
'tags':
- 'global'
'operationId': 'updateProfile'
'summary': 'Updates current user info'
'requestBody':
'content':
'application/json':
'schema':
'$ref': '#/components/schemas/ProfileInfo'
'responses':
'200':
'description': 'OK' | <mask> 'responses':
<mask> '302':
<mask> 'description': 'OK.'
<mask> '/profile':
<mask> 'get':
<mask> 'tags':
<mask> - 'global'
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | openapi/openapi.yaml |
'language':
'type': 'string'
'theme':
'type': 'string'
'description': 'Interface theme'
'enum':
- 'auto'
- 'dark'
- 'light'
'required':
- 'name'
- 'language'
- 'theme' | <mask> 'description': 'Information about the current user'
<mask> 'properties':
<mask> 'name':
<mask> 'type': 'string'
<mask> 'Client':
<mask> 'type': 'object'
<mask> 'description': 'Client information.'
<mask> 'properties':
</s> Pull request: 613-dark-theme vol.1
Merge in DNS/adguard-home from 613-dark-theme to master
Squashed commit of the following:
commit 1a286e9677c0bc9203ca0249edf0dd6f64db1609
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 22:37:36 2023 +0700
home: imp docs
commit 45c4fac401788a1c5f0ab56869b13cce33690145
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 18:35:58 2023 +0700
home: imp docs
commit e23b375611deb9562dfccaf45632e5235d06f96c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:05:41 2023 +0700
home: imp docs
commit 85d2cd6250c4bb558c9a9bd5066044f07827c263
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 15:04:28 2023 +0700
home: imp code
commit bb00bfda90a809929639b241d7bbc31e7e6dfcb8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:37:41 2023 +0700
home: imp docs
commit 140fd0768ea2a0da7618a1f5ef6c53ff415753aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Fri Jan 13 09:34:27 2023 +0700
home: imp code
commit 4e866b7c5b4d2ff777e4917cb91b34a4bbb5e995
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 19:11:33 2023 +0700
home: imp docs
commit 0f13248165ef920d1dadb2e057b65cc3189a4b31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:53:57 2023 +0700
home: imp code
commit e04181f5fcd67cdd08fbf8a7c56933195999af31
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 18:48:44 2023 +0700
home: imp code
commit bb9989bb9ab54bfb734880dcb999804c6f2ccda8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date: Thu Jan 12 12:09:20 2023 +0700
all: control/profile API | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd76a307900a29db2fdb4088daf4d1c44060bcb8 | openapi/openapi.yaml |
proxyConfig := &proxy.Proxy{ | <mask> }
<mask>
<mask> // prepareIntlProxy - initializes DNS proxy that we use for internal DNS queries
<mask> func (s *Server) prepareIntlProxy() {
<mask> s.internalProxy = &proxy.Proxy{
<mask> Config: proxy.Config{
<mask> CacheEnabled: true,
<mask> CacheSizeBytes: 4096,
<mask> UpstreamConfig: s.conf.UpstreamConfig,
<mask> },
</s> Also honor the user-defined UpstreamMode for the internal DNS proxy | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd8206ad9bdf2b888e79f3eba93315919f3c31f8 | internal/dnsforward/config.go |
MaxGoroutines: int(s.conf.MaxGoroutines), | <mask> CacheEnabled: true,
<mask> CacheSizeBytes: 4096,
<mask> UpstreamConfig: s.conf.UpstreamConfig,
<mask> },
<mask> }
<mask>
<mask> if s.conf.AllServers {
<mask> proxyConfig.UpstreamMode = proxy.UModeParallel
</s> Also honor the user-defined UpstreamMode for the internal DNS proxy </s> remove s.internalProxy = &proxy.Proxy{
</s> add proxyConfig := &proxy.Proxy{ | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd8206ad9bdf2b888e79f3eba93315919f3c31f8 | internal/dnsforward/config.go |
if s.conf.AllServers {
proxyConfig.UpstreamMode = proxy.UModeParallel
} else if s.conf.FastestAddr {
proxyConfig.UpstreamMode = proxy.UModeFastestAddr
proxyConfig.FastestPingTimeout = s.conf.FastestTimeout.Duration
} else {
proxyConfig.UpstreamMode = proxy.UModeLoadBalance
}
s.internalProxy = proxyConfig | <mask> UpstreamConfig: s.conf.UpstreamConfig,
<mask> MaxGoroutines: int(s.conf.MaxGoroutines),
<mask> },
<mask> }
<mask> }
<mask>
<mask> // prepareTLS - prepares TLS configuration for the DNS proxy
<mask> func (s *Server) prepareTLS(proxyConfig *proxy.Config) error {
<mask> if len(s.conf.CertificateChainData) == 0 || len(s.conf.PrivateKeyData) == 0 {
<mask> return nil
</s> Also honor the user-defined UpstreamMode for the internal DNS proxy </s> remove s.internalProxy = &proxy.Proxy{
</s> add proxyConfig := &proxy.Proxy{ | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/cd8206ad9bdf2b888e79f3eba93315919f3c31f8 | internal/dnsforward/config.go |
// makeDDRResponse creates DDR answer according to server configuration. The
// contructed SVCB resource records have the priority of 1 for each entry,
// similar to examples provided by https://www.ietf.org/archive/id/draft-ietf-add-ddr-06.html.
//
// TODO(a.meshkov): Consider setting the priority values based on the protocol. | <mask>
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> // makeDDRResponse creates DDR answer according to server configuration.
<mask> func (s *Server) makeDDRResponse(req *dns.Msg) (resp *dns.Msg) {
<mask> resp = s.makeResponse(req)
<mask> // TODO(e.burkov): Think about storing the FQDN version of the server's
<mask> // name somewhere.
<mask> domainName := dns.Fqdn(s.conf.ServerName)
</s> Pull request: 4463 Improve DDR priority
Merge in DNS/adguard-home from 4463-ddr-prior to master
Updates #4463.
Squashed commit of the following:
commit 30b470abe6ea6a58b50a49715c77342018be9491
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:33:56 2022 +0300
dnsforward: imp docs
commit 1ba099c2cc318e00b390c4e1b8770aee970d5c20
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:12:46 2022 +0300
dnsforward: imp ddr priority </s> remove Priority: 3,
</s> add Priority: 1, </s> remove Priority: 2,
</s> add Priority: 1, </s> remove Priority: 3,
</s> add Priority: 1, </s> remove Priority: 2,
</s> add Priority: 1, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce1b2bc4f17b2123e9a16ad0665061505c437376 | internal/dnsforward/dns.go |
Priority: 1, | <mask> }
<mask>
<mask> ans := &dns.SVCB{
<mask> Hdr: s.hdr(req, dns.TypeSVCB),
<mask> Priority: 2,
<mask> Target: domainName,
<mask> Value: values,
<mask> }
<mask>
<mask> resp.Answer = append(resp.Answer, ans)
</s> Pull request: 4463 Improve DDR priority
Merge in DNS/adguard-home from 4463-ddr-prior to master
Updates #4463.
Squashed commit of the following:
commit 30b470abe6ea6a58b50a49715c77342018be9491
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:33:56 2022 +0300
dnsforward: imp docs
commit 1ba099c2cc318e00b390c4e1b8770aee970d5c20
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:12:46 2022 +0300
dnsforward: imp ddr priority </s> remove Priority: 3,
</s> add Priority: 1, </s> remove Priority: 2,
</s> add Priority: 1, </s> remove Priority: 3,
</s> add Priority: 1, </s> remove // makeDDRResponse creates DDR answer according to server configuration.
</s> add // makeDDRResponse creates DDR answer according to server configuration. The
// contructed SVCB resource records have the priority of 1 for each entry,
// similar to examples provided by https://www.ietf.org/archive/id/draft-ietf-add-ddr-06.html.
//
// TODO(a.meshkov): Consider setting the priority values based on the protocol. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce1b2bc4f17b2123e9a16ad0665061505c437376 | internal/dnsforward/dns.go |
Priority: 1, | <mask> }
<mask>
<mask> ans := &dns.SVCB{
<mask> Hdr: s.hdr(req, dns.TypeSVCB),
<mask> Priority: 3,
<mask> Target: domainName,
<mask> Value: values,
<mask> }
<mask>
<mask> resp.Answer = append(resp.Answer, ans)
</s> Pull request: 4463 Improve DDR priority
Merge in DNS/adguard-home from 4463-ddr-prior to master
Updates #4463.
Squashed commit of the following:
commit 30b470abe6ea6a58b50a49715c77342018be9491
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:33:56 2022 +0300
dnsforward: imp docs
commit 1ba099c2cc318e00b390c4e1b8770aee970d5c20
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:12:46 2022 +0300
dnsforward: imp ddr priority </s> remove Priority: 2,
</s> add Priority: 1, </s> remove Priority: 3,
</s> add Priority: 1, </s> remove Priority: 2,
</s> add Priority: 1, </s> remove // makeDDRResponse creates DDR answer according to server configuration.
</s> add // makeDDRResponse creates DDR answer according to server configuration. The
// contructed SVCB resource records have the priority of 1 for each entry,
// similar to examples provided by https://www.ietf.org/archive/id/draft-ietf-add-ddr-06.html.
//
// TODO(a.meshkov): Consider setting the priority values based on the protocol. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce1b2bc4f17b2123e9a16ad0665061505c437376 | internal/dnsforward/dns.go |
Priority: 1, | <mask> },
<mask> }
<mask>
<mask> dotSVCB := &dns.SVCB{
<mask> Priority: 2,
<mask> Target: ddrTestFQDN,
<mask> Value: []dns.SVCBKeyValue{
<mask> &dns.SVCBAlpn{Alpn: []string{"dot"}},
<mask> &dns.SVCBPort{Port: 8043},
<mask> },
</s> Pull request: 4463 Improve DDR priority
Merge in DNS/adguard-home from 4463-ddr-prior to master
Updates #4463.
Squashed commit of the following:
commit 30b470abe6ea6a58b50a49715c77342018be9491
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:33:56 2022 +0300
dnsforward: imp docs
commit 1ba099c2cc318e00b390c4e1b8770aee970d5c20
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:12:46 2022 +0300
dnsforward: imp ddr priority </s> remove Priority: 3,
</s> add Priority: 1, </s> remove Priority: 2,
</s> add Priority: 1, </s> remove Priority: 3,
</s> add Priority: 1, </s> remove // makeDDRResponse creates DDR answer according to server configuration.
</s> add // makeDDRResponse creates DDR answer according to server configuration. The
// contructed SVCB resource records have the priority of 1 for each entry,
// similar to examples provided by https://www.ietf.org/archive/id/draft-ietf-add-ddr-06.html.
//
// TODO(a.meshkov): Consider setting the priority values based on the protocol. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce1b2bc4f17b2123e9a16ad0665061505c437376 | internal/dnsforward/dns_test.go |
Priority: 1, | <mask> },
<mask> }
<mask>
<mask> doqSVCB := &dns.SVCB{
<mask> Priority: 3,
<mask> Target: ddrTestFQDN,
<mask> Value: []dns.SVCBKeyValue{
<mask> &dns.SVCBAlpn{Alpn: []string{"doq"}},
<mask> &dns.SVCBPort{Port: 8042},
<mask> },
</s> Pull request: 4463 Improve DDR priority
Merge in DNS/adguard-home from 4463-ddr-prior to master
Updates #4463.
Squashed commit of the following:
commit 30b470abe6ea6a58b50a49715c77342018be9491
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:33:56 2022 +0300
dnsforward: imp docs
commit 1ba099c2cc318e00b390c4e1b8770aee970d5c20
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Jun 20 17:12:46 2022 +0300
dnsforward: imp ddr priority </s> remove Priority: 2,
</s> add Priority: 1, </s> remove Priority: 3,
</s> add Priority: 1, </s> remove Priority: 2,
</s> add Priority: 1, </s> remove // makeDDRResponse creates DDR answer according to server configuration.
</s> add // makeDDRResponse creates DDR answer according to server configuration. The
// contructed SVCB resource records have the priority of 1 for each entry,
// similar to examples provided by https://www.ietf.org/archive/id/draft-ietf-add-ddr-06.html.
//
// TODO(a.meshkov): Consider setting the priority values based on the protocol. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce1b2bc4f17b2123e9a16ad0665061505c437376 | internal/dnsforward/dns_test.go |
"enforce_safe_search": "Veilig zoeken gebruiken", | <mask> "use_adguard_browsing_sec": "Gebruik AdGuardBrowsing Security web service",
<mask> "use_adguard_browsing_sec_hint": "AdGuard Home controleert of het domein in de blokkeerlijst voorkomt dmv Browsing Security web service. Dit gebeurt dmv een privacy vriendelijk API verzoek:een korte prefix van de domein naam met SHA256 hash wordt verzonden naar de server.",
<mask> "use_adguard_parental": "Gebruik AdGuard Ouderlijk toezicht web service",
<mask> "use_adguard_parental_hint": "AdGuard Home controleert of het domein 18+ content bevat. Dit gebeurt dmv dezelfde privacy vriendelijke API als de Browsing Security web service.",
<mask> "enforce_safe_search": "Forceer Veilig Zoeken",
<mask> "enforce_save_search_hint": "AdGuard Home kan veilig zoeken forceren voor de volgende zoekmachines: Google, Youtube, Bing, en DuckDuckGo, Yandex, Pixabay.",
<mask> "no_servers_specified": "Geen servers gespecificeerd",
<mask> "general_settings": "Generieke instellingen",
<mask> "dns_settings": "DNS Instellingen",
<mask> "dns_blocklists": "DNS blokkeerlijsten",
</s> Pull request: client: upd i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit bf45adb09443576d3fb577e1f723985e073cc312
Merge: 015ce9cf 6e9a90b9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Wed Jun 16 13:38:25 2021 +0300
Merge branch 'master' into upd-i18n
commit 015ce9cff63ff4987af955c38732b1da3a8ccffb
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Wed Jun 16 13:20:38 2021 +0300
client: upd i18n more
commit 83badda5a1e72798c4791a3c9081258a841f4a91
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 15 21:24:58 2021 +0300
client: upd i18n </s> remove "disable_ipv6": "Zet IPv6 uit",
"disable_ipv6_desc": "Als deze functie is ingeschakeld, worden alle DNS-query's voor IPv6-adressen (type AAAA) verwijderd.",
</s> add "disable_ipv6": "Oplossen IPv6-adressen uitschakelen",
"disable_ipv6_desc": "Alle DNS-query's voor IPv6-adressen (type AAAA) verwijderen.", </s> remove "edns_enable": "Zet EDNS client subnet aan",
</s> add "edns_enable": "EDNS client subnet inschakelen", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce36c955df47d58420cab0c8d8c91ec2432b40ba | client/src/__locales/nl.json |
"edns_enable": "EDNS client subnet inschakelen", | <mask> "download_mobileconfig": "Configuratiebestand downloaden",
<mask> "plain_dns": "Gewone DNS",
<mask> "form_enter_rate_limit": "Voer ratio limiet in",
<mask> "rate_limit": "Ratio limiet",
<mask> "edns_enable": "Zet EDNS client subnet aan",
<mask> "edns_cs_desc": "Indien ingeschakeld stuurt AdGuard Home het subnet van de client naar de DNS-servers.",
<mask> "rate_limit_desc": "Het aantal verzoeken per seconde toegelaten per toestel. 0 betekent onbeperkt.",
<mask> "blocking_ipv4_desc": "IP-adres dat moet worden teruggegeven voor een geblokkeerd A-verzoek",
<mask> "blocking_ipv6_desc": "IP-adres dat moet worden teruggegeven voor een geblokkeerd A-verzoek",
<mask> "blocking_mode_default": "Standaard: Reageer met een nul IP adres (0.0.0.0 for A; :: voor AAAA) wanneer geblokkeerd door een Adblock-type regel; reageer met het IP-adres dat is opgegeven in de regel wanneer geblokkeerd door een /etc/hosts type regel",
</s> Pull request: client: upd i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit bf45adb09443576d3fb577e1f723985e073cc312
Merge: 015ce9cf 6e9a90b9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Wed Jun 16 13:38:25 2021 +0300
Merge branch 'master' into upd-i18n
commit 015ce9cff63ff4987af955c38732b1da3a8ccffb
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Wed Jun 16 13:20:38 2021 +0300
client: upd i18n more
commit 83badda5a1e72798c4791a3c9081258a841f4a91
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 15 21:24:58 2021 +0300
client: upd i18n </s> remove "disable_ipv6": "Zet IPv6 uit",
"disable_ipv6_desc": "Als deze functie is ingeschakeld, worden alle DNS-query's voor IPv6-adressen (type AAAA) verwijderd.",
</s> add "disable_ipv6": "Oplossen IPv6-adressen uitschakelen",
"disable_ipv6_desc": "Alle DNS-query's voor IPv6-adressen (type AAAA) verwijderen.", </s> remove "enforce_safe_search": "Forceer Veilig Zoeken",
</s> add "enforce_safe_search": "Veilig zoeken gebruiken", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce36c955df47d58420cab0c8d8c91ec2432b40ba | client/src/__locales/nl.json |
"disable_ipv6": "Oplossen IPv6-adressen uitschakelen",
"disable_ipv6_desc": "Alle DNS-query's voor IPv6-adressen (type AAAA) verwijderen.", | <mask> "rewrite_ip_address": "IP adres: gebruik dit IP in een A of AAAA antwoord",
<mask> "rewrite_domain_name": "Domeinnaam: een CNAME record toevoegen",
<mask> "rewrite_A": "<0>A</0>: speciale waarde, <0>A</0> records uit de upstream bewaren",
<mask> "rewrite_AAAA": "<0>AAAA</0>: speciale waarde, <0>AAAA</0> records uit de upstream bewaren",
<mask> "disable_ipv6": "Zet IPv6 uit",
<mask> "disable_ipv6_desc": "Als deze functie is ingeschakeld, worden alle DNS-query's voor IPv6-adressen (type AAAA) verwijderd.",
<mask> "fastest_addr": "Snelste IP adres",
<mask> "fastest_addr_desc": "Alle DNS-servers bevragen en het snelste IP adres terugkoppelen. Dit zal de DNS verzoeken vertragen omdat AdGuard Home moet wachten op de antwoorden van alles DNS-servers, maar verbetert wel de connectiviteit.",
<mask> "autofix_warning_text": "Als je op \"Repareren\" klikt, configureert AdGuard Home jouw systeem om de AdGuard Home DNS-server te gebruiken.",
<mask> "autofix_warning_list": "De volgende taken worden uitgevoerd: <0> Deactiveren van Systeem DNSStubListener</0> <0> DNS-serveradres instellen op 127.0.0.1 </0> <0> Symbolisch koppelingsdoel van /etc/resolv.conf vervangen door /run/systemd/resolve/resolv.conf </0> <0> Stop DNSStubListener (herlaad systemd-resolved service) </0>",
<mask> "autofix_warning_result": "Als gevolg hiervan worden alle DNS-verzoeken van je systeem standaard door AdGuard Home verwerkt.",
</s> Pull request: client: upd i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit bf45adb09443576d3fb577e1f723985e073cc312
Merge: 015ce9cf 6e9a90b9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Wed Jun 16 13:38:25 2021 +0300
Merge branch 'master' into upd-i18n
commit 015ce9cff63ff4987af955c38732b1da3a8ccffb
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Wed Jun 16 13:20:38 2021 +0300
client: upd i18n more
commit 83badda5a1e72798c4791a3c9081258a841f4a91
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 15 21:24:58 2021 +0300
client: upd i18n </s> remove "edns_enable": "Zet EDNS client subnet aan",
</s> add "edns_enable": "EDNS client subnet inschakelen", </s> remove "enforce_safe_search": "Forceer Veilig Zoeken",
</s> add "enforce_safe_search": "Veilig zoeken gebruiken", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ce36c955df47d58420cab0c8d8c91ec2432b40ba | client/src/__locales/nl.json |
Upstreams []string `json:"upstream_dns"` // Upstreams
BootstrapDNS []string `json:"bootstrap_dns"` // Bootstrap DNS
AllServers bool `json:"all_servers"` // --all-servers param for dnsproxy | <mask> // -----------------------
<mask>
<mask> // TODO this struct will become unnecessary after config file rework
<mask> type upstreamConfig struct {
<mask> upstreams []string // Upstreams
<mask> bootstrapDNS []string // Bootstrap DNS
<mask> allServers bool // --all-servers param for dnsproxy
<mask> }
<mask>
<mask> func handleSetUpstreamConfig(w http.ResponseWriter, r *http.Request) {
<mask> log.Tracef("%s %v", r.Method, r.URL)
<mask> newconfig := upstreamConfig{}
</s> [fix] control: fix json decode for upstream config </s> remove for _, host := range newconfig.bootstrapDNS {
</s> add for _, host := range newconfig.BootstrapDNS { </s> remove if len(newconfig.upstreams) > 0 {
config.DNS.UpstreamDNS = newconfig.upstreams
</s> add if len(newconfig.Upstreams) > 0 {
config.DNS.UpstreamDNS = newconfig.Upstreams </s> remove config.DNS.AllServers = newconfig.allServers
</s> add config.DNS.AllServers = newconfig.AllServers | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ceaa1e4ebf2e29c972b8ed0f4d7cf54e13f85151 | control.go |
if len(newconfig.Upstreams) > 0 {
config.DNS.UpstreamDNS = newconfig.Upstreams | <mask> return
<mask> }
<mask>
<mask> config.DNS.UpstreamDNS = defaultDNS
<mask> if len(newconfig.upstreams) > 0 {
<mask> config.DNS.UpstreamDNS = newconfig.upstreams
<mask> }
<mask>
<mask> // bootstrap servers are plain DNS only. We should remove tls:// https:// and sdns:// hosts from slice
<mask> bootstraps := []string{}
<mask> for _, host := range newconfig.bootstrapDNS {
</s> [fix] control: fix json decode for upstream config </s> remove for _, host := range newconfig.bootstrapDNS {
</s> add for _, host := range newconfig.BootstrapDNS { </s> remove config.DNS.AllServers = newconfig.allServers
</s> add config.DNS.AllServers = newconfig.AllServers </s> remove upstreams []string // Upstreams
bootstrapDNS []string // Bootstrap DNS
allServers bool // --all-servers param for dnsproxy
</s> add Upstreams []string `json:"upstream_dns"` // Upstreams
BootstrapDNS []string `json:"bootstrap_dns"` // Bootstrap DNS
AllServers bool `json:"all_servers"` // --all-servers param for dnsproxy | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ceaa1e4ebf2e29c972b8ed0f4d7cf54e13f85151 | control.go |
for _, host := range newconfig.BootstrapDNS { | <mask> }
<mask>
<mask> // bootstrap servers are plain DNS only. We should remove tls:// https:// and sdns:// hosts from slice
<mask> bootstraps := []string{}
<mask> for _, host := range newconfig.bootstrapDNS {
<mask> err := checkBootstrapDNS(host)
<mask> if err != nil {
<mask> log.Tracef("%s can not be used as bootstrap DNS cause: %s", host, err)
<mask> continue
<mask> }
</s> [fix] control: fix json decode for upstream config </s> remove if len(newconfig.upstreams) > 0 {
config.DNS.UpstreamDNS = newconfig.upstreams
</s> add if len(newconfig.Upstreams) > 0 {
config.DNS.UpstreamDNS = newconfig.Upstreams </s> remove config.DNS.AllServers = newconfig.allServers
</s> add config.DNS.AllServers = newconfig.AllServers </s> remove upstreams []string // Upstreams
bootstrapDNS []string // Bootstrap DNS
allServers bool // --all-servers param for dnsproxy
</s> add Upstreams []string `json:"upstream_dns"` // Upstreams
BootstrapDNS []string `json:"bootstrap_dns"` // Bootstrap DNS
AllServers bool `json:"all_servers"` // --all-servers param for dnsproxy | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ceaa1e4ebf2e29c972b8ed0f4d7cf54e13f85151 | control.go |
config.DNS.AllServers = newconfig.AllServers | <mask> if len(bootstraps) > 0 {
<mask> config.DNS.BootstrapDNS = bootstraps
<mask> }
<mask>
<mask> config.DNS.AllServers = newconfig.allServers
<mask> httpUpdateConfigReloadDNSReturnOK(w, r)
<mask> }
<mask>
<mask> // checkBootstrapDNS checks if host is plain DNS
<mask> func checkBootstrapDNS(host string) error {
</s> [fix] control: fix json decode for upstream config </s> remove if len(newconfig.upstreams) > 0 {
config.DNS.UpstreamDNS = newconfig.upstreams
</s> add if len(newconfig.Upstreams) > 0 {
config.DNS.UpstreamDNS = newconfig.Upstreams </s> remove for _, host := range newconfig.bootstrapDNS {
</s> add for _, host := range newconfig.BootstrapDNS { </s> remove upstreams []string // Upstreams
bootstrapDNS []string // Bootstrap DNS
allServers bool // --all-servers param for dnsproxy
</s> add Upstreams []string `json:"upstream_dns"` // Upstreams
BootstrapDNS []string `json:"bootstrap_dns"` // Bootstrap DNS
AllServers bool `json:"all_servers"` // --all-servers param for dnsproxy | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ceaa1e4ebf2e29c972b8ed0f4d7cf54e13f85151 | control.go |
import React, { Component, Fragment } from 'react'; | <mask> import React, { Fragment } from 'react';
<mask> import { connect } from 'react-redux';
<mask> import PropTypes from 'prop-types';
<mask> import { Field, reduxForm, formValueSelector } from 'redux-form';
<mask> import { Trans, withNamespaces } from 'react-i18next';
<mask> import flow from 'lodash/flow';
</s> * client: validate form on load </s> remove let Settings = (props) => {
const {
handleSubmit,
handleChange,
handleAutofix,
webIp,
webPort,
dnsIp,
dnsPort,
interfaces,
invalid,
config,
} = props;
const {
status: webStatus,
can_autofix: isWebFixAvailable,
} = config.web;
const {
status: dnsStatus,
can_autofix: isDnsFixAvailable,
} = config.dns;
</s> add class Settings extends Component {
componentDidMount() {
const { web, dns } = this.props.config; </s> remove <div className="setup__desc">
<Trans>install_settings_dns_desc</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={dnsIp}
port={dnsPort}
isDns={true}
/>
</div>
</div>
</div>
<Controls invalid={invalid} />
</form>
);
};
</s> add <Controls invalid={invalid} />
</form>
);
}
} </s> remove return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</s> add this.props.validateForm({
web,
dns,
});
}
render() {
const {
handleSubmit,
handleChange,
handleAutofix,
webIp,
webPort,
dnsIp,
dnsPort,
interfaces,
invalid,
config,
} = this.props;
const {
status: webStatus,
can_autofix: isWebFixAvailable,
} = config.web;
const {
status: dnsStatus,
can_autofix: isDnsFixAvailable,
} = config.dns;
return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="web.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{webStatus &&
<div className="setup__error text-danger">
{webStatus}
{isWebFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('web', webIp, webPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} </s> remove Settings = connect((state) => {
</s> add const SettingsForm = connect((state) => { </s> remove <div className="col-12">
{dnsStatus &&
<div className="setup__error text-danger">
{dnsStatus}
{isDnsFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('dns', dnsIp, dnsPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
}
</div>
</s> add | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ceabad0fd07547dae7795bb827450883643aae31 | client/src/install/Setup/Settings.js |
class Settings extends Component {
componentDidMount() {
const { web, dns } = this.props.config; | <mask> return false;
<mask> })
<mask> ));
<mask>
<mask> let Settings = (props) => {
<mask> const {
<mask> handleSubmit,
<mask> handleChange,
<mask> handleAutofix,
<mask> webIp,
<mask> webPort,
<mask> dnsIp,
<mask> dnsPort,
<mask> interfaces,
<mask> invalid,
<mask> config,
<mask> } = props;
<mask> const {
<mask> status: webStatus,
<mask> can_autofix: isWebFixAvailable,
<mask> } = config.web;
<mask> const {
<mask> status: dnsStatus,
<mask> can_autofix: isDnsFixAvailable,
<mask> } = config.dns;
<mask>
<mask> return (
<mask> <form className="setup__step" onSubmit={handleSubmit}>
<mask> <div className="setup__group">
<mask> <div className="setup__subtitle">
</s> * client: validate form on load </s> remove return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</s> add this.props.validateForm({
web,
dns,
});
}
render() {
const {
handleSubmit,
handleChange,
handleAutofix,
webIp,
webPort,
dnsIp,
dnsPort,
interfaces,
invalid,
config,
} = this.props;
const {
status: webStatus,
can_autofix: isWebFixAvailable,
} = config.web;
const {
status: dnsStatus,
can_autofix: isDnsFixAvailable,
} = config.dns;
return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="web.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{webStatus &&
<div className="setup__error text-danger">
{webStatus}
{isWebFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('web', webIp, webPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} </s> remove Settings = connect((state) => {
</s> add const SettingsForm = connect((state) => { </s> remove <div className="setup__desc">
<Trans>install_settings_dns_desc</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={dnsIp}
port={dnsPort}
isDns={true}
/>
</div>
</div>
</div>
<Controls invalid={invalid} />
</form>
);
};
</s> add <Controls invalid={invalid} />
</form>
);
}
} </s> remove import React, { Fragment } from 'react';
</s> add import React, { Component, Fragment } from 'react'; </s> remove <div className="setup__desc">
<Trans>install_settings_interface_link</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={webIp}
port={webPort}
/>
</s> add <div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_dns</Trans> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"ke... | https://github.com/AdguardTeam/AdGuardHome/commit/ceabad0fd07547dae7795bb827450883643aae31 | client/src/install/Setup/Settings.js |
this.props.validateForm({
web,
dns,
});
}
render() {
const {
handleSubmit,
handleChange,
handleAutofix,
webIp,
webPort,
dnsIp,
dnsPort,
interfaces,
invalid,
config,
} = this.props;
const {
status: webStatus,
can_autofix: isWebFixAvailable,
} = config.web;
const {
status: dnsStatus,
can_autofix: isDnsFixAvailable,
} = config.dns;
return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="web.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{webStatus &&
<div className="setup__error text-danger">
{webStatus}
{isWebFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('web', webIp, webPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} | <mask> status: dnsStatus,
<mask> can_autofix: isDnsFixAvailable,
<mask> } = config.dns;
<mask>
<mask> return (
<mask> <form className="setup__step" onSubmit={handleSubmit}>
<mask> <div className="setup__group">
<mask> <div className="setup__subtitle">
<mask> <Trans>install_settings_title</Trans>
<mask> </div>
<mask> <div className="row">
<mask> <div className="col-8">
<mask> <div className="form-group">
<mask> <label>
<mask> <Trans>install_settings_listen</Trans>
<mask> </label>
<mask> <Field
<mask> name="web.ip"
<mask> component="select"
<mask> className="form-control custom-select"
<mask> onChange={handleChange}
<mask> >
<mask> <option value={ALL_INTERFACES_IP}>
<mask> <Trans>install_settings_all_interfaces</Trans>
<mask> </option>
<mask> {renderInterfaces(interfaces)}
<mask> </Field>
<mask> </div>
<mask> </div>
<mask> <div className="col-4">
<mask> <div className="form-group">
<mask> <label>
</s> * client: validate form on load </s> remove </div>
</div>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_dns</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="dns.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</s> add <div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="dns.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="dns.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{dnsStatus &&
<div className="setup__error text-danger">
{dnsStatus}
{isDnsFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('dns', dnsIp, dnsPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} </s> remove let Settings = (props) => {
const {
handleSubmit,
handleChange,
handleAutofix,
webIp,
webPort,
dnsIp,
dnsPort,
interfaces,
invalid,
config,
} = props;
const {
status: webStatus,
can_autofix: isWebFixAvailable,
} = config.web;
const {
status: dnsStatus,
can_autofix: isDnsFixAvailable,
} = config.dns;
</s> add class Settings extends Component {
componentDidMount() {
const { web, dns } = this.props.config; </s> remove <div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="web.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
</s> add <div className="setup__desc">
<Trans>install_settings_interface_link</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={webIp}
port={webPort} </s> remove <div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="dns.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
</s> add <div className="setup__desc">
<Trans>install_settings_dns_desc</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={dnsIp}
port={dnsPort}
isDns={true} </s> remove <div className="setup__desc">
<Trans>install_settings_interface_link</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={webIp}
port={webPort}
/>
</s> add <div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_dns</Trans> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/AdguardTeam/AdGuardHome/commit/ceabad0fd07547dae7795bb827450883643aae31 | client/src/install/Setup/Settings.js |
<div className="setup__desc">
<Trans>install_settings_interface_link</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={webIp}
port={webPort} | <mask> {renderInterfaces(interfaces)}
<mask> </Field>
<mask> </div>
<mask> </div>
<mask> <div className="col-4">
<mask> <div className="form-group">
<mask> <label>
<mask> <Trans>install_settings_port</Trans>
<mask> </label>
<mask> <Field
<mask> name="web.port"
<mask> component={renderField}
<mask> type="number"
<mask> className="form-control"
<mask> placeholder="80"
<mask> validate={[port, required]}
<mask> normalize={toNumber}
<mask> onChange={handleChange}
<mask> />
<mask> </div>
<mask> </div>
<mask> <div className="col-12">
<mask> {webStatus &&
</s> * client: validate form on load </s> remove <div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="dns.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
</s> add <div className="setup__desc">
<Trans>install_settings_dns_desc</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={dnsIp}
port={dnsPort}
isDns={true} </s> remove </div>
</div>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_dns</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="dns.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</s> add <div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="dns.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="dns.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{dnsStatus &&
<div className="setup__error text-danger">
{dnsStatus}
{isDnsFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('dns', dnsIp, dnsPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} </s> remove return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</s> add this.props.validateForm({
web,
dns,
});
}
render() {
const {
handleSubmit,
handleChange,
handleAutofix,
webIp,
webPort,
dnsIp,
dnsPort,
interfaces,
invalid,
config,
} = this.props;
const {
status: webStatus,
can_autofix: isWebFixAvailable,
} = config.web;
const {
status: dnsStatus,
can_autofix: isDnsFixAvailable,
} = config.dns;
return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="web.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{webStatus &&
<div className="setup__error text-danger">
{webStatus}
{isWebFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('web', webIp, webPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} </s> remove <div className="col-12">
{webStatus &&
<div className="setup__error text-danger">
{webStatus}
{isWebFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('web', webIp, webPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
}
</div>
</s> add </s> remove <div className="col-12">
{dnsStatus &&
<div className="setup__error text-danger">
{dnsStatus}
{isDnsFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('dns', dnsIp, dnsPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
}
</div>
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ceabad0fd07547dae7795bb827450883643aae31 | client/src/install/Setup/Settings.js |
<mask> onChange={handleChange}
<mask> />
<mask> </div>
<mask> </div>
<mask> <div className="col-12">
<mask> {webStatus &&
<mask> <div className="setup__error text-danger">
<mask> {webStatus}
<mask> {isWebFixAvailable &&
<mask> <button
<mask> type="button"
<mask> className="btn btn-secondary btn-sm ml-2"
<mask> onClick={() => handleAutofix('web', webIp, webPort)}
<mask> >
<mask> <Trans>fix</Trans>
<mask> </button>
<mask> }
<mask> </div>
<mask> }
<mask> </div>
<mask> </div>
<mask> <div className="setup__desc">
<mask> <Trans>install_settings_interface_link</Trans>
<mask> <div className="mt-1">
<mask> <AddressList
</s> * client: validate form on load </s> remove <div className="col-12">
{dnsStatus &&
<div className="setup__error text-danger">
{dnsStatus}
{isDnsFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('dns', dnsIp, dnsPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
}
</div>
</s> add </s> remove return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</s> add this.props.validateForm({
web,
dns,
});
}
render() {
const {
handleSubmit,
handleChange,
handleAutofix,
webIp,
webPort,
dnsIp,
dnsPort,
interfaces,
invalid,
config,
} = this.props;
const {
status: webStatus,
can_autofix: isWebFixAvailable,
} = config.web;
const {
status: dnsStatus,
can_autofix: isDnsFixAvailable,
} = config.dns;
return (
<form className="setup__step" onSubmit={handleSubmit}>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_title</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="web.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="web.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{webStatus &&
<div className="setup__error text-danger">
{webStatus}
{isWebFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('web', webIp, webPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} </s> remove </div>
</div>
<div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_dns</Trans>
</div>
<div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="dns.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</s> add <div className="row">
<div className="col-8">
<div className="form-group">
<label>
<Trans>install_settings_listen</Trans>
</label>
<Field
name="dns.ip"
component="select"
className="form-control custom-select"
onChange={handleChange}
>
<option value={ALL_INTERFACES_IP}>
<Trans>install_settings_all_interfaces</Trans>
</option>
{renderInterfaces(interfaces)}
</Field>
</div>
</div>
<div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="dns.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
/>
</div>
</div>
<div className="col-12">
{dnsStatus &&
<div className="setup__error text-danger">
{dnsStatus}
{isDnsFixAvailable &&
<button
type="button"
className="btn btn-secondary btn-sm ml-2"
onClick={() => handleAutofix('dns', dnsIp, dnsPort)}
>
<Trans>fix</Trans>
</button>
}
</div>
} </s> remove <div className="col-4">
<div className="form-group">
<label>
<Trans>install_settings_port</Trans>
</label>
<Field
name="web.port"
component={renderField}
type="number"
className="form-control"
placeholder="80"
validate={[port, required]}
normalize={toNumber}
onChange={handleChange}
</s> add <div className="setup__desc">
<Trans>install_settings_interface_link</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={webIp}
port={webPort} </s> remove <div className="setup__desc">
<Trans>install_settings_interface_link</Trans>
<div className="mt-1">
<AddressList
interfaces={interfaces}
address={webIp}
port={webPort}
/>
</s> add <div className="setup__group">
<div className="setup__subtitle">
<Trans>install_settings_dns</Trans> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ceabad0fd07547dae7795bb827450883643aae31 | client/src/install/Setup/Settings.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.