mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-12 14:30:54 +08:00
优化DDoS防护相关错误提示信息
This commit is contained in:
@@ -91,6 +91,9 @@ func (this *DDoSProtectionManager) Apply(config *ddosconfigs.ProtectionConfig) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
if nftablesInstance == nil {
|
if nftablesInstance == nil {
|
||||||
|
if config == nil || !config.IsOn() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return errors.New("nftables instance should not be nil")
|
return errors.New("nftables instance should not be nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ func (this *APIStream) handleCheckLocalFirewall(message *pb.NodeStreamMessage) e
|
|||||||
var protectionConfig = sharedNodeConfig.DDoSProtection
|
var protectionConfig = sharedNodeConfig.DDoSProtection
|
||||||
err = firewalls.SharedDDoSProtectionManager.Apply(protectionConfig)
|
err = firewalls.SharedDDoSProtectionManager.Apply(protectionConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.replyFail(message.RequestId, dataMessage.Name+"was installed, but apply DDoS protection config failed: "+err.Error())
|
this.replyFail(message.RequestId, dataMessage.Name+" was installed, but apply DDoS protection config failed: "+err.Error())
|
||||||
} else {
|
} else {
|
||||||
this.replyOk(message.RequestId, string(result.AsJSON()))
|
this.replyOk(message.RequestId, string(result.AsJSON()))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user