File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
1010 "time"
1111)
1212
13- type Cache map [string ]string
13+ type Cache map [string ]bool
1414
1515var blockList map [string ]string
1616var channel chan string
@@ -45,10 +45,10 @@ func blocked(log string) bool {
4545 return false
4646}
4747
48- func (c * Cache ) Add (k , v string ) {
48+ func (c * Cache ) Add (k string ) {
4949 cacheLock .Lock ()
5050 defer cacheLock .Unlock ()
51- (* c )[k ] = v
51+ (* c )[k ] = false
5252}
5353
5454func (c * Cache ) IsCached (k string ) bool {
@@ -119,7 +119,7 @@ func IsBlocklisted() {
119119
120120 }
121121
122- cache .Add (sourceIp .String (), "false" )
122+ cache .Add (sourceIp .String ())
123123 }
124124
125125 if ! cache .IsCached (destinationIp .String ()) {
@@ -138,7 +138,7 @@ func IsBlocklisted() {
138138 )
139139 }
140140
141- cache .Add (destinationIp .String (), "false" )
141+ cache .Add (destinationIp .String ())
142142 }
143143 }
144144 }()
You can’t perform that action at this time.
0 commit comments