docstring_tokens
stringlengths 0
76.5k
| code_tokens
stringlengths 75
1.81M
| label_window
sequencelengths 4
2.12k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|
check(err) | <mask> fatalOnError(err)
<mask>
<mask> web := confMgr.Web()
<mask> err = web.Start()
<mask> fatalOnError(err)
<mask>
<mask> dns := confMgr.DNS()
<mask> err = dns.Start()
<mask> fatalOnError(err)
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/cmd/signal.go |
check(err) | <mask> fatalOnError(err)
<mask>
<mask> dns := confMgr.DNS()
<mask> err = dns.Start()
<mask> fatalOnError(err)
<mask>
<mask> h.services = []agh.Service{
<mask> dns,
<mask> web,
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove fatalOnError(err)
</s> add check(err) </s> remove fatalOnError(err)
</s> add check(err) </s> remove fatalOnError(err)
</s> add check(err) </s> remove confMgr, err := configmgr.New(confFile, start)
fatalOnError(err)
</s> add confMgr, err := configmgr.New(confFile, frontend, start)
check(err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/cmd/signal.go |
func newSignalHandler(
confFile string,
frontend fs.FS,
start time.Time,
svcs ...agh.Service,
) (h *signalHandler) { | <mask> return status
<mask> }
<mask>
<mask> // newSignalHandler returns a new signalHandler that shuts down svcs.
<mask> func newSignalHandler(confFile string, start time.Time, svcs ...agh.Service) (h *signalHandler) {
<mask> h = &signalHandler{
<mask> signal: make(chan os.Signal, 1),
<mask> confFile: confFile,
<mask> start: start,
<mask> services: svcs,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove func New(fileName string, start time.Time) (m *Manager, err error) {
</s> add func New(
fileName string,
frontend fs.FS,
start time.Time,
) (m *Manager, err error) { </s> remove return svc
</s> add return svc, nil </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { </s> remove const defaultTimeout = 15 * time.Second
</s> add const defaultTimeout = 5 * time.Second | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/cmd/signal.go |
frontend: frontend, | <mask> h = &signalHandler{
<mask> signal: make(chan os.Signal, 1),
<mask> confFile: confFile,
<mask> start: start,
<mask> services: svcs,
<mask> }
<mask>
<mask> aghos.NotifyShutdownSignal(h.signal)
<mask> aghos.NotifyReconfigureSignal(h.signal)
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove func newSignalHandler(confFile string, start time.Time, svcs ...agh.Service) (h *signalHandler) {
</s> add func newSignalHandler(
confFile string,
frontend fs.FS,
start time.Time,
svcs ...agh.Service,
) (h *signalHandler) { </s> remove fatalOnError(err)
</s> add check(err) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/cmd/signal.go |
"io/fs" | <mask> "context"
<mask> "fmt"
<mask> "os"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/agh"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc"
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove "math/rand"
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/configmgr/configmgr.go |
func New(
fileName string,
frontend fs.FS,
start time.Time,
) (m *Manager, err error) { | <mask>
<mask> // New creates a new *Manager that persists changes to the file pointed to by
<mask> // fileName. It reads the configuration file and populates the service fields.
<mask> // start is the startup time of AdGuard Home.
<mask> func New(fileName string, start time.Time) (m *Manager, err error) {
<mask> defer func() { err = errors.Annotate(err, "reading config") }()
<mask>
<mask> conf := &config{}
<mask> f, err := os.Open(fileName)
<mask> if err != nil {
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove func (m *Manager) assemble(ctx context.Context, conf *config, start time.Time) (err error) {
</s> add func (m *Manager) assemble(
ctx context.Context,
conf *config,
frontend fs.FS,
start time.Time,
) (err error) { </s> remove // Package cmd is the AdGuard Home entry point. It contains the on-disk
// configuration file utilities, signal processing logic, and so on.
</s> add // Package cmd is the AdGuard Home entry point. It assembles the configuration
// file manager, sets up signal processing logic, and so on. </s> remove log.Fatal(err)
</s> add panic(err) </s> remove // Main is the entry point of application.
func Main(clientBuildFS fs.FS) {
</s> add // Main is the entry point of AdGuard Home.
func Main(frontend fs.FS) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/configmgr/configmgr.go |
err = m.assemble(ctx, conf, frontend, start) | <mask> const assemblyTimeout = 5 * time.Second
<mask> ctx, cancel := context.WithTimeout(context.Background(), assemblyTimeout)
<mask> defer cancel()
<mask>
<mask> err = m.assemble(ctx, conf, start)
<mask> if err != nil {
<mask> // Don't wrap the error, because it's informative enough as is.
<mask> return nil, err
<mask> }
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove const defaultTimeout = 15 * time.Second
</s> add const defaultTimeout = 5 * time.Second </s> remove err := svc.Start()
</s> add err = svc.Start() </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) </s> remove // fatalOnError is a helper that exits the program with an error code if err is
// not nil. It must only be used within Main.
func fatalOnError(err error) {
</s> add // check is a simple error-checking helper. It must only be used within Main.
func check(err error) { </s> remove svc = websvc.New(c)
</s> add svc, err := websvc.New(c)
require.NoError(t, err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/configmgr/configmgr.go |
func (m *Manager) assemble(
ctx context.Context,
conf *config,
frontend fs.FS,
start time.Time,
) (err error) { | <mask> }
<mask>
<mask> // assemble creates all services and puts them into the corresponding fields.
<mask> // The fields of conf must not be modified after calling assemble.
<mask> func (m *Manager) assemble(ctx context.Context, conf *config, start time.Time) (err error) {
<mask> dnsConf := &dnssvc.Config{
<mask> Addresses: conf.DNS.Addresses,
<mask> BootstrapServers: conf.DNS.BootstrapDNS,
<mask> UpstreamServers: conf.DNS.UpstreamDNS,
<mask> UpstreamTimeout: conf.DNS.UpstreamTimeout.Duration,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove func New(fileName string, start time.Time) (m *Manager, err error) {
</s> add func New(
fileName string,
frontend fs.FS,
start time.Time,
) (m *Manager, err error) { </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) </s> remove // fatalOnError is a helper that exits the program with an error code if err is
// not nil. It must only be used within Main.
func fatalOnError(err error) {
</s> add // check is a simple error-checking helper. It must only be used within Main.
func check(err error) { </s> remove log.Fatal(err)
</s> add panic(err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/configmgr/configmgr.go |
Frontend: frontend, | <mask> }
<mask>
<mask> webSvcConf := &websvc.Config{
<mask> ConfigManager: m,
<mask> // TODO(a.garipov): Fill from config file.
<mask> TLS: nil,
<mask> Start: start,
<mask> Addresses: conf.HTTP.Addresses,
<mask> SecureAddresses: conf.HTTP.SecureAddresses,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove ConfigManager: confMgr,
</s> add ConfigManager: confMgr,
Frontend: &aghtest.FS{
OnOpen: func(_ string) (_ fs.File, _ error) { return nil, fs.ErrNotExist },
}, </s> remove return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: wantWeb.Addresses,
SecureAddresses: wantWeb.SecureAddresses,
Timeout: time.Duration(wantWeb.Timeout),
ForceHTTPS: true,
})
</s> add return svc | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/configmgr/configmgr.go |
m.web, err = websvc.New(c)
if err != nil {
return fmt.Errorf("creating web svc: %w", err)
} | <mask> return fmt.Errorf("shutting down web svc: %w", err)
<mask> }
<mask> }
<mask>
<mask> m.web = websvc.New(c)
<mask>
<mask> return nil
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) </s> remove svc = websvc.New(c)
</s> add svc, err := websvc.New(c)
require.NoError(t, err) </s> remove return svc
</s> add return svc, nil </s> remove err := svc.Start()
</s> add err = svc.Start() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/configmgr/configmgr.go |
Frontend: svc.frontend, | <mask> newConf := &Config{
<mask> ConfigManager: svc.confMgr,
<mask> TLS: svc.tls,
<mask> Addresses: req.Addresses,
<mask> SecureAddresses: req.SecureAddresses,
<mask> Timeout: time.Duration(req.Timeout),
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove ConfigManager: confMgr,
</s> add ConfigManager: confMgr,
Frontend: &aghtest.FS{
OnOpen: func(_ string) (_ fs.File, _ error) { return nil, fs.ErrNotExist },
}, </s> remove return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: wantWeb.Addresses,
SecureAddresses: wantWeb.SecureAddresses,
Timeout: time.Duration(wantWeb.Timeout),
ForceHTTPS: true,
})
</s> add return svc | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/http.go |
svc, err := websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:80")},
SecureAddresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:443")},
Timeout: 5 * time.Second,
ForceHTTPS: true,
})
require.NoError(t, err)
| <mask> }
<mask>
<mask> confMgr := newConfigManager()
<mask> confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) { return svc }
<mask> confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) { return nil }
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) {
return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:80")},
SecureAddresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:443")},
Timeout: 5 * time.Second,
ForceHTTPS: true,
})
}
confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) {
return nil
}
</s> add confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) { return svc }
confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) { return nil } </s> remove return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: wantWeb.Addresses,
SecureAddresses: wantWeb.SecureAddresses,
Timeout: time.Duration(wantWeb.Timeout),
ForceHTTPS: true,
})
</s> add return svc </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/http_test.go |
confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) { return svc }
confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) { return nil } | <mask> ForceHTTPS: false,
<mask> }
<mask>
<mask> confMgr := newConfigManager()
<mask> confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) {
<mask> return websvc.New(&websvc.Config{
<mask> TLS: &tls.Config{
<mask> Certificates: []tls.Certificate{{}},
<mask> },
<mask> Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:80")},
<mask> SecureAddresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:443")},
<mask> Timeout: 5 * time.Second,
<mask> ForceHTTPS: true,
<mask> })
<mask> }
<mask> confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) {
<mask> return nil
<mask> }
<mask>
<mask> _, addr := newTestServer(t, confMgr)
<mask> u := &url.URL{
<mask> Scheme: "http",
<mask> Host: addr.String(),
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: wantWeb.Addresses,
SecureAddresses: wantWeb.SecureAddresses,
Timeout: time.Duration(wantWeb.Timeout),
ForceHTTPS: true,
})
</s> add return svc </s> remove ConfigManager: confMgr,
</s> add ConfigManager: confMgr,
Frontend: &aghtest.FS{
OnOpen: func(_ string) (_ fs.File, _ error) { return nil, fs.ErrNotExist },
}, </s> remove func (m *Manager) assemble(ctx context.Context, conf *config, start time.Time) (err error) {
</s> add func (m *Manager) assemble(
ctx context.Context,
conf *config,
frontend fs.FS,
start time.Time,
) (err error) { | [
"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/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/http_test.go |
err = json.Unmarshal(respBody, resp) | <mask> }
<mask>
<mask> respBody := httpPatch(t, u, req, http.StatusOK)
<mask> resp := &websvc.HTTPAPIHTTPSettings{}
<mask> err := json.Unmarshal(respBody, resp)
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, wantWeb, resp)
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove err := json.Unmarshal(body, resp)
</s> add err = json.Unmarshal(body, resp) </s> remove svc = websvc.New(c)
</s> add svc, err := websvc.New(c)
require.NoError(t, err) </s> remove err := svc.Start()
</s> add err = svc.Start() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/http_test.go |
"time" | <mask>
<mask> import (
<mask> "net/http"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
<mask> "github.com/AdguardTeam/golibs/httphdr"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove "math/rand"
</s> add </s> remove // Main is the entry point of application.
func Main(clientBuildFS fs.FS) {
</s> add // Main is the entry point of AdGuard Home.
func Main(frontend fs.FS) { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/middleware.go |
"github.com/AdguardTeam/golibs/log" | <mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
<mask> "github.com/AdguardTeam/golibs/httphdr"
<mask> )
<mask>
<mask> // Middlewares
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove go sigHdlr.handle()
select {}
</s> add sigHdlr.handle() </s> remove // Main is the entry point of application.
func Main(clientBuildFS fs.FS) {
</s> add // Main is the entry point of AdGuard Home.
func Main(frontend fs.FS) { </s> remove func newSignalHandler(confFile string, start time.Time, svcs ...agh.Service) (h *signalHandler) {
</s> add func newSignalHandler(
confFile string,
frontend fs.FS,
start time.Time,
svcs ...agh.Service,
) (h *signalHandler) { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/middleware.go |
PathRoot = "/"
PathFrontend = "/*filepath"
| <mask>
<mask> // Path constants
<mask> const (
<mask> PathHealthCheck = "/health-check"
<mask>
<mask> PathV1SettingsAll = "/api/v1/settings/all"
<mask> PathV1SettingsDNS = "/api/v1/settings/dns"
<mask> PathV1SettingsHTTP = "/api/v1/settings/http"
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove "math/rand"
</s> add </s> remove const defaultTimeout = 15 * time.Second
</s> add const defaultTimeout = 5 * time.Second </s> remove go sigHdlr.handle()
select {}
</s> add sigHdlr.handle() | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/path.go |
svc, err := websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: wantWeb.Addresses,
SecureAddresses: wantWeb.SecureAddresses,
Timeout: time.Duration(wantWeb.Timeout),
ForceHTTPS: true,
})
require.NoError(t, err)
| <mask> return c
<mask> }
<mask>
<mask> confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) {
<mask> return svc
<mask> }
<mask>
<mask> _, addr := newTestServer(t, confMgr)
<mask> u := &url.URL{
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: wantWeb.Addresses,
SecureAddresses: wantWeb.SecureAddresses,
Timeout: time.Duration(wantWeb.Timeout),
ForceHTTPS: true,
})
</s> add return svc </s> remove confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) {
return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:80")},
SecureAddresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:443")},
Timeout: 5 * time.Second,
ForceHTTPS: true,
})
}
confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) {
return nil
}
</s> add confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) { return svc }
confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) { return nil } </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) </s> remove ConfigManager: confMgr,
</s> add ConfigManager: confMgr,
Frontend: &aghtest.FS{
OnOpen: func(_ string) (_ fs.File, _ error) { return nil, fs.ErrNotExist },
}, | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/settings_test.go |
return svc | <mask> return c
<mask> }
<mask>
<mask> confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) {
<mask> return websvc.New(&websvc.Config{
<mask> TLS: &tls.Config{
<mask> Certificates: []tls.Certificate{{}},
<mask> },
<mask> Addresses: wantWeb.Addresses,
<mask> SecureAddresses: wantWeb.SecureAddresses,
<mask> Timeout: time.Duration(wantWeb.Timeout),
<mask> ForceHTTPS: true,
<mask> })
<mask> }
<mask>
<mask> _, addr := newTestServer(t, confMgr)
<mask> u := &url.URL{
<mask> Scheme: "http",
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) {
return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:80")},
SecureAddresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:443")},
Timeout: 5 * time.Second,
ForceHTTPS: true,
})
}
confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) {
return nil
}
</s> add confMgr.onWeb = func() (s agh.ServiceWithConfig[*websvc.Config]) { return svc }
confMgr.onUpdateWeb = func(ctx context.Context, c *websvc.Config) (err error) { return nil } </s> remove ConfigManager: confMgr,
</s> add ConfigManager: confMgr,
Frontend: &aghtest.FS{
OnOpen: func(_ string) (_ fs.File, _ error) { return nil, fs.ErrNotExist },
}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/settings_test.go |
err = json.Unmarshal(body, resp) | <mask> }
<mask>
<mask> body := httpGet(t, u, http.StatusOK)
<mask> resp := &websvc.RespGetV1SettingsAll{}
<mask> err := json.Unmarshal(body, resp)
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, wantDNS, resp.DNS)
<mask> assert.Equal(t, wantWeb, resp.HTTP)
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove err := json.Unmarshal(respBody, resp)
</s> add err = json.Unmarshal(respBody, resp) </s> remove svc = websvc.New(c)
</s> add svc, err := websvc.New(c)
require.NoError(t, err) </s> remove err := svc.Start()
</s> add err = svc.Start() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/settings_test.go |
"io/fs" | <mask> "crypto/tls"
<mask> "fmt"
<mask> "io"
<mask> "net"
<mask> "net/http"
<mask> "net/netip"
<mask> "sync"
<mask> "time"
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove "math/rand"
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
// Frontend is the filesystem with the frontend and other statically
// compiled files.
Frontend fs.FS
| <mask> // dynamically reconfigure them.
<mask> ConfigManager ConfigManager
<mask>
<mask> // TLS is the optional TLS configuration. If TLS is not nil,
<mask> // SecureAddresses must not be empty.
<mask> TLS *tls.Config
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove log.Fatal(err)
</s> add panic(err) </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { </s> remove // fatalOnError is a helper that exits the program with an error code if err is
// not nil. It must only be used within Main.
func fatalOnError(err error) {
</s> add // check is a simple error-checking helper. It must only be used within Main.
func check(err error) { </s> remove confMgr, err := configmgr.New(h.confFile, h.start)
fatalOnError(err)
</s> add confMgr, err := configmgr.New(h.confFile, h.frontend, h.start)
check(err) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
frontend fs.FS | <mask> // Service is the AdGuard Home web service. A nil *Service is a valid
<mask> // [agh.Service] that does nothing.
<mask> type Service struct {
<mask> confMgr ConfigManager
<mask> tls *tls.Config
<mask> start time.Time
<mask> servers []*http.Server
<mask> timeout time.Duration
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove return svc
</s> add return svc, nil </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { </s> remove const defaultTimeout = 15 * time.Second
</s> add const defaultTimeout = 5 * time.Second | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
//
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { | <mask>
<mask> // New returns a new properly initialized *Service. If c is nil, svc is a nil
<mask> // *Service that does nothing. The fields of c must not be modified after
<mask> // calling New.
<mask> func New(c *Config) (svc *Service) {
<mask> if c == nil {
<mask> return nil
<mask> }
<mask>
<mask> svc = &Service{
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) </s> remove return svc
</s> add return svc, nil </s> remove // fatalOnError is a helper that exits the program with an error code if err is
// not nil. It must only be used within Main.
func fatalOnError(err error) {
</s> add // check is a simple error-checking helper. It must only be used within Main.
func check(err error) { </s> remove log.Fatal(err)
</s> add panic(err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) | <mask> // *Service that does nothing. The fields of c must not be modified after
<mask> // calling New.
<mask> func New(c *Config) (svc *Service) {
<mask> if c == nil {
<mask> return nil
<mask> }
<mask>
<mask> svc = &Service{
<mask> confMgr: c.ConfigManager,
<mask> tls: c.TLS,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { </s> remove func (m *Manager) assemble(ctx context.Context, conf *config, start time.Time) (err error) {
</s> add func (m *Manager) assemble(
ctx context.Context,
conf *config,
frontend fs.FS,
start time.Time,
) (err error) { </s> remove // fatalOnError is a helper that exits the program with an error code if err is
// not nil. It must only be used within Main.
func fatalOnError(err error) {
</s> add // check is a simple error-checking helper. It must only be used within Main.
func check(err error) { </s> remove log.Fatal(err)
</s> add panic(err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
frontend: frontend, | <mask> svc = &Service{
<mask> confMgr: c.ConfigManager,
<mask> tls: c.TLS,
<mask> start: c.Start,
<mask> timeout: c.Timeout,
<mask> forceHTTPS: c.ForceHTTPS,
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) </s> remove return svc
</s> add return svc, nil </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { </s> remove func newSignalHandler(confFile string, start time.Time, svcs ...agh.Service) (h *signalHandler) {
</s> add func newSignalHandler(
confFile string,
frontend fs.FS,
start time.Time,
svcs ...agh.Service,
) (h *signalHandler) { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
return svc, nil | <mask> ReadHeaderTimeout: c.Timeout,
<mask> })
<mask> }
<mask>
<mask> return svc
<mask> }
<mask>
<mask> // newMux returns a new HTTP request multiplexor for the AdGuard Home web
<mask> // service.
<mask> func newMux(svc *Service) (mux *httptreemux.ContextMux) {
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { </s> remove const defaultTimeout = 15 * time.Second
</s> add const defaultTimeout = 5 * time.Second </s> remove func newSignalHandler(confFile string, start time.Time, svcs ...agh.Service) (h *signalHandler) {
</s> add func newSignalHandler(
confFile string,
frontend fs.FS,
start time.Time,
svcs ...agh.Service,
) (h *signalHandler) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
pattern string | <mask>
<mask> routes := []struct {
<mask> handler http.HandlerFunc
<mask> method string
<mask> path string
<mask> isJSON bool
<mask> }{{
<mask> handler: svc.handleGetHealthCheck,
<mask> method: http.MethodGet,
<mask> path: PathHealthCheck,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove path: PathHealthCheck,
</s> add pattern: PathHealthCheck,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathFrontend,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathRoot, </s> remove path: PathV1SettingsAll,
</s> add pattern: PathV1SettingsAll, </s> remove path: PathV1SettingsHTTP,
</s> add pattern: PathV1SettingsHTTP, </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, </s> remove path: PathV1SettingsDNS,
</s> add pattern: PathV1SettingsDNS, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
pattern: PathHealthCheck,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathFrontend,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathRoot, | <mask> isJSON bool
<mask> }{{
<mask> handler: svc.handleGetHealthCheck,
<mask> method: http.MethodGet,
<mask> path: PathHealthCheck,
<mask> isJSON: false,
<mask> }, {
<mask> handler: svc.handleGetSettingsAll,
<mask> method: http.MethodGet,
<mask> path: PathV1SettingsAll,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove path: PathV1SettingsAll,
</s> add pattern: PathV1SettingsAll, </s> remove path string
</s> add pattern string </s> remove path: PathV1SettingsHTTP,
</s> add pattern: PathV1SettingsHTTP, </s> remove path: PathV1SettingsDNS,
</s> add pattern: PathV1SettingsDNS, </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
pattern: PathV1SettingsAll, | <mask> isJSON: false,
<mask> }, {
<mask> handler: svc.handleGetSettingsAll,
<mask> method: http.MethodGet,
<mask> path: PathV1SettingsAll,
<mask> isJSON: true,
<mask> }, {
<mask> handler: svc.handlePatchSettingsDNS,
<mask> method: http.MethodPatch,
<mask> path: PathV1SettingsDNS,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove path: PathV1SettingsDNS,
</s> add pattern: PathV1SettingsDNS, </s> remove path: PathHealthCheck,
</s> add pattern: PathHealthCheck,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathFrontend,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathRoot, </s> remove path: PathV1SettingsHTTP,
</s> add pattern: PathV1SettingsHTTP, </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, </s> remove path string
</s> add pattern string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
pattern: PathV1SettingsDNS, | <mask> isJSON: true,
<mask> }, {
<mask> handler: svc.handlePatchSettingsDNS,
<mask> method: http.MethodPatch,
<mask> path: PathV1SettingsDNS,
<mask> isJSON: true,
<mask> }, {
<mask> handler: svc.handlePatchSettingsHTTP,
<mask> method: http.MethodPatch,
<mask> path: PathV1SettingsHTTP,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove path: PathV1SettingsHTTP,
</s> add pattern: PathV1SettingsHTTP, </s> remove path: PathV1SettingsAll,
</s> add pattern: PathV1SettingsAll, </s> remove path: PathHealthCheck,
</s> add pattern: PathHealthCheck,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathFrontend,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathRoot, </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, </s> remove path string
</s> add pattern string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
pattern: PathV1SettingsHTTP, | <mask> isJSON: true,
<mask> }, {
<mask> handler: svc.handlePatchSettingsHTTP,
<mask> method: http.MethodPatch,
<mask> path: PathV1SettingsHTTP,
<mask> isJSON: true,
<mask> }, {
<mask> handler: svc.handleGetV1SystemInfo,
<mask> method: http.MethodGet,
<mask> path: PathV1SystemInfo,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove path: PathV1SettingsDNS,
</s> add pattern: PathV1SettingsDNS, </s> remove path: PathV1SettingsAll,
</s> add pattern: PathV1SettingsAll, </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, </s> remove path: PathHealthCheck,
</s> add pattern: PathHealthCheck,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathFrontend,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathRoot, </s> remove path string
</s> add pattern string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
pattern: PathV1SystemInfo, | <mask> isJSON: true,
<mask> }, {
<mask> handler: svc.handleGetV1SystemInfo,
<mask> method: http.MethodGet,
<mask> path: PathV1SystemInfo,
<mask> isJSON: true,
<mask> }}
<mask>
<mask> for _, r := range routes {
<mask> if r.isJSON {
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove path: PathV1SettingsHTTP,
</s> add pattern: PathV1SettingsHTTP, </s> remove path: PathV1SettingsAll,
</s> add pattern: PathV1SettingsAll, </s> remove path: PathV1SettingsDNS,
</s> add pattern: PathV1SettingsDNS, </s> remove path: PathHealthCheck,
</s> add pattern: PathHealthCheck,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathFrontend,
isJSON: false,
}, {
handler: http.FileServer(http.FS(svc.frontend)).ServeHTTP,
method: http.MethodGet,
pattern: PathRoot, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
var hdlr http.Handler | <mask> }}
<mask>
<mask> for _, r := range routes {
<mask> if r.isJSON {
<mask> hdlr = jsonMw(r.handler)
<mask> } else {
<mask> hdlr = r.handler
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove mux.Handle(r.method, r.path, jsonMw(r.handler))
</s> add hdlr = jsonMw(r.handler) </s> remove mux.Handle(r.method, r.path, r.handler)
</s> add hdlr = r.handler </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, </s> remove path string
</s> add pattern string | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
hdlr = jsonMw(r.handler) | <mask> }}
<mask>
<mask> for _, r := range routes {
<mask> if r.isJSON {
<mask> mux.Handle(r.method, r.path, jsonMw(r.handler))
<mask> } else {
<mask> mux.Handle(r.method, r.path, r.handler)
<mask> }
<mask> }
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove mux.Handle(r.method, r.path, r.handler)
</s> add hdlr = r.handler </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, </s> remove path string
</s> add pattern string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
hdlr = r.handler | <mask> for _, r := range routes {
<mask> if r.isJSON {
<mask> mux.Handle(r.method, r.path, jsonMw(r.handler))
<mask> } else {
<mask> mux.Handle(r.method, r.path, r.handler)
<mask> }
<mask> }
<mask>
<mask> return mux
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove mux.Handle(r.method, r.path, jsonMw(r.handler))
</s> add hdlr = jsonMw(r.handler) </s> remove path: PathV1SystemInfo,
</s> add pattern: PathV1SystemInfo, </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
mux.Handle(r.method, r.pattern, logMw(hdlr)) | <mask> hdlr = jsonMw(r.handler)
<mask> } else {
<mask> hdlr = r.handler
<mask> }
<mask> }
<mask>
<mask> return mux
<mask> }
<mask>
<mask> // addrs returns all addresses on which this server serves the HTTP API. addrs
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove mux.Handle(r.method, r.path, r.handler)
</s> add hdlr = r.handler </s> remove mux.Handle(r.method, r.path, jsonMw(r.handler))
</s> add hdlr = jsonMw(r.handler) </s> remove return svc
</s> add return svc, nil </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc.go |
"io/fs" | <mask> "bytes"
<mask> "context"
<mask> "encoding/json"
<mask> "io"
<mask> "net/http"
<mask> "net/netip"
<mask> "net/url"
<mask> "testing"
<mask> "time"
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove "math/rand"
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc_test.go |
"github.com/AdguardTeam/AdGuardHome/internal/aghtest" | <mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/agh"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/websvc"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove "math/rand"
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc_test.go |
ConfigManager: confMgr,
Frontend: &aghtest.FS{
OnOpen: func(_ string) (_ fs.File, _ error) { return nil, fs.ErrNotExist },
}, | <mask> ) (svc *websvc.Service, addr netip.AddrPort) {
<mask> t.Helper()
<mask>
<mask> c := &websvc.Config{
<mask> ConfigManager: confMgr,
<mask> TLS: nil,
<mask> Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:0")},
<mask> SecureAddresses: nil,
<mask> Timeout: testTimeout,
<mask> Start: testStart,
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove return websvc.New(&websvc.Config{
TLS: &tls.Config{
Certificates: []tls.Certificate{{}},
},
Addresses: wantWeb.Addresses,
SecureAddresses: wantWeb.SecureAddresses,
Timeout: time.Duration(wantWeb.Timeout),
ForceHTTPS: true,
})
</s> add return svc </s> remove return nil
</s> add return nil, nil
}
frontend, err := fs.Sub(c.Frontend, "build/static")
if err != nil {
return nil, fmt.Errorf("frontend fs: %w", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc_test.go |
svc, err := websvc.New(c)
require.NoError(t, err) | <mask> Start: testStart,
<mask> ForceHTTPS: false,
<mask> }
<mask>
<mask> svc = websvc.New(c)
<mask>
<mask> err := svc.Start()
<mask> require.NoError(t, err)
<mask> t.Cleanup(func() {
<mask> ctx, cancel := context.WithTimeout(context.Background(), testTimeout)
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove err := svc.Start()
</s> add err = svc.Start() </s> remove m.web = websvc.New(c)
</s> add m.web, err = websvc.New(c)
if err != nil {
return fmt.Errorf("creating web svc: %w", err)
} </s> remove err = m.assemble(ctx, conf, start)
</s> add err = m.assemble(ctx, conf, frontend, start) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc_test.go |
err = svc.Start() | <mask> }
<mask>
<mask> svc = websvc.New(c)
<mask>
<mask> err := svc.Start()
<mask> require.NoError(t, err)
<mask> t.Cleanup(func() {
<mask> ctx, cancel := context.WithTimeout(context.Background(), testTimeout)
<mask> t.Cleanup(cancel)
<mask>
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove svc = websvc.New(c)
</s> add svc, err := websvc.New(c)
require.NoError(t, err) </s> remove m.web = websvc.New(c)
</s> add m.web, err = websvc.New(c)
if err != nil {
return fmt.Errorf("creating web svc: %w", err)
} </s> remove err = m.assemble(ctx, conf, start)
</s> add err = m.assemble(ctx, conf, frontend, start) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | internal/next/websvc/websvc_test.go |
var frontend embed.FS | <mask> // internal directory and the embed package is unable to embed files located
<mask> // outside of the same or underlying directory.
<mask>
<mask> //go:embed build
<mask> var clientBuildFS embed.FS
<mask>
<mask> func main() {
<mask> cmd.Main(clientBuildFS)
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove cmd.Main(clientBuildFS)
</s> add cmd.Main(frontend) </s> remove // Package cmd is the AdGuard Home entry point. It contains the on-disk
// configuration file utilities, signal processing logic, and so on.
</s> add // Package cmd is the AdGuard Home entry point. It assembles the configuration
// file manager, sets up signal processing logic, and so on. </s> remove // Main is the entry point of application.
func Main(clientBuildFS fs.FS) {
</s> add // Main is the entry point of AdGuard Home.
func Main(frontend fs.FS) { </s> remove func New(fileName string, start time.Time) (m *Manager, err error) {
</s> add func New(
fileName string,
frontend fs.FS,
start time.Time,
) (m *Manager, err error) { </s> remove func New(c *Config) (svc *Service) {
</s> add //
// TODO(a.garipov): Get rid of this special handling of nil or explain it
// better.
func New(c *Config) (svc *Service, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | main_next.go |
cmd.Main(frontend) | <mask> //go:embed build
<mask> var clientBuildFS embed.FS
<mask>
<mask> func main() {
<mask> cmd.Main(clientBuildFS)
<mask> }
</s> Pull request 1870: nextapi-frontend-fs
Merge in DNS/adguard-home from nextapi-frontend-fs to master
Squashed commit of the following:
commit 3ed959f21939cf5590c27426af46906cbffed502
Merge: e60bbdd04 9fda7bfd3
Author: Ainar Garipov <[email protected]>
Date: Tue Jun 13 13:37:00 2023 +0300
Merge branch 'master' into nextapi-frontend-fs
commit e60bbdd04ce841c1aaaa198cc9dc85ae14799ffa
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 9 14:53:09 2023 +0300
next: support frontend fs </s> remove var clientBuildFS embed.FS
</s> add var frontend embed.FS </s> remove // fatalOnError is a helper that exits the program with an error code if err is
// not nil. It must only be used within Main.
func fatalOnError(err error) {
</s> add // check is a simple error-checking helper. It must only be used within Main.
func check(err error) { </s> remove // Main is the entry point of application.
func Main(clientBuildFS fs.FS) {
</s> add // Main is the entry point of AdGuard Home.
func Main(frontend fs.FS) { </s> remove // TODO(a.garipov): Use in the Web service.
_ = clientBuildFS
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/681c604c228942dfcb90c02f88e0fe148c7acd67 | main_next.go |
<mask> maxAttempts int,
<mask> backoff time.Duration,
<mask> ) (addrs []net.IP, err error) {
<mask> var n int
<mask> waitForIP:
<mask> for n = 1; n <= maxAttempts; n++ {
<mask> addrs, err = ifaceIPAddrs(iface, ipv)
<mask> if err != nil {
<mask> return nil, fmt.Errorf("getting ip addrs: %w", err)
<mask> }
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove switch len(addrs) {
case 0:
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff)
case 1:
// Some Android devices use 8.8.8.8 if there is not
// a secondary DNS server. Fix that by setting the
// secondary DNS address to the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
fallthrough
default:
break waitForIP
</s> add if len(addrs) > 0 {
break </s> remove log.Debug("DHCPv6: removed lease %s", s.leases[i].HWAddr)
</s> add log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) </s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Error("dhcpv%d: no ip address for interface after %d attempts and %s", ipv, n, time.Duration(n)*backoff)
} else {
log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
</s> add t := time.Duration(n) * backoff
log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t)
return nil, nil
case 1:
// Some Android devices use 8.8.8.8 if there is not a secondary
// DNS server. Fix that by setting the secondary DNS address to
// the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
default:
// Go on. </s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v46.go |
|
if len(addrs) > 0 {
break | <mask> if err != nil {
<mask> return nil, fmt.Errorf("getting ip addrs: %w", err)
<mask> }
<mask>
<mask> switch len(addrs) {
<mask> case 0:
<mask> log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
<mask>
<mask> time.Sleep(backoff)
<mask> case 1:
<mask> // Some Android devices use 8.8.8.8 if there is not
<mask> // a secondary DNS server. Fix that by setting the
<mask> // secondary DNS address to the same address.
<mask> //
<mask> // See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
<mask> log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
<mask> addrs = append(addrs, addrs[0])
<mask>
<mask> fallthrough
<mask> default:
<mask> break waitForIP
<mask> }
<mask> }
<mask>
<mask> if len(addrs) == 0 {
<mask> // Don't return errors in case the users want to try and enable
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Error("dhcpv%d: no ip address for interface after %d attempts and %s", ipv, n, time.Duration(n)*backoff)
} else {
log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
</s> add t := time.Duration(n) * backoff
log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t)
return nil, nil
case 1:
// Some Android devices use 8.8.8.8 if there is not a secondary
// DNS server. Fix that by setting the secondary DNS address to
// the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
default:
// Go on. </s> remove if len(addrs) == 0 {
</s> add switch len(addrs) {
case 0: </s> remove waitForIP:
</s> add </s> remove fallthrough
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"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/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v46.go |
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff) | <mask>
<mask> if len(addrs) > 0 {
<mask> break
<mask> }
<mask> }
<mask>
<mask> switch len(addrs) {
<mask> case 0:
<mask> // Don't return errors in case the users want to try and enable
<mask> // the DHCP server later.
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove if len(addrs) == 0 {
</s> add switch len(addrs) {
case 0: </s> remove switch len(addrs) {
case 0:
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff)
case 1:
// Some Android devices use 8.8.8.8 if there is not
// a secondary DNS server. Fix that by setting the
// secondary DNS address to the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
fallthrough
default:
break waitForIP
</s> add if len(addrs) > 0 {
break </s> remove log.Error("dhcpv%d: no ip address for interface after %d attempts and %s", ipv, n, time.Duration(n)*backoff)
} else {
log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
</s> add t := time.Duration(n) * backoff
log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t)
return nil, nil
case 1:
// Some Android devices use 8.8.8.8 if there is not a secondary
// DNS server. Fix that by setting the secondary DNS address to
// the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
default:
// Go on. </s> remove fallthrough
</s> add </s> remove log.Debug("DHCPv6: removed lease %s", s.leases[i].HWAddr)
</s> add log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v46.go |
switch len(addrs) {
case 0: | <mask> break waitForIP
<mask> }
<mask> }
<mask>
<mask> if len(addrs) == 0 {
<mask> // Don't return errors in case the users want to try and enable
<mask> // the DHCP server later.
<mask> log.Error("dhcpv%d: no ip address for interface after %d attempts and %s", ipv, n, time.Duration(n)*backoff)
<mask> } else {
<mask> log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Error("dhcpv%d: no ip address for interface after %d attempts and %s", ipv, n, time.Duration(n)*backoff)
} else {
log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
</s> add t := time.Duration(n) * backoff
log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t)
return nil, nil
case 1:
// Some Android devices use 8.8.8.8 if there is not a secondary
// DNS server. Fix that by setting the secondary DNS address to
// the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
default:
// Go on. </s> remove switch len(addrs) {
case 0:
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff)
case 1:
// Some Android devices use 8.8.8.8 if there is not
// a secondary DNS server. Fix that by setting the
// secondary DNS address to the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
fallthrough
default:
break waitForIP
</s> add if len(addrs) > 0 {
break </s> remove log.Error("DHCPv6: message type %d not supported", msg.Type())
</s> add log.Error("dhcpv6: message type %d not supported", msg.Type())
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v46.go |
t := time.Duration(n) * backoff
log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t)
return nil, nil
case 1:
// Some Android devices use 8.8.8.8 if there is not a secondary
// DNS server. Fix that by setting the secondary DNS address to
// the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
default:
// Go on. | <mask>
<mask> if len(addrs) == 0 {
<mask> // Don't return errors in case the users want to try and enable
<mask> // the DHCP server later.
<mask> log.Error("dhcpv%d: no ip address for interface after %d attempts and %s", ipv, n, time.Duration(n)*backoff)
<mask> } else {
<mask> log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
<mask> }
<mask>
<mask> return addrs, nil
<mask> }
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove if len(addrs) == 0 {
</s> add switch len(addrs) {
case 0: </s> remove switch len(addrs) {
case 0:
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff)
case 1:
// Some Android devices use 8.8.8.8 if there is not
// a secondary DNS server. Fix that by setting the
// secondary DNS address to the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
fallthrough
default:
break waitForIP
</s> add if len(addrs) > 0 {
break </s> remove waitForIP:
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v46.go |
log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
| <mask> default:
<mask> // Go on.
<mask> }
<mask>
<mask> return addrs, nil
<mask> }
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Error("dhcpv%d: no ip address for interface after %d attempts and %s", ipv, n, time.Duration(n)*backoff)
} else {
log.Debug("dhcpv%d: got addresses %s after %d attempts", ipv, addrs, n)
</s> add t := time.Duration(n) * backoff
log.Error("dhcpv%d: no ip for iface after %d attempts and %s", ipv, n, t)
return nil, nil
case 1:
// Some Android devices use 8.8.8.8 if there is not a secondary
// DNS server. Fix that by setting the secondary DNS address to
// the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
default:
// Go on. </s> remove log.Error("DHCPv6: message type %d not supported", msg.Type())
</s> add log.Error("dhcpv6: message type %d not supported", msg.Type())
</s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove waitForIP:
</s> add </s> remove if len(addrs) == 0 {
</s> add switch len(addrs) {
case 0: | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v46.go |
log.Debug("dhcpv6: skipping a lease with IP %v: not within current IP range", l.IP)
| <mask>
<mask> if l.Expiry.Unix() != leaseExpireStatic &&
<mask> !ip6InRange(s.conf.ipStart, l.IP) {
<mask>
<mask> log.Debug("DHCPv6: skipping a lease with IP %v: not within current IP range", l.IP)
<mask> continue
<mask> }
<mask>
<mask> s.addLease(l)
<mask> }
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: added lease %s <-> %s", l.IP, l.HWAddr)
</s> add log.Debug("dhcpv6: added lease %s <-> %s", l.IP, l.HWAddr) </s> remove log.Debug("DHCPv6: removed lease %s", s.leases[i].HWAddr)
</s> add log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
</s> remove log.Debug("DHCPv6: no lease for: %s", mac)
</s> add log.Debug("dhcpv6: no lease for: %s", mac) </s> remove log.Error("DHCPv6: message type %d not supported", msg.Type())
</s> add log.Error("dhcpv6: message type %d not supported", msg.Type())
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) | <mask>
<mask> // Remove (swap) lease by index
<mask> func (s *v6Server) leaseRemoveSwapByIndex(i int) {
<mask> s.ipAddrs[s.leases[i].IP[15]] = 0
<mask> log.Debug("DHCPv6: removed lease %s", s.leases[i].HWAddr)
<mask>
<mask> n := len(s.leases)
<mask> if i != n-1 {
<mask> s.leases[i] = s.leases[n-1] // swap with the last element
<mask> }
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: added lease %s <-> %s", l.IP, l.HWAddr)
</s> add log.Debug("dhcpv6: added lease %s <-> %s", l.IP, l.HWAddr) </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Debug("DHCPv6: no lease for: %s", mac)
</s> add log.Debug("dhcpv6: no lease for: %s", mac) </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
</s> remove log.Debug("DHCPv6: skipping a lease with IP %v: not within current IP range", l.IP)
</s> add log.Debug("dhcpv6: skipping a lease with IP %v: not within current IP range", l.IP)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: added lease %s <-> %s", l.IP, l.HWAddr) | <mask> // Add a lease
<mask> func (s *v6Server) addLease(l *Lease) {
<mask> s.leases = append(s.leases, l)
<mask> s.ipAddrs[l.IP[15]] = 1
<mask> log.Debug("DHCPv6: added lease %s <-> %s", l.IP, l.HWAddr)
<mask> }
<mask>
<mask> // Remove a lease with the same properties
<mask> func (s *v6Server) rmLease(lease Lease) error {
<mask> for i, l := range s.leases {
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: removed lease %s", s.leases[i].HWAddr)
</s> add log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Debug("DHCPv6: skipping a lease with IP %v: not within current IP range", l.IP)
</s> add log.Debug("dhcpv6: skipping a lease with IP %v: not within current IP range", l.IP)
</s> remove log.Debug("DHCPv6: no lease for: %s", mac)
</s> add log.Debug("dhcpv6: no lease for: %s", mac) </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
| <mask> }
<mask>
<mask> mac, err := dhcpv6.ExtractMAC(req)
<mask> if err != nil {
<mask> log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
<mask> return false
<mask> }
<mask>
<mask> lease := s.findLease(mac)
<mask> if lease == nil {
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: no lease for: %s", mac)
</s> add log.Debug("dhcpv6: no lease for: %s", mac) </s> remove log.Debug("DHCPv6: %s", err)
</s> add log.Debug("dhcpv6: %s", err)
</s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: no lease for: %s", mac) | <mask> }
<mask>
<mask> lease := s.findLease(mac)
<mask> if lease == nil {
<mask> log.Debug("DHCPv6: no lease for: %s", mac)
<mask>
<mask> switch msg.Type() {
<mask>
<mask> case dhcpv6.MessageTypeSolicit:
<mask> lease = s.reserveLease(mac)
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
</s> remove log.Debug("DHCPv6: removed lease %s", s.leases[i].HWAddr)
</s> add log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) </s> remove log.Debug("DHCPv6: added lease %s <-> %s", l.IP, l.HWAddr)
</s> add log.Debug("dhcpv6: added lease %s <-> %s", l.IP, l.HWAddr) </s> remove log.Debug("DHCPv6: skipping a lease with IP %v: not within current IP range", l.IP)
</s> add log.Debug("dhcpv6: skipping a lease with IP %v: not within current IP range", l.IP)
</s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: %s", err)
| <mask> }
<mask>
<mask> err = s.checkIA(msg, lease)
<mask> if err != nil {
<mask> log.Debug("DHCPv6: %s", err)
<mask> return false
<mask> }
<mask>
<mask> lifetime := s.commitLease(msg, lease)
<mask>
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
</s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) </s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Error("dhcpv6: %s", err)
| <mask> // fe80::* --(Release + ClientID+ServerID+IANA(IAAddress))-> ff02::1:2
<mask> func (s *v6Server) packetHandler(conn net.PacketConn, peer net.Addr, req dhcpv6.DHCPv6) {
<mask> msg, err := req.GetInnerMessage()
<mask> if err != nil {
<mask> log.Error("DHCPv6: %s", err)
<mask> return
<mask> }
<mask>
<mask> log.Debug("DHCPv6: received: %s", req.Summary())
<mask>
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Debug("DHCPv6: added lease %s <-> %s", l.IP, l.HWAddr)
</s> add log.Debug("dhcpv6: added lease %s <-> %s", l.IP, l.HWAddr) </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
</s> remove log.Debug("DHCPv6: removed lease %s", s.leases[i].HWAddr)
</s> add log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) </s> remove log.Debug("DHCPv6: %s", err)
</s> add log.Debug("dhcpv6: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: received: %s", req.Summary()) | <mask> log.Error("DHCPv6: %s", err)
<mask> return
<mask> }
<mask>
<mask> log.Debug("DHCPv6: received: %s", req.Summary())
<mask>
<mask> err = s.checkCID(msg)
<mask> if err != nil {
<mask> log.Debug("%s", err)
<mask> return
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Debug("DHCPv6: %s", err)
</s> add log.Debug("dhcpv6: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
<mask> if msg.GetOneOption(dhcpv6.OptionRapidCommit) == nil {
<mask> resp, err = dhcpv6.NewAdvertiseFromSolicit(msg)
<mask> break
<mask> }
<mask> fallthrough
<mask>
<mask> case dhcpv6.MessageTypeRequest,
<mask> dhcpv6.MessageTypeConfirm,
<mask> dhcpv6.MessageTypeRenew,
<mask> dhcpv6.MessageTypeRebind,
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove switch len(addrs) {
case 0:
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff)
case 1:
// Some Android devices use 8.8.8.8 if there is not
// a secondary DNS server. Fix that by setting the
// secondary DNS address to the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
fallthrough
default:
break waitForIP
</s> add if len(addrs) > 0 {
break </s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove case filtering.FilteredBlockList:
fallthrough
case filtering.FilteredInvalid:
fallthrough
case filtering.FilteredBlockedService:
</s> add case filtering.FilteredBlockList,
filtering.FilteredInvalid,
filtering.FilteredBlockedService: </s> remove log.Error("DHCPv6: message type %d not supported", msg.Type())
</s> add log.Error("dhcpv6: message type %d not supported", msg.Type())
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
|
resp, err = dhcpv6.NewReplyFromMessage(msg) | <mask> break
<mask> }
<mask>
<mask> case dhcpv6.MessageTypeRequest,
<mask> dhcpv6.MessageTypeConfirm,
<mask> dhcpv6.MessageTypeRenew,
<mask> dhcpv6.MessageTypeRebind,
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove fallthrough
</s> add </s> remove if len(addrs) == 0 {
</s> add switch len(addrs) {
case 0: </s> remove switch len(addrs) {
case 0:
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff)
case 1:
// Some Android devices use 8.8.8.8 if there is not
// a secondary DNS server. Fix that by setting the
// secondary DNS address to the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
fallthrough
default:
break waitForIP
</s> add if len(addrs) > 0 {
break </s> remove case filtering.FilteredBlockList:
fallthrough
case filtering.FilteredInvalid:
fallthrough
case filtering.FilteredBlockedService:
</s> add case filtering.FilteredBlockList,
filtering.FilteredInvalid,
filtering.FilteredBlockedService: | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Error("dhcpv6: message type %d not supported", msg.Type())
| <mask> dhcpv6.MessageTypeInformationRequest:
<mask> resp, err = dhcpv6.NewReplyFromMessage(msg)
<mask>
<mask> default:
<mask> log.Error("DHCPv6: message type %d not supported", msg.Type())
<mask> return
<mask> }
<mask>
<mask> if err != nil {
<mask> log.Error("DHCPv6: %s", err)
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Error("dhcpv6: %s", err)
| <mask> return
<mask> }
<mask>
<mask> if err != nil {
<mask> log.Error("DHCPv6: %s", err)
<mask> return
<mask> }
<mask>
<mask> resp.AddOption(dhcpv6.OptServerID(s.sid))
<mask>
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) </s> remove log.Debug("DHCPv6: sending: %s", resp.Summary())
</s> add log.Debug("dhcpv6: sending: %s", resp.Summary()) </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: sending: %s", resp.Summary()) | <mask> resp.AddOption(dhcpv6.OptServerID(s.sid))
<mask>
<mask> _ = s.process(msg, req, resp)
<mask>
<mask> log.Debug("DHCPv6: sending: %s", resp.Summary())
<mask>
<mask> _, err = conn.WriteTo(resp.ToBytes(), peer)
<mask> if err != nil {
<mask> log.Error("DHCPv6: conn.Write to %s failed: %s", peer, err)
<mask> return
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Error("DHCPv6: conn.Write to %s failed: %s", peer, err)
</s> add log.Error("dhcpv6: conn.Write to %s failed: %s", peer, err)
</s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) </s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Error("dhcpv6: conn.Write to %s failed: %s", peer, err)
| <mask> log.Debug("DHCPv6: sending: %s", resp.Summary())
<mask>
<mask> _, err = conn.WriteTo(resp.ToBytes(), peer)
<mask> if err != nil {
<mask> log.Error("DHCPv6: conn.Write to %s failed: %s", peer, err)
<mask> return
<mask> }
<mask> }
<mask>
<mask> // initialize RA module
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: sending: %s", resp.Summary())
</s> add log.Debug("dhcpv6: sending: %s", resp.Summary()) </s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) </s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Debug("dhcpv6: stopping") | <mask> if s.srv == nil {
<mask> return
<mask> }
<mask>
<mask> log.Debug("DHCPv6: stopping")
<mask> err = s.srv.Close()
<mask> if err != nil {
<mask> log.Error("DHCPv6: srv.Close: %s", err)
<mask> }
<mask>
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Error("DHCPv6: srv.Close: %s", err)
</s> add log.Error("dhcpv6: srv.Close: %s", err) </s> remove log.Debug("DHCPv6: dhcpv6.ExtractMAC: %s", err)
</s> add log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err)
</s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Debug("DHCPv6: %s", err)
</s> add log.Debug("dhcpv6: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
log.Error("dhcpv6: srv.Close: %s", err) | <mask>
<mask> log.Debug("DHCPv6: stopping")
<mask> err = s.srv.Close()
<mask> if err != nil {
<mask> log.Error("DHCPv6: srv.Close: %s", err)
<mask> }
<mask>
<mask> // now server.Serve() will return
<mask> s.srv = nil
<mask> }
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove log.Debug("DHCPv6: stopping")
</s> add log.Debug("dhcpv6: stopping") </s> remove log.Debug("DHCPv6: received: %s", req.Summary())
</s> add log.Debug("dhcpv6: received: %s", req.Summary()) </s> remove log.Debug("DHCPv6: %s", err)
</s> add log.Debug("dhcpv6: %s", err)
</s> remove log.Error("DHCPv6: %s", err)
</s> add log.Error("dhcpv6: %s", err)
</s> remove log.Error("DHCPv6: conn.Write to %s failed: %s", peer, err)
</s> add log.Error("dhcpv6: conn.Write to %s failed: %s", peer, err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dhcpd/v6.go |
case filtering.FilteredBlockList,
filtering.FilteredInvalid,
filtering.FilteredBlockedService: | <mask> case filtering.FilteredParental:
<mask> e.Result = stats.RParental
<mask> case filtering.FilteredSafeSearch:
<mask> e.Result = stats.RSafeSearch
<mask> case filtering.FilteredBlockList:
<mask> fallthrough
<mask> case filtering.FilteredInvalid:
<mask> fallthrough
<mask> case filtering.FilteredBlockedService:
<mask> e.Result = stats.RFiltered
<mask> }
<mask>
<mask> s.stats.Update(e)
<mask> }
</s> Pull request: all: avoid fallthrough
Merge in DNS/adguard-home from rm-fallthrough to master
Squashed commit of the following:
commit 14308b6cd3580d2c51b6da9f40b8a37766046708
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 18:16:42 2021 +0300
dhcpd: imp code
commit 2009219df7d35713d06848010ce57b387e407c0e
Author: Ainar Garipov <[email protected]>
Date: Fri May 21 17:54:38 2021 +0300
all: avoid fallthrough </s> remove fallthrough
</s> add </s> remove switch len(addrs) {
case 0:
log.Debug("dhcpv%d: attempt %d: no ip addresses", ipv, n)
time.Sleep(backoff)
case 1:
// Some Android devices use 8.8.8.8 if there is not
// a secondary DNS server. Fix that by setting the
// secondary DNS address to the same address.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/1708.
log.Debug("dhcpv%d: setting secondary dns ip to itself", ipv)
addrs = append(addrs, addrs[0])
fallthrough
default:
break waitForIP
</s> add if len(addrs) > 0 {
break </s> remove log.Debug("DHCPv6: no lease for: %s", mac)
</s> add log.Debug("dhcpv6: no lease for: %s", mac) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6847f7c8bb3a827cfe4b1798f64cd4e14d6c7173 | internal/dnsforward/stats.go |
<mask> export const sortClients = (clients) => {
<mask> const compare = (a, b) => {
<mask> const nameA = a.name.toUpperCase();
<mask> const nameB = b.name.toUpperCase();
<mask> let comparison = 0;
<mask>
<mask> if (nameA > nameB) {
<mask> comparison = 1;
<mask> } else if (nameA < nameB) {
<mask> comparison = -1;
</s> * client: fix sort helper </s> remove return comparison;
</s> add return 0; </s> remove comparison = -1;
</s> add return -1; </s> remove comparison = 1;
</s> add return 1; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68a4cc597f4da5bcd507c182e936683e426b0709 | client/src/helpers/helpers.js |
|
return 1; | <mask> const nameB = b.name.toUpperCase();
<mask> let comparison = 0;
<mask>
<mask> if (nameA > nameB) {
<mask> comparison = 1;
<mask> } else if (nameA < nameB) {
<mask> comparison = -1;
<mask> }
<mask>
<mask> return comparison;
</s> * client: fix sort helper </s> remove return comparison;
</s> add return 0; </s> remove let comparison = 0;
</s> add </s> remove comparison = -1;
</s> add return -1; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68a4cc597f4da5bcd507c182e936683e426b0709 | client/src/helpers/helpers.js |
return -1; | <mask>
<mask> if (nameA > nameB) {
<mask> comparison = 1;
<mask> } else if (nameA < nameB) {
<mask> comparison = -1;
<mask> }
<mask>
<mask> return comparison;
<mask> };
<mask>
</s> * client: fix sort helper </s> remove let comparison = 0;
</s> add </s> remove return comparison;
</s> add return 0; </s> remove comparison = 1;
</s> add return 1; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68a4cc597f4da5bcd507c182e936683e426b0709 | client/src/helpers/helpers.js |
return 0; | <mask> } else if (nameA < nameB) {
<mask> comparison = -1;
<mask> }
<mask>
<mask> return comparison;
<mask> };
<mask>
<mask> return clients.sort(compare);
<mask> };
</s> * client: fix sort helper </s> remove let comparison = 0;
</s> add </s> remove comparison = 1;
</s> add return 1; </s> remove comparison = -1;
</s> add return -1; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68a4cc597f4da5bcd507c182e936683e426b0709 | client/src/helpers/helpers.js |
log.Tracef("Current working directory is %s", config.ourBinaryDir) | <mask> configureLogger(args)
<mask>
<mask> // print the first message after logger is configured
<mask> log.Printf("AdGuard Home, version %s\n", VersionString)
<mask> log.Printf("Current working directory is %s", config.ourBinaryDir)
<mask> if args.runningAsService {
<mask> log.Printf("AdGuard Home is running as a service")
<mask> }
<mask>
<mask> config.firstRun = detectFirstRun()
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Got IP that is not IPv4: %v", ipnet.IP)
</s> add log.Tracef("Got IP that is not IPv4: %v", ipnet.IP) </s> remove log.Printf("Got IP that is IPv4: %v", ipnet.IP)
</s> add log.Tracef("Got IP that is IPv4: %v", ipnet.IP) </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
</s> add log.Tracef("got schema version %v", schemaVersionInterface) </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | app.go |
log.Tracef("Reading YAML file: %s", configFile) | <mask>
<mask> // parseConfig loads configuration from the YAML file
<mask> func parseConfig() error {
<mask> configFile := config.getConfigFilename()
<mask> log.Printf("Reading YAML file: %s", configFile)
<mask> yamlFile, err := readConfigFile()
<mask> if err != nil {
<mask> log.Printf("Couldn't read config file: %s", err)
<mask> return err
<mask> }
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Creating dnsfilter")
</s> add log.Tracef("Creating dnsfilter") </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
</s> add log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | config.go |
log.Tracef("Writing YAML file: %s", configFile) | <mask> log.Tracef("Silently refusing to write config because first run and not configured yet")
<mask> return nil
<mask> }
<mask> configFile := config.getConfigFilename()
<mask> log.Printf("Writing YAML file: %s", configFile)
<mask> yamlText, err := yaml.Marshal(&config)
<mask> if err != nil {
<mask> log.Printf("Couldn't generate YAML file: %s", err)
<mask> return err
<mask> }
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
</s> add log.Tracef("got schema version %v", schemaVersionInterface) </s> remove log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
</s> add log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | config.go |
log.Tracef("Got IP that is not IPv4: %v", ipnet.IP) | <mask> log.Fatalf("SHOULD NOT HAPPEN: got iface.Addrs() element %s that is not net.IPNet", addr)
<mask> }
<mask>
<mask> if ipnet.IP.To4() == nil {
<mask> log.Printf("Got IP that is not IPv4: %v", ipnet.IP)
<mask> continue
<mask> }
<mask>
<mask> log.Printf("Got IP that is IPv4: %v", ipnet.IP)
<mask> return &net.IPNet{
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Got IP that is IPv4: %v", ipnet.IP)
</s> add log.Tracef("Got IP that is IPv4: %v", ipnet.IP) </s> remove log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
</s> add log.Tracef("got schema version %v", schemaVersionInterface) </s> remove log.Printf("Current working directory is %s", config.ourBinaryDir)
</s> add log.Tracef("Current working directory is %s", config.ourBinaryDir) </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | dhcpd/helpers.go |
log.Tracef("Got IP that is IPv4: %v", ipnet.IP) | <mask> log.Printf("Got IP that is not IPv4: %v", ipnet.IP)
<mask> continue
<mask> }
<mask>
<mask> log.Printf("Got IP that is IPv4: %v", ipnet.IP)
<mask> return &net.IPNet{
<mask> IP: ipnet.IP.To4(),
<mask> Mask: ipnet.Mask,
<mask> }
<mask> }
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Got IP that is not IPv4: %v", ipnet.IP)
</s> add log.Tracef("Got IP that is not IPv4: %v", ipnet.IP) </s> remove log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
</s> add log.Tracef("got schema version %v", schemaVersionInterface) </s> remove log.Printf("Current working directory is %s", config.ourBinaryDir)
</s> add log.Tracef("Current working directory is %s", config.ourBinaryDir) </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | dhcpd/helpers.go |
log.Tracef("Loading stats from querylog") | <mask> if err != nil {
<mask> return err
<mask> }
<mask>
<mask> log.Printf("Loading stats from querylog")
<mask> err = fillStatsFromQueryLog()
<mask> if err != nil {
<mask> return errorx.Decorate(err, "failed to load stats from querylog")
<mask> }
<mask>
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Creating dnsfilter")
</s> add log.Tracef("Creating dnsfilter") </s> remove log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
</s> add log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | dnsforward/dnsforward.go |
log.Tracef("Creating dnsfilter") | <mask> }
<mask>
<mask> // Initializes the DNS filter
<mask> func (s *Server) initDNSFilter() error {
<mask> log.Printf("Creating dnsfilter")
<mask> s.dnsFilter = dnsfilter.New(&s.Config)
<mask> // add rules only if they are enabled
<mask> if s.FilteringEnabled {
<mask> err := s.dnsFilter.AddRules(s.Filters)
<mask> if err != nil {
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
</s> add log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | dnsforward/dnsforward.go |
log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) | <mask> return nil
<mask> }
<mask>
<mask> filterFilePath := filter.Path()
<mask> log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
<mask>
<mask> if _, err := os.Stat(filterFilePath); os.IsNotExist(err) {
<mask> // do nothing, file doesn't exist
<mask> return err
<mask> }
</s> Demote some log.printf into log.tracef </s> remove log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
</s> add log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Creating dnsfilter")
</s> add log.Tracef("Creating dnsfilter") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | filter.go |
log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) | <mask> if err != nil {
<mask> return err
<mask> }
<mask>
<mask> log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
<mask> rulesCount, _, rules := parseFilterContents(filterFileContents)
<mask>
<mask> filter.RulesCount = rulesCount
<mask> filter.Rules = rules
<mask>
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("Creating dnsfilter")
</s> add log.Tracef("Creating dnsfilter") </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | filter.go |
log.Tracef("got schema version %v", schemaVersionInterface) | <mask> return err
<mask> }
<mask>
<mask> schemaVersionInterface, ok := diskConfig["schema_version"]
<mask> log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
<mask> if !ok {
<mask> // no schema version, set it to 0
<mask> schemaVersionInterface = 0
<mask> }
<mask>
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Got IP that is not IPv4: %v", ipnet.IP)
</s> add log.Tracef("Got IP that is not IPv4: %v", ipnet.IP) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1 | upgrade.go |
<mask> "bufio"
<mask> "bytes"
<mask> "context"
<mask> "crypto/sha256"
<mask> "encoding/gob"
<mask> "encoding/json"
<mask> "fmt"
<mask> "io/ioutil"
<mask> "net"
<mask> "net/http"
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove "github.com/VictoriaMetrics/fastcache"
</s> add </s> remove safebrowsingCache *fastcache.Cache
parentalCache *fastcache.Cache
safeSearchCache *fastcache.Cache
</s> add safebrowsingCache gcache.Cache
parentalCache gcache.Cache
safeSearchCache gcache.Cache </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
|
<mask> "strings"
<mask> "sync/atomic"
<mask> "time"
<mask>
<mask> "github.com/VictoriaMetrics/fastcache"
<mask> "github.com/joomcode/errorx"
<mask>
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/urlfilter"
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9 h1:5Cp3cVwpQP4aCQ6jx6dNLP3IarbYiuStmIzYu+BjQwY=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
</s> add </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove safebrowsingCache *fastcache.Cache
parentalCache *fastcache.Cache
safeSearchCache *fastcache.Cache
</s> add safebrowsingCache gcache.Cache
parentalCache gcache.Cache
safeSearchCache gcache.Cache </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
|
safebrowsingCache gcache.Cache
parentalCache gcache.Cache
safeSearchCache gcache.Cache | <mask>
<mask> type dnsFilterContext struct {
<mask> stats Stats
<mask> dialCache gcache.Cache // "host" -> "IP" cache for safebrowsing and parental control servers
<mask> safebrowsingCache *fastcache.Cache
<mask> parentalCache *fastcache.Cache
<mask> safeSearchCache *fastcache.Cache
<mask> }
<mask>
<mask> var gctx dnsFilterContext // global dnsfilter context
<mask>
<mask> // Result holds state of hostname check
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove return cachedValue, true
</s> add // since it can be something else, validate that it belongs to proper type
cachedValue, ok := rawValue.(Result)
if !ok {
// this is not our type -- error
text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache"
log.Println(text)
return
}
isFound = ok
return cachedValue, isFound </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) | <mask> }
<mask> return res
<mask> }
<mask>
<mask> func setCacheResult(cache *fastcache.Cache, host string, res Result) {
<mask> var buf bytes.Buffer
<mask> enc := gob.NewEncoder(&buf)
<mask> _ = enc.Encode(res)
<mask> cache.Set([]byte(host), buf.Bytes())
<mask> log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
<mask> }
<mask>
<mask> func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
<mask> isFound = false // not found yet
<mask>
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove return cachedValue, true
</s> add // since it can be something else, validate that it belongs to proper type
cachedValue, ok := rawValue.(Result)
if !ok {
// this is not our type -- error
text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache"
log.Println(text)
return
}
isFound = ok
return cachedValue, isFound </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { | <mask> cache.Set([]byte(host), buf.Bytes())
<mask> log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
<mask> }
<mask>
<mask> func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
<mask> isFound = false // not found yet
<mask>
<mask> // get raw value
<mask> rawValue := cache.Get(nil, []byte(host))
<mask> if len(rawValue) == 0 {
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove return cachedValue, true
</s> add // since it can be something else, validate that it belongs to proper type
cachedValue, ok := rawValue.(Result)
if !ok {
// this is not our type -- error
text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache"
log.Println(text)
return
}
isFound = ok
return cachedValue, isFound </s> remove gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
</s> add gctx.safeSearchCache = gcache.New(c.SafeSearchCacheSize).LRU().Expiration(defaultCacheTime).Build() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found | <mask> func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
<mask> isFound = false // not found yet
<mask>
<mask> // get raw value
<mask> rawValue := cache.Get(nil, []byte(host))
<mask> if len(rawValue) == 0 {
<mask> return Result{}, false
<mask> }
<mask>
<mask> var buf bytes.Buffer
<mask> buf.Write(rawValue)
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove return cachedValue, true
</s> add // since it can be something else, validate that it belongs to proper type
cachedValue, ok := rawValue.(Result)
if !ok {
// this is not our type -- error
text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache"
log.Println(text)
return
}
isFound = ok
return cachedValue, isFound </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
<mask> rawValue := cache.Get(nil, []byte(host))
<mask> if len(rawValue) == 0 {
<mask> return Result{}, false
<mask> }
<mask>
<mask> var buf bytes.Buffer
<mask> buf.Write(rawValue)
<mask> dec := gob.NewDecoder(&buf)
<mask> cachedValue := Result{}
<mask> err := dec.Decode(&cachedValue)
<mask> if err != nil {
<mask> log.Debug("gob.Decode(): %s", err)
<mask> return Result{}, false
<mask> }
<mask> return cachedValue, true
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove return cachedValue, true
</s> add // since it can be something else, validate that it belongs to proper type
cachedValue, ok := rawValue.(Result)
if !ok {
// this is not our type -- error
text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache"
log.Println(text)
return
}
isFound = ok
return cachedValue, isFound </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
|
// real error | <mask> dec := gob.NewDecoder(&buf)
<mask> cachedValue := Result{}
<mask> err := dec.Decode(&cachedValue)
<mask> if err != nil {
<mask> log.Debug("gob.Decode(): %s", err)
<mask> return Result{}, false
<mask> }
<mask> return cachedValue, true
<mask> }
<mask>
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove return cachedValue, true
</s> add // since it can be something else, validate that it belongs to proper type
cachedValue, ok := rawValue.(Result)
if !ok {
// this is not our type -- error
text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache"
log.Println(text)
return
}
isFound = ok
return cachedValue, isFound </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
// since it can be something else, validate that it belongs to proper type
cachedValue, ok := rawValue.(Result)
if !ok {
// this is not our type -- error
text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache"
log.Println(text)
return
}
isFound = ok
return cachedValue, isFound | <mask> if err != nil {
<mask> log.Debug("gob.Decode(): %s", err)
<mask> return Result{}, false
<mask> }
<mask> return cachedValue, true
<mask> }
<mask>
<mask> // for each dot, hash it and add it to string
<mask> func hostnameToHashParam(host string, addslash bool) (string, map[string]bool) {
<mask> var hashparam bytes.Buffer
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) {
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
_ = enc.Encode(res)
cache.Set([]byte(host), buf.Bytes())
log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
</s> add func setCacheResult(cache gcache.Cache, host string, res Result) {
err := cache.Set(host, res)
if err != nil {
log.Debug("cache.Set: %s", err)
return
}
log.Debug("Stored in cache %p: %s", cache, host) </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove safebrowsingCache *fastcache.Cache
parentalCache *fastcache.Cache
safeSearchCache *fastcache.Cache
</s> add safebrowsingCache gcache.Cache
parentalCache gcache.Cache
safeSearchCache gcache.Cache | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() | <mask>
<mask> if c != nil {
<mask> // initialize objects only once
<mask> if gctx.safebrowsingCache == nil {
<mask> gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
<mask> }
<mask> if gctx.safeSearchCache == nil {
<mask> gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
<mask> }
<mask> if gctx.parentalCache == nil {
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
</s> add gctx.safeSearchCache = gcache.New(c.SafeSearchCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove gctx.parentalCache = fastcache.New(c.ParentalCacheSize)
</s> add gctx.parentalCache = gcache.New(c.ParentalCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
gctx.safeSearchCache = gcache.New(c.SafeSearchCacheSize).LRU().Expiration(defaultCacheTime).Build() | <mask> if gctx.safebrowsingCache == nil {
<mask> gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
<mask> }
<mask> if gctx.safeSearchCache == nil {
<mask> gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
<mask> }
<mask> if gctx.parentalCache == nil {
<mask> gctx.parentalCache = fastcache.New(c.ParentalCacheSize)
<mask> }
<mask> if len(c.ResolverAddress) != 0 && gctx.dialCache == nil {
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove gctx.parentalCache = fastcache.New(c.ParentalCacheSize)
</s> add gctx.parentalCache = gcache.New(c.ParentalCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
gctx.parentalCache = gcache.New(c.ParentalCacheSize).LRU().Expiration(defaultCacheTime).Build() | <mask> if gctx.safeSearchCache == nil {
<mask> gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
<mask> }
<mask> if gctx.parentalCache == nil {
<mask> gctx.parentalCache = fastcache.New(c.ParentalCacheSize)
<mask> }
<mask> if len(c.ResolverAddress) != 0 && gctx.dialCache == nil {
<mask> gctx.dialCache = gcache.New(maxDialCacheSize).LRU().Expiration(defaultCacheTime).Build()
<mask> }
<mask> }
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
</s> add gctx.safeSearchCache = gcache.New(c.SafeSearchCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
</s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | dnsfilter/dnsfilter.go |
github.com/AdguardTeam/dnsproxy v0.18.2 | <mask>
<mask> go 1.12
<mask>
<mask> require (
<mask> github.com/AdguardTeam/dnsproxy v0.18.1
<mask> github.com/AdguardTeam/golibs v0.1.4
<mask> github.com/AdguardTeam/urlfilter v0.5.0
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/VictoriaMetrics/fastcache v1.5.1
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/VictoriaMetrics/fastcache v1.5.1
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 </s> remove github.com/AdguardTeam/dnsproxy v0.18.1 h1:KS5FH+Q4i6K6e/QuW3WSsFFT732QZbhGZhEl6kx5YRo=
github.com/AdguardTeam/dnsproxy v0.18.1/go.mod h1:ZRbvuqDXag6IPsJWJp5UK+RGjHE/wUDBHYDNY8/EftI=
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 h1:0wgZ/OZ8slD8XXT5/rFjM1FK86Wek7KolQLmhgf2ayQ=
github.com/AdguardTeam/dnsproxy v0.18.2/go.mod h1:R0YfjEUyGf7rsQ31gbw0GahraUjxCmH4dUqPEYVy81k= </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </s> remove github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0 h1:vUdUwmQLnT/yuk8PsDhhMVkrfr4aMdcv/0GWzIqOjEY=
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 h1:pl4eWIqvFe/Kg3zkn7NxevNzILnZYWDCG7qbA1CJik0=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM=
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 h1:yCfXxYaelOyqnia8F/Yng47qhmfC9nKTRIbYRrRueq4=
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk= </s> remove github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | go.mod |
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 | <mask> github.com/AdguardTeam/dnsproxy v0.18.1
<mask> github.com/AdguardTeam/golibs v0.1.4
<mask> github.com/AdguardTeam/urlfilter v0.5.0
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/VictoriaMetrics/fastcache v1.5.1
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
<mask> github.com/go-test/deep v1.0.1
<mask> github.com/gobuffalo/packr v1.19.0
<mask> github.com/joomcode/errorx v0.8.0
<mask> github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </s> remove github.com/AdguardTeam/dnsproxy v0.18.1 h1:KS5FH+Q4i6K6e/QuW3WSsFFT732QZbhGZhEl6kx5YRo=
github.com/AdguardTeam/dnsproxy v0.18.1/go.mod h1:ZRbvuqDXag6IPsJWJp5UK+RGjHE/wUDBHYDNY8/EftI=
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 h1:0wgZ/OZ8slD8XXT5/rFjM1FK86Wek7KolQLmhgf2ayQ=
github.com/AdguardTeam/dnsproxy v0.18.2/go.mod h1:R0YfjEUyGf7rsQ31gbw0GahraUjxCmH4dUqPEYVy81k= </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </s> remove github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0 h1:vUdUwmQLnT/yuk8PsDhhMVkrfr4aMdcv/0GWzIqOjEY=
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 h1:pl4eWIqvFe/Kg3zkn7NxevNzILnZYWDCG7qbA1CJik0=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM=
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 h1:yCfXxYaelOyqnia8F/Yng47qhmfC9nKTRIbYRrRueq4=
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk= </s> remove github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | go.mod |
github.com/AdguardTeam/dnsproxy v0.18.2 h1:0wgZ/OZ8slD8XXT5/rFjM1FK86Wek7KolQLmhgf2ayQ=
github.com/AdguardTeam/dnsproxy v0.18.2/go.mod h1:R0YfjEUyGf7rsQ31gbw0GahraUjxCmH4dUqPEYVy81k= | <mask> github.com/AdguardTeam/dnsproxy v0.18.1 h1:KS5FH+Q4i6K6e/QuW3WSsFFT732QZbhGZhEl6kx5YRo=
<mask> github.com/AdguardTeam/dnsproxy v0.18.1/go.mod h1:ZRbvuqDXag6IPsJWJp5UK+RGjHE/wUDBHYDNY8/EftI=
<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/AdguardTeam/golibs v0.1.4 h1:zZirpC23mZkf9Upasn9nbQ+lqqjcXJnkWdXO80vTu7s=
<mask> github.com/AdguardTeam/golibs v0.1.4/go.mod h1:b0XkhgIcn2TxwX6C5AQMtpIFAgjPehNgxJErWkwA3ko=
<mask> github.com/AdguardTeam/urlfilter v0.5.0 h1:ATzs2Er0BMt7NbZnFJ4UEzt3uIV+rydbQCYqBXNRbJc=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </s> remove github.com/VictoriaMetrics/fastcache v1.5.1
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </s> remove github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9 h1:5Cp3cVwpQP4aCQ6jx6dNLP3IarbYiuStmIzYu+BjQwY=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
</s> add </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error | [
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | go.sum |
<mask> github.com/AdguardTeam/urlfilter v0.5.0 h1:ATzs2Er0BMt7NbZnFJ4UEzt3uIV+rydbQCYqBXNRbJc=
<mask> github.com/AdguardTeam/urlfilter v0.5.0/go.mod h1:6YehXZ8e0Hx2MvqeQWLFom6IkPinm04tNhO1CkwAxmg=
<mask> github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
<mask> github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
<mask> github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
<mask> github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
<mask> github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
<mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 h1:UUppSQnhf4Yc6xGxSkoQpPhb7RVzuv5Nb1mwJ5VId9s=
<mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
<mask> github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
<mask> github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
</s> add </s> remove github.com/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </s> remove github.com/VictoriaMetrics/fastcache v1.5.1
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 </s> remove github.com/AdguardTeam/dnsproxy v0.18.1 h1:KS5FH+Q4i6K6e/QuW3WSsFFT732QZbhGZhEl6kx5YRo=
github.com/AdguardTeam/dnsproxy v0.18.1/go.mod h1:ZRbvuqDXag6IPsJWJp5UK+RGjHE/wUDBHYDNY8/EftI=
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 h1:0wgZ/OZ8slD8XXT5/rFjM1FK86Wek7KolQLmhgf2ayQ=
github.com/AdguardTeam/dnsproxy v0.18.2/go.mod h1:R0YfjEUyGf7rsQ31gbw0GahraUjxCmH4dUqPEYVy81k= </s> remove github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | go.sum |
|
<mask> github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
<mask> github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
<mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 h1:UUppSQnhf4Yc6xGxSkoQpPhb7RVzuv5Nb1mwJ5VId9s=
<mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
<mask> github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
<mask> github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
<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=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us=
<mask> github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </s> remove github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
</s> add </s> remove github.com/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </s> remove github.com/VictoriaMetrics/fastcache v1.5.1
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 </s> remove github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9 h1:5Cp3cVwpQP4aCQ6jx6dNLP3IarbYiuStmIzYu+BjQwY=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | go.sum |
|
<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=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us=
<mask> github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
<mask> github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
<mask> github.com/ameshkov/dnscrypt v1.0.7 h1:7LS9wiC/6c00H3ZdZOlwQSYGTJvs12g5ui9D1VSZ2aQ=
<mask> github.com/ameshkov/dnscrypt v1.0.7/go.mod h1:rA74ASZ0j4JqPWaiN64hN97QXJ/zu5Kb2xgn295VzWQ=
<mask> github.com/ameshkov/dnsstamps v1.0.1 h1:LhGvgWDzhNJh+kBQd/AfUlq1vfVe109huiXw4JhnPug=
<mask> github.com/ameshkov/dnsstamps v1.0.1/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A=
<mask> github.com/ameshkov/goproxy v0.0.0-20190328085534-e9f6fabc24d4/go.mod h1:tKA6C/1BQYejT7L6ZX0klDrqloYenYETv3BCk8xCbrQ=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
</s> add </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </s> remove github.com/VictoriaMetrics/fastcache v1.5.1
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 </s> remove github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9 h1:5Cp3cVwpQP4aCQ6jx6dNLP3IarbYiuStmIzYu+BjQwY=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
</s> add </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | go.sum |
|
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 h1:yCfXxYaelOyqnia8F/Yng47qhmfC9nKTRIbYRrRueq4=
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk= | <mask> github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf h1:eg0MeVzsP1G42dRafH3vf+al2vQIJU0YHX+1Tw87oco=
<mask> github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
<mask> github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6 h1:KXlsf+qt/X5ttPGEjR0tPH1xaWWoKBEg9Q1THAj2h3I=
<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/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
<mask> github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
<mask> github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 h1:pl4eWIqvFe/Kg3zkn7NxevNzILnZYWDCG7qbA1CJik0=
<mask> github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM=
<mask> github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
<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.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
<mask> github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/VictoriaMetrics/fastcache v1.5.1
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 </s> remove github.com/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </s> remove github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9 h1:5Cp3cVwpQP4aCQ6jx6dNLP3IarbYiuStmIzYu+BjQwY=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
</s> add </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0 | go.sum |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.