Other: Don't try proxy if dial was cancelled

This commit is contained in:
James Houlahan
2022-10-28 17:22:38 +02:00
parent a797c01943
commit 34e4625b64

View File

@ -86,8 +86,12 @@ func (d *ProxyTLSDialer) DialTLSContext(ctx context.Context, network, address st
conn, err := d.dialer.DialTLSContext(ctx, network, address)
if err == nil || !d.allowProxy {
return conn, err
} else if errors.Is(err, context.Canceled) {
return nil, err
}
logrus.WithError(err).Debug("DialTLS failed, trying proxy")
if err := d.switchToReachableServer(); err != nil {
return nil, err
}