Commit Graph

23 Commits

Author SHA1 Message Date
Simon Zolin 0647f3fe86 * filters: rework update mechanism so that UI doesn't get locked while update is in progress 2019-03-19 17:30:17 +03:00
Simon Zolin d664a9de1d - filter: update 'LastUpdated' field and 'last-modified' file time
even when filter's content is up to date

* filters: refactor: don't check 'LastUpdated' inside update()
2019-03-19 17:30:17 +03:00
Simon Zolin b54f540f71 * control: refactor: move filter adding code to a separate function 2019-03-19 17:30:17 +03:00
Simon Zolin eefdf8449a * filters: refactor: remove unused if-branches
filter.ID == 0:
Useless, because filter ID is assigned either on application load
 or on filter add.

len(filter.Rules) == 0:
Useless, because rules are added either on application load
 or on filter add or on filter enable.
2019-03-19 17:30:17 +03:00
Simon Zolin ae2c7d00a9 * control: enable/disable filter: move code to a separate function
* don't start updating all filters after 1 filter has been enabled
* unload filter data on disable
2019-03-19 17:30:17 +03:00
Simon Zolin afa54a1339 * filters: refactor: don't check Enabled flag inside filter.update() & filter.load() 2019-03-19 17:29:07 +03:00
Simon Zolin 61b1a30aa1 * refactor: move code to loadFilters() 2019-03-19 17:29:07 +03:00
Simon Zolin b4732c83c5 * filter: use CRC32 to check whether filter data should be updated 2019-03-19 17:29:07 +03:00
Simon Zolin 783ac967a1 * filter: refactor 2019-03-19 17:29:07 +03:00
CodeLingo Bot f432eb3609 Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-03-15 14:59:05 +03:00
Simon Zolin a2e9d69452 * use golibs v0.1.1: file.SafeWrite() 2019-03-15 13:56:45 +03:00
Simon Zolin 5cb6d97cd7 * use new logger - AdguardTeam/golibs/log 2019-02-27 15:02:11 +03:00
Eugene Bujak c061bec6d8 Lower down logging noise when idle. 2019-02-15 16:28:28 +03:00
Andrey Meshkov a40ddb094b Fix review comments 2019-02-11 14:22:36 +03:00
Andrey Meshkov 9ff420bb52 Do not store last_updated in the config file anymore 2019-02-10 21:44:16 +03:00
Andrey Meshkov 9a03190a62 Fix #579
1. Added --workdir command-line argument that lets configure the working dir.
2. Made "dnsforward" use this workdir parameter when saving/reading querylog.
3. Reworked "dnsforward" -- moved http handlers out of there to control.go
2019-02-10 20:47:43 +03:00
Eugene Bujak 68c8a4d484 Demote some log.printf into log.tracef 2019-02-07 18:24:43 +03:00
Andrey Meshkov d078851246 gometalinter 2019-01-25 20:13:57 +03:00
Eugene Bujak 368e2d1ebd move log wrapper library outside into hmage/golibs/log 2018-12-29 19:12:45 +03:00
Eugene Bujak d8802a9709 Use new log wrapper and add more functions to it. 2018-12-29 17:37:18 +03:00
Eugene Bujak 0a4627f4f0 Fix engrish 2018-12-05 16:57:21 +03:00
Eugene Bujak 87c54ebd4c Move Filter definition from dnsforward to dnsfilter, it belongs there. 2018-12-05 16:57:21 +03:00
Eugene Bujak d27fd0488d Move filter-related variables, types and methods to filter.go 2018-12-05 16:56:11 +03:00