]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: Handle UDP API 601 (server down)
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:01:34 +0000 (14:01 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:01:34 +0000 (14:01 -0300)
We treat it the same as a ban: wait 30 minutes before allowing any
packets through.

udp.go

diff --git a/udp.go b/udp.go
index ec8f83d9d16c9c02018dbdca678521c3317bf947..3c47da07236cf6241c98f40bccbd681203b5755e 100644 (file)
--- a/udp.go
+++ b/udp.go
@@ -149,7 +149,9 @@ func (udp *udpWrap) sendQueue() {
                        }
                case 503, 504: // client library rejected
                        panic(reply.Error())
-               case 555: // IP (and user, possibly client) temporarily banned
+               // 555: IP (and user, possibly client) temporarily banned
+               // 601: Server down (treat the same as a ban)
+               case 555, 601:
                        setBanned()
                }
                set.ch <- reply