Skip to content

Commit

Permalink
Some trackers send "warning message" instead of a failure when a torr…
Browse files Browse the repository at this point in the history
…ent is not registered on a tracker. Will show this message as an error.
  • Loading branch information
montoner0 committed Jun 4, 2019
1 parent 3a6a61a commit 39f4ec8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tracker/tracker_http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,17 @@ TrackerHttp::receive_done() {
std::string("failure reason not a string"))
+ "\"");

if (b.has_key("warning message") && b.get_key("warning message").is_string()){

std::string msg=b.get_key_string("warning message");

if ( (msg.find(" not registered")!=std::string::npos) ||
(msg.find("unregistered")!=std::string::npos) ||
(msg.find("torrent cannot be found")!=std::string::npos) )

return receive_failed("Warning message \"" + msg + "\"");
}

if (m_latest_event == EVENT_SCRAPE)
process_scrape(b);
else
Expand Down

0 comments on commit 39f4ec8

Please sign in to comment.