From dfc215115acebf43758d3bde9bc7c985f43cfff4 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 11 Jul 2014 20:44:28 -0400 Subject: [PATCH] fix reversed cases --- http/announce.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/announce.go b/http/announce.go index 84346b9..e0d8bf6 100644 --- a/http/announce.go +++ b/http/announce.go @@ -54,7 +54,7 @@ func (t *Tracker) ServeAnnounce(w http.ResponseWriter, r *http.Request, p httpro var torrent *models.Torrent torrent, err = conn.FindTorrent(ann.Infohash) switch { - case t.cfg.Private && err == tracker.ErrTorrentDNE: + case !t.cfg.Private && err == tracker.ErrTorrentDNE: torrent = &models.Torrent{ Infohash: ann.Infohash, Seeders: make(map[string]models.Peer), @@ -66,7 +66,7 @@ func (t *Tracker) ServeAnnounce(w http.ResponseWriter, r *http.Request, p httpro return http.StatusInternalServerError, err } - case !t.cfg.Private && err == tracker.ErrTorrentDNE: + case t.cfg.Private && err == tracker.ErrTorrentDNE: fail(w, r, err) return http.StatusOK, nil