aboutsummaryrefslogtreecommitdiff
path: root/cacheworker.go
AgeCommit message (Collapse)Author
2019-07-05all: refactoring with latest update on dns packageShulhan
All the server core functionalities (caches and forwarding) now implemented inside "dns.Server". The main function of this package are for reading options from configuration file (or from command line options) and watching changes from system resolv.conf. There are also some major changes on configuration file. * "server.parent" option now use URI format instead of IP:PORT. This will allow parent name servers to be UDP, TCP, and/or DoH simultaneusly. * "server.doh.parent" and "server.parent.connection" are removed, redundant with new "server.parent" format. * "cache.threshold" is renamed to "cache.prune_threshold".
2019-03-02cacheworker: remove method update()Shulhan
Method update() on cacheworker basically contains one line statement. Also, update the log format to print ID of query and response and total caches.
2019-02-14all: remove caches requestShulhan
This minimize one queue in server but slowing down the process because each request will be handled sequentially.
2019-01-29cacheworker: print pruned record only on debug modeShulhan
Also, print total number of pruned records at the end of pruning.
2019-01-26cacheworker: replace "for select" with "for range"Shulhan
2019-01-24cacheworker: remove updateQueue, call cacheWorker.update directlyShulhan
2019-01-24caches: replace sync.Map with plain map and MutexShulhan
The benchmark output give better performance using plain map with Mutex rather than using sync.Map.
2019-01-23cacheworker: remove queue for pruning response in cacheShulhan
Instead of using channel, we call the remove function directly, which minimize number of channel used on program.
2019-01-23cacheworker: check for nil "res" parameter on removeShulhan
2019-01-23cacheworker: add message to list if its contains other typeShulhan
2019-01-22cacheworker: rename add() method to upsert()Shulhan
This change also rename the addQueue field to upsertQueue to reflect the process inside the channel and inside the function.
2019-01-22cacheworker: check for empty msg parameter on add()Shulhan
2019-01-22cacheworker: remove unused cacheThreshold fieldShulhan
The field cacheThreshold is only used to initialize the cachesList.
2019-01-16cacheworker.go: do not cache DNS message with non OK status codeShulhan
In case parent server return "Server failure", we should not cache the message, in case the next request may return OK status code.
2018-11-30Remove unused message poolShulhan
2018-09-27Replace debug level variable with debug packageShulhan
2018-09-27Use the same format all debug request, cache, update, and expiredShulhan
2018-09-14Ignore response only if response code is not zeroShulhan
Previously, we ignore response that have zero answer and zero TTL. This caused domain that does not have IPv6 return empty answer but with success code. This commit accept any response as long as the response code in header is 0 (success).
2018-09-07Remove function newCacheShulhan
2018-09-06cmd/rescached: load master file from directoryShulhan
Also, set the cache response received time to 0 if record is loaded from local file (hosts or master file).
2018-09-05Merge lib/dns ResponseShulhan
The Response struct has been deleted on lib/dns due to unused.
2018-08-31cacheworker.start: free response that is not added to cacheShulhan
2018-08-30Fix race when updating new responseShulhan
2018-08-30Cache request to prevent forwarding the same queries to parent serverShulhan
2018-08-29Set debug level 0 to log startup and error messagesShulhan
2018-08-29Convert request question name to lower casesShulhan
This is for consistent map key on caches.
2018-08-28[chore] Formatting outputShulhan
2018-08-26Implement cache pruning using time aware least recently usedShulhan