Skip to content

Commit fb96cfc

Browse files
authored
checkDnsBl returning its action
1 parent 85b0d17 commit fb96cfc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/webircgateway/client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,20 @@ func (c *Client) Ready() {
171171
}
172172
}
173173

174-
func (c *Client) checkDnsBl() {
174+
func (c *Client) checkDnsBl() (tookAction string) {
175175
dnsResult := dnsbl.Lookup(c.Gateway.Config.DnsblServers, c.RemoteAddr)
176176
if dnsResult.Listed && c.Gateway.Config.DnsblAction == "deny" {
177177
c.SendIrcError("Blocked by DNSBL")
178178
c.SendClientSignal("state", "closed", "dnsbl_listed")
179179
c.StartShutdown("dnsbl")
180+
tookAction = "deny"
180181
} else if dnsResult.Listed && c.Gateway.Config.DnsblAction == "verify" {
181182
c.RequiresVerification = true
182183
c.SendClientSignal("data", "CAPTCHA NEEDED")
184+
tookAction = "verify"
183185
}
186+
187+
return
184188
}
185189

186190
func (c *Client) IsShuttingDown() bool {

0 commit comments

Comments
 (0)