This commit is contained in:
zzz
2012-06-15 01:29:29 +00:00
parent de3ce6cdb7
commit 5ce0479268
2 changed files with 3 additions and 3 deletions

View File

@ -236,7 +236,7 @@ public class TrackerClient implements Runnable {
* Do this one time only (not every time it is started).
* @since 0.9.1
*/
public void setup() {
private void setup() {
// Construct the list of trackers for this torrent,
// starting with the primary one listed in the metainfo,
// followed by the secondary open trackers
@ -670,7 +670,7 @@ public class TrackerClient implements Runnable {
* @return true for i2p hosts only
* @since 0.7.12
*/
static boolean isValidAnnounce(String ann) {
public static boolean isValidAnnounce(String ann) {
URL url;
try {
url = new URL(ann);

View File

@ -825,7 +825,7 @@ public class I2PSnarkServlet extends DefaultServlet {
name = name.trim();
hurl = hurl.trim();
aurl = aurl.trim().replace("=", "=");
if (name.length() > 0 && hurl.startsWith("http://") && aurl.startsWith("http://")) {
if (name.length() > 0 && hurl.startsWith("http://") && TrackerClient.isValidAnnounce(aurl)) {
Map<String, Tracker> trackers = _manager.getTrackerMap();
trackers.put(name, new Tracker(name, aurl, hurl));
_manager.saveTrackerMap();