Skip to content

Commit bfef419

Browse files
committed
fixes
1 parent 440e020 commit bfef419

File tree

2 files changed

+36
-21
lines changed

2 files changed

+36
-21
lines changed

core/src/com/biglybt/pifimpl/local/download/DownloadImpl.java

+27-21
Original file line numberDiff line numberDiff line change
@@ -1675,38 +1675,41 @@ void announceTrackerResultsToListener(DownloadTrackerListener l) {
16751675
{
16761676
String class_name = getTrackingName( result );
16771677

1678-
if ( class_name != null ){
1678+
String plugin_id;
1679+
1680+
if ( class_name == null ){
1681+
1682+
plugin_id = "azbpdhdtracker";
1683+
1684+
}else{
1685+
1686+
if ( class_name.equalsIgnoreCase( "I2P" )){
1687+
1688+
plugin_id = "azneti2phelper";
1689+
1690+
}else{
1691+
1692+
plugin_id = class_name;
1693+
}
1694+
}
1695+
1696+
boolean skip_announce = false;
1697+
1698+
if ( plugin_id != null ){
16791699

16801700
Map all_opts = download_manager.getDownloadState().getMapAttribute( DownloadManagerState.AT_PLUGIN_OPTIONS );
16811701

16821702
if ( all_opts != null ){
16831703

1684-
Map opts = (Map)all_opts.get( class_name.toLowerCase( Locale.US ));
1704+
Map opts = (Map)all_opts.get( plugin_id.toLowerCase( Locale.US ));
16851705

16861706
if ( opts != null ){
16871707

16881708
Number e = (Number)opts.get( "enableannounce" );
16891709

16901710
if ( e != null && e.intValue() == 0 ){
16911711

1692-
boolean inform = false;
1693-
1694-
try{
1695-
peer_listeners_mon.enter();
1696-
1697-
inform = announce_response_map.remove( class_name ) != null;
1698-
1699-
}finally{
1700-
1701-
peer_listeners_mon.exit();
1702-
}
1703-
1704-
if ( inform ){
1705-
1706-
download_manager.informTPSChanged();
1707-
}
1708-
1709-
return;
1712+
skip_announce = true;
17101713
}
17111714
}
17121715
}
@@ -1762,7 +1765,10 @@ void announceTrackerResultsToListener(DownloadTrackerListener l) {
17621765
}
17631766
}
17641767

1765-
download_manager.setAnnounceResult( result );
1768+
if ( !skip_announce ){
1769+
1770+
download_manager.setAnnounceResult( result );
1771+
}
17661772

17671773
if ( new_entry ){
17681774

core/src/com/biglybt/plugin/simpleapi/SimpleAPIPlugin.java

+9
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,15 @@
843843
throw( new Exception( "Plugin id parameter missing" ));
844844
}
845845

846+
if ( plugin_id.equalsIgnoreCase( "dht" )){
847+
848+
plugin_id = "azbpdhdtracker";
849+
850+
}else if ( plugin_id.equalsIgnoreCase( "I2P" )){
851+
852+
plugin_id = "azneti2phelper";
853+
}
854+
846855
PluginInterface pi = plugin_interface.getPluginManager().getPluginInterfaceByID( plugin_id );
847856

848857
if ( pi == null ){

0 commit comments

Comments
 (0)