forked from I2P_Developers/i2p.i2p
2007-01-20 zzz
* Improve performance by not reading in the whole piece from disk for each request. A huge memory savings on 1MB torrents with many peers.
This commit is contained in:
@ -184,7 +184,7 @@ class PeerState
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] pieceBytes = listener.gotRequest(peer, piece);
|
byte[] pieceBytes = listener.gotRequest(peer, piece, begin, length);
|
||||||
if (pieceBytes == null)
|
if (pieceBytes == null)
|
||||||
{
|
{
|
||||||
// XXX - Protocol error-> diconnect?
|
// XXX - Protocol error-> diconnect?
|
||||||
@ -194,7 +194,7 @@ class PeerState
|
|||||||
}
|
}
|
||||||
|
|
||||||
// More sanity checks
|
// More sanity checks
|
||||||
if (begin >= pieceBytes.length || begin + length > pieceBytes.length)
|
if (length != pieceBytes.length)
|
||||||
{
|
{
|
||||||
// XXX - Protocol error-> disconnect?
|
// XXX - Protocol error-> disconnect?
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.WARN))
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
public class RouterVersion {
|
||||||
public final static String ID = "$Revision: 1.476 $ $Date: 2007-01-17 20:42:13 $";
|
public final static String ID = "$Revision: 1.477 $ $Date: 2007-01-20 19:35:09 $";
|
||||||
public final static String VERSION = "0.6.1.26";
|
public final static String VERSION = "0.6.1.26";
|
||||||
public final static long BUILD = 10;
|
public final static long BUILD = 11;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
Reference in New Issue
Block a user