From: Paul G. <pa...@us...> - 2008-04-17 23:47:44
|
Update of /cvsroot/azureus/azureus2/com/aelitis/azureus/plugins/net/buddy In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv26044/com/aelitis/azureus/plugins/net/buddy Modified Files: BuddyPluginBuddy.java Log Message: display received fragment progress Index: BuddyPluginBuddy.java =================================================================== RCS file: /cvsroot/azureus/azureus2/com/aelitis/azureus/plugins/net/buddy/BuddyPluginBuddy.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- BuddyPluginBuddy.java 17 Apr 2008 22:19:29 -0000 1.21 +++ BuddyPluginBuddy.java 17 Apr 2008 23:47:48 -0000 1.22 @@ -30,7 +30,6 @@ import org.gudy.azureus2.core3.util.BEncoder; import org.gudy.azureus2.core3.util.Base32; import org.gudy.azureus2.core3.util.Debug; -import org.gudy.azureus2.core3.util.DisplayFormatters; import org.gudy.azureus2.core3.util.SystemTime; import org.gudy.azureus2.plugins.messaging.MessageException; import org.gudy.azureus2.plugins.messaging.generic.GenericMessageConnection; @@ -100,6 +99,8 @@ private int message_out_bytes; private int message_in_bytes; + private String received_frag_details = ""; + private boolean destroyed; protected @@ -387,9 +388,27 @@ message_in_count++; message_in_bytes += size; + received_frag_details = ""; + buddyActive(); } + protected void + buddyMessageFragmentReceived( + int num_received, + int total ) + { + received_frag_details = num_received + "/" + total; + + plugin.fireDetailsChanged( this ); + } + + public String + getMessageInFragmentDetails() + { + return( received_frag_details ); + } + public int getMessageInCount() { @@ -2041,8 +2060,6 @@ try{ byte[] content = message.toByteArray(); - buddyMessageReceived( content.length ); - Map data_map = BDecoder.decode( content ); if (((Long)data_map.get( "type" )).intValue() == BuddyPlugin.RT_INTERNAL_FRAGMENT ){ @@ -2097,11 +2114,19 @@ current_reply_frag = null; } + buddyMessageReceived( data_length ); + receiver.receive( BDecoder.decode( assembly.getData())); + + }else{ + + buddyMessageFragmentReceived( assembly.getChunksReceived(), assembly.getTotalChunks()); } }else{ - receiver.receive( data_map ); + buddyMessageReceived( content.length ); + + receiver.receive( data_map ); } }catch( Throwable e ){ @@ -2162,6 +2187,18 @@ return( id ); } + protected int + getChunksReceived() + { + return( chunks_received.size()); + } + + protected int + getTotalChunks() + { + return( num_chunks ); + } + protected boolean receive( int chunk_num, |