MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / init

Method init

internal/firewalls/firewall_firewalld.go:51–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func (this *Firewalld) init() {
52 goman.New(func() {
53 for c := range this.cmdQueue {
54 var cmd = c.cmd
55 err := cmd.Run()
56 if err != nil {
57 if strings.HasPrefix(err.Error(), "Warning:") {
58 continue
59 }
60 remotelogs.Warn("FIREWALL", "run command failed '"+cmd.String()+"': "+err.Error())
61 } else {
62 // 关闭连接
63 if len(c.denyIP) > 0 {
64 conns.SharedMap.CloseIPConns(c.denyIP)
65 }
66 }
67 }
68 })
69}
70
71// Name 名称
72func (this *Firewalld) Name() string {

Callers 1

NewFirewalldFunction · 0.45

Calls 6

NewFunction · 0.92
WarnFunction · 0.92
CloseIPConnsMethod · 0.80
RunMethod · 0.45
ErrorMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected