]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: Delete params s and tag from retries
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:02:35 +0000 (14:02 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:02:35 +0000 (14:02 -0300)
These get added by (*udpapi.AniDBUDP).SendRecv(); we don't want to show
them in the log.

udp.go

diff --git a/udp.go b/udp.go
index 3c47da07236cf6241c98f40bccbd681203b5755e..770a27da09c887a6aabc5eb3c745bf0c0e14ffcf 100644 (file)
--- a/udp.go
+++ b/udp.go
@@ -134,6 +134,9 @@ func (udp *udpWrap) sendQueue() {
                        }
                        log.Printf("UDP--- Timeout; waiting %s before retry", wait)
 
+                       delete(set.params, "s")
+                       delete(set.params, "tag")
+
                        time.Sleep(wait)
                        goto Retry
                }
@@ -145,6 +148,10 @@ func (udp *udpWrap) sendQueue() {
                case 403, 501, 506: // not logged in, or session expired
                        if r := udp.ReAuth(); r.Error() == nil {
                                // retry
+
+                               delete(set.params, "s")
+                               delete(set.params, "tag")
+
                                goto Retry
                        }
                case 503, 504: // client library rejected