Revision
26920
Author
pgardner
Date
2012-03-21 16:59:50 +0000 (Wed, 21 Mar 2012)

Log Message



Modified Paths

Added Paths

Diff

Modified: plugins/azupnpav/com/aelitis/azureus/plugins/upnpmediaserver/UPnPMediaServerContentDirectory.java (26919 => 26920)


--- plugins/azupnpav/com/aelitis/azureus/plugins/upnpmediaserver/UPnPMediaServerContentDirectory.java	2012-03-20 15:30:48 UTC (rev 26919)
+++ plugins/azupnpav/com/aelitis/azureus/plugins/upnpmediaserver/UPnPMediaServerContentDirectory.java	2012-03-21 16:59:50 UTC (rev 26920)
@@ -37,6 +37,7 @@
 
 import org.gudy.azureus2.core3.internat.MessageText;
 import org.gudy.azureus2.core3.util.AERunnable;
+import org.gudy.azureus2.core3.util.Base32;
 import org.gudy.azureus2.core3.util.ByteFormatter;
 import org.gudy.azureus2.core3.util.Debug;
 import org.gudy.azureus2.core3.util.DelayedEvent;
@@ -1138,8 +1139,26 @@
 			
 			Map<String,Object> map = FileUtil.readResilientFile( file );
 			
-			config = (Map<String,Long>)map.get( "id_map" );
+			Map<String,Long> id_map2 = (Map<String,Long>)map.get( "id_map2" );
 			
+			if ( id_map2 != null ){
+				
+				config = new HashMap<String, Long>();
+				
+				try{					
+					for ( Map.Entry<String,Long>	entry: id_map2.entrySet()){
+						
+						config.put( new String( Base32.decode( entry.getKey()), "UTF-8" ), entry.getValue());
+					}
+				}catch( Throwable e ){
+					
+					Debug.out( e );
+				}
+			}else{
+				
+				config = (Map<String,Long>)map.get( "id_map" );
+			}
+			
 			if ( config == null ){
 				
 				config = new HashMap<String, Long>();
@@ -1180,12 +1199,29 @@
 
 			Map<String,Object> map = new HashMap<String, Object>();
 			
-			Map<String,Long> new_config = new HashMap<String, Long>();
+			Map<String,Long> old_id_map = new HashMap<String, Long>();
 			
-			addPersistentContainerIDs( new_config, root_container );
+			addPersistentContainerIDs( old_id_map, root_container );
 			
-			map.put( "id_map", new_config );
+			map.put( "id_map", old_id_map );
 			
+				// issues with non-ascii keys here...
+			
+			try{
+				Map<String,Long> id_map2 = new HashMap<String, Long>();
+				
+				for ( Map.Entry<String,Long>	entry: old_id_map.entrySet()){
+					
+					id_map2.put( Base32.encode( entry.getKey().getBytes( "UTF-8" )), entry.getValue());
+				}
+				
+				map.put( "id_map2", id_map2 );
+				
+			}catch( Throwable e ){
+				
+				Debug.out( e );
+			}
+			
 			FileUtil.writeResilientFile( file, map );
 
 			config_dirty = false;

Added: sfweb/plugins/azupnpav_0.4.0.vuze


(Binary files differ)
Property changes on: sfweb/plugins/azupnpav_0.4.0.vuze ___________________________________________________________________

Added: svn:mime-type

Added: sfweb/plugins/azupnpav_0.4.0.zip


(Binary files differ)
Property changes on: sfweb/plugins/azupnpav_0.4.0.zip ___________________________________________________________________

Added: svn:mime-type

Modified: sfweb/plugins/details/azupnpav.php (26919 => 26920)


--- sfweb/plugins/details/azupnpav.php	2012-03-20 15:30:48 UTC (rev 26919)
+++ sfweb/plugins/details/azupnpav.php	2012-03-21 16:59:50 UTC (rev 26920)
@@ -92,7 +92,8 @@
   );
   
   $cvs_version = 
-  		new PluginVersionInfo( "4.7.0.3", "0.3.9_CVS", "plugins/azupnpav_0.3.9.zip", "plugins/azupnpav_0.3.9.zip",
+  		new PluginVersionInfo( "4.7.0.3", "0.4.0_CVS", "plugins/azupnpav_0.4.0.zip", "plugins/azupnpav_0.4.0.zip",
+  			"0.4.0: Fixed persistence of non-ascii named container ids.<br>".
   			"0.3.9: Fixed bug in range-unsatisfiable response." );  
   			
   if ( getRealIpAddr() == "64.79.127.118" ){