Scrape tracker if tracker doesn't report number of peers on reply.

This commit is contained in:
Andrew Resch 2008-02-21 22:20:28 +00:00
parent bff0e3f8d5
commit 300b4a7905
2 changed files with 7 additions and 3 deletions

View File

@ -764,6 +764,9 @@ Space:") + " " + nice_free)
self.set_supp_torrent_state_val(event['unique_ID'],
"tracker_status",
_("Announce OK"))
if event['num_complete'] == -1 or event['num_incomplete'] == -1:
self.scrape_tracker(event['unique_ID'])
elif event['event_type'] is self.constants['EVENT_TRACKER_ALERT']:
match = re.search('tracker:\s*".*"\s*(.*)', event["message"])
message = match and match.groups()[0] or ""

View File

@ -1584,10 +1584,11 @@ std::cout << asctime(timeinfo) << " torrent_pop_event()" << std::endl;
return NULL;
if (handle_exists(handle))
return Py_BuildValue("{s:i,s:i,s:s}",
return Py_BuildValue("{s:i,s:i,s:i,s:i,s:s}",
"event_type", EVENT_TRACKER_REPLY,
"unique_ID",
M_torrents->at(index).unique_ID,
"unique_ID", M_torrents->at(index).unique_ID,
"num_complete", handle.status().num_complete,
"num_incomplete", handle.status().num_incomplete,
"message", a->msg().c_str());
else
{ Py_INCREF(Py_None); return Py_None; }