mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
Other: Don't try proxy if dial was cancelled
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user