mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-14 06:08:36 -07:00
fix reversed cases
This commit is contained in:
@@ -54,7 +54,7 @@ func (t *Tracker) ServeAnnounce(w http.ResponseWriter, r *http.Request, p httpro
|
|||||||
var torrent *models.Torrent
|
var torrent *models.Torrent
|
||||||
torrent, err = conn.FindTorrent(ann.Infohash)
|
torrent, err = conn.FindTorrent(ann.Infohash)
|
||||||
switch {
|
switch {
|
||||||
case t.cfg.Private && err == tracker.ErrTorrentDNE:
|
case !t.cfg.Private && err == tracker.ErrTorrentDNE:
|
||||||
torrent = &models.Torrent{
|
torrent = &models.Torrent{
|
||||||
Infohash: ann.Infohash,
|
Infohash: ann.Infohash,
|
||||||
Seeders: make(map[string]models.Peer),
|
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
|
return http.StatusInternalServerError, err
|
||||||
}
|
}
|
||||||
|
|
||||||
case !t.cfg.Private && err == tracker.ErrTorrentDNE:
|
case t.cfg.Private && err == tracker.ErrTorrentDNE:
|
||||||
fail(w, r, err)
|
fail(w, r, err)
|
||||||
return http.StatusOK, nil
|
return http.StatusOK, nil
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user