forked from I2P_Developers/i2p.i2p
2004-12-29 jrandom
* Imported Ragnarok's addressbook source (2.0.2) which is built but not deployed in the i2pinstall.jar/i2pupdate.zip (yet). * Don't treat connection inactivity closure as a connection error.
This commit is contained in:
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.124 $ $Date: 2004/12/29 10:53:28 $";
|
||||
public final static String ID = "$Revision: 1.125 $ $Date: 2004/12/29 15:06:44 $";
|
||||
public final static String VERSION = "0.4.2.5";
|
||||
public final static long BUILD = 2;
|
||||
public final static long BUILD = 3;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + VERSION);
|
||||
System.out.println("Router ID: " + RouterVersion.ID);
|
||||
|
@ -168,7 +168,7 @@ class ConnectionRunner implements Runnable {
|
||||
+ " due to " + DataHelper.formatDuration(timeSinceWrite)
|
||||
+ " of inactivity after "
|
||||
+ DataHelper.formatDuration(_con.getLifetime()));
|
||||
_con.closeConnection();
|
||||
_con.closeConnection(false);
|
||||
return;
|
||||
}
|
||||
if (_lastTimeSend < _context.clock().now() - 2*TIME_SEND_FREQUENCY)
|
||||
|
@ -111,7 +111,8 @@ public class TCPConnection {
|
||||
* be called multiple times safely.
|
||||
*
|
||||
*/
|
||||
public synchronized void closeConnection() {
|
||||
public synchronized void closeConnection() { closeConnection(true); }
|
||||
public synchronized void closeConnection(boolean wasError) {
|
||||
if (_log.shouldLog(Log.INFO)) {
|
||||
if (_ident != null)
|
||||
_log.info("Connection between " + _ident.getHash().toBase64().substring(0,6)
|
||||
@ -140,10 +141,12 @@ public class TCPConnection {
|
||||
msg.timestamp("closeConnection");
|
||||
_transport.afterSend(msg, false, true, -1);
|
||||
}
|
||||
_context.profileManager().commErrorOccurred(_ident.getHash());
|
||||
_transport.addConnectionErrorMessage("Connection closed with "
|
||||
+ _ident.getHash().toBase64().substring(0,6)
|
||||
+ " after " + DataHelper.formatDuration(getLifetime()));
|
||||
if (wasError) {
|
||||
_context.profileManager().commErrorOccurred(_ident.getHash());
|
||||
_transport.addConnectionErrorMessage("Connection closed with "
|
||||
+ _ident.getHash().toBase64().substring(0,6)
|
||||
+ " after " + DataHelper.formatDuration(getLifetime()));
|
||||
}
|
||||
_transport.connectionClosed(this);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user