diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 69dbe1b5a..b1481247e 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -2011,15 +2011,29 @@ tr_torrentGetMTimes( const tr_torrent * tor, **** ***/ -void +tr_announce_list_err tr_torrentSetAnnounceList( tr_torrent * tor, const tr_tracker_info * trackers, int trackerCount ) { + int i, j; tr_benc metainfo; assert( tr_isTorrent( tor ) ); + /* look for bad URLs */ + for( i=0; iinfo.torrent ) ) { @@ -2068,6 +2082,8 @@ tr_torrentSetAnnounceList( tr_torrent * tor, /* tell the announcer to reload this torrent's tracker list */ tr_announcerResetTorrent( tor->session->announcer, tor ); } + + return TR_ANNOUNCE_LIST_OK; } /** diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index e8563b370..939040024 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -1101,6 +1101,15 @@ typedef struct tr_tracker_info } tr_tracker_info; + +typedef enum +{ + TR_ANNOUNCE_LIST_OK, + TR_ANNOUNCE_LIST_HAS_DUPLICATES, + TR_ANNOUNCE_LIST_HAS_BAD +} +tr_announce_list_err; + /** * @brief Modify a torrent's tracker list. * @@ -1113,9 +1122,10 @@ tr_tracker_info; * libtransmission derives `scrape' from `announce'. * @param trackerCount size of the `trackers' array */ -void tr_torrentSetAnnounceList( tr_torrent * torrent, - const tr_tracker_info * trackers, - int trackerCount ); +tr_announce_list_err +tr_torrentSetAnnounceList( tr_torrent * torrent, + const tr_tracker_info * trackers, + int trackerCount ); /**