mirror of
https://github.com/safing/portmaster
synced 2025-09-14 16:59:40 +00:00
Improve resolver failing reporting
This commit is contained in:
parent
113f37dcab
commit
b94adf17c1
1 changed files with 7 additions and 4 deletions
|
@ -145,10 +145,16 @@ func (tr *TCPResolver) getOrCreateResolverConn(ctx context.Context) (*tcpResolve
|
|||
// Connect to server.
|
||||
conn, err := tr.dnsClient.Dial(tr.resolver.ServerAddress)
|
||||
if err != nil {
|
||||
log.Debugf("resolver: failed to connect to %s", tr.resolver.Info.DescriptiveName())
|
||||
// Hint network environment at failed connection.
|
||||
netenv.ReportFailedConnection()
|
||||
|
||||
log.Debugf("resolver: failed to connect to %s: %s", tr.resolver.Info.DescriptiveName(), err)
|
||||
return nil, fmt.Errorf("%w: failed to connect to %s: %s", ErrFailure, tr.resolver.Info.DescriptiveName(), err)
|
||||
}
|
||||
|
||||
// Hint network environment at successful connection.
|
||||
netenv.ReportSuccessfulConnection()
|
||||
|
||||
// Log that a connection to the resolver was established.
|
||||
log.Debugf(
|
||||
"resolver: connected to %s",
|
||||
|
@ -174,9 +180,6 @@ func (tr *TCPResolver) getOrCreateResolverConn(ctx context.Context) (*tcpResolve
|
|||
// Set resolver conn for reuse.
|
||||
tr.resolverConn = resolverConn
|
||||
|
||||
// Hint network environment at successful connection.
|
||||
netenv.ReportSuccessfulConnection()
|
||||
|
||||
return resolverConn, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue