Merge: * set BlockingMode: "null_ip" by default; minor improvements

Squashed commit of the following:

commit 653544b98dc4d1b9a74e1509d0e6104b71bcdcb3
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Dec 11 17:34:41 2019 +0300

    * DNS reconfigure: protect against delayed socket fd close

commit 9e650f37dee7f771bf1d9d714c35f0a81788aa16
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Dec 11 15:28:33 2019 +0300

    - fix race on startup

commit 878fdb8fc4ebbc6fab683a65f5e4298e64c2073e
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Dec 11 15:11:21 2019 +0300

    * travis: don't run tests

commit 1c4ab60684ee22d55e6d2a3350c0f24d9844255c
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Dec 11 14:56:28 2019 +0300

    * travis: 'release.sh' and then run tests

commit e1f644b8d9a1f3b46990cdfb1b75fd81b3a49d33
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Dec 11 14:52:59 2019 +0300

    * set BlockingMode: "null_ip" by default
This commit is contained in:
Simon Zolin 2019-12-11 17:54:34 +03:00
parent daf17f16f2
commit c9ccc53282
4 changed files with 7 additions and 10 deletions

View File

@ -42,8 +42,6 @@ matrix:
script:
- node -v
- npm -v
# Run tests just in case
- go test -race -v -bench=. ./...
# Prepare releases
- ./release.sh
- ls -l dist

View File

@ -360,10 +360,9 @@ func (s *Server) Reconfigure(config *ServerConfig) error {
return errorx.Decorate(err, "could not reconfigure the server")
}
// On some Windows versions the UDP port we've just closed in proxy.Stop() doesn't get actually closed right away.
if runtime.GOOS == "windows" {
time.Sleep(1 * time.Second)
}
// It seems that net.Listener.Close() doesn't close file descriptors right away.
// We wait for some time and hope that this fd will be closed.
time.Sleep(100 * time.Millisecond)
err = s.Prepare(config)
if err != nil {

View File

@ -157,9 +157,9 @@ var config = configuration{
Port: 53,
StatsInterval: 1,
FilteringConfig: dnsforward.FilteringConfig{
ProtectionEnabled: true, // whether or not use any of dnsfilter features
BlockingMode: "nxdomain", // mode how to answer filtered requests
BlockedResponseTTL: 10, // in seconds
ProtectionEnabled: true, // whether or not use any of dnsfilter features
BlockingMode: "null_ip", // mode how to answer filtered requests
BlockedResponseTTL: 10, // in seconds
Ratelimit: 20,
RefuseAny: true,
AllServers: false,

View File

@ -172,7 +172,7 @@ func run(args options) {
log.Fatalf("%s", err)
}
go func() {
err = startDNSServer()
err := startDNSServer()
if err != nil {
log.Fatal(err)
}