mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 09:58:14 -05:00
fix: miss return
This commit is contained in:
parent
3d5d8fca7c
commit
b07f9c7943
@ -27,7 +27,7 @@ func updateDNSConfig(node *panel.NodeInfo) (err error) {
|
||||
dnsConfigJSON, err := json.MarshalIndent(dnsConfig, "", " ")
|
||||
if err != nil {
|
||||
log.WithField("err", err).Error("Error marshaling dnsConfig to JSON")
|
||||
return
|
||||
return err
|
||||
}
|
||||
err = saveDnsConfig(dnsConfigJSON, dnsPath)
|
||||
}
|
||||
@ -38,7 +38,7 @@ func saveDnsConfig(dns []byte, dnsPath string) (err error) {
|
||||
currentData, err := os.ReadFile(dnsPath)
|
||||
if err != nil {
|
||||
log.WithField("err", err).Error("Failed to read XRAY_DNS_PATH")
|
||||
return
|
||||
return err
|
||||
}
|
||||
if !bytes.Equal(currentData, dns) {
|
||||
coreDnsConfig := &coreConf.DNSConfig{}
|
||||
@ -48,7 +48,7 @@ func saveDnsConfig(dns []byte, dnsPath string) (err error) {
|
||||
_, err := coreDnsConfig.Build()
|
||||
if err != nil {
|
||||
log.WithField("err", err).Error("Failed to understand DNS config, Please check: https://xtls.github.io/config/dns.html for help")
|
||||
return
|
||||
return err
|
||||
}
|
||||
if err = os.Truncate(dnsPath, 0); err != nil {
|
||||
log.WithField("err", err).Error("Failed to clear XRAY DNS PATH file")
|
||||
|
Loading…
Reference in New Issue
Block a user