From 85c2c11217078ff6733efb88ad38795fc066117e Mon Sep 17 00:00:00 2001
From: jrandom <jrandom>
Date: Thu, 18 May 2006 22:31:06 +0000
Subject: [PATCH] * 2006-05-18  0.6.1.19 released 2006-05-18  jrandom     *
 Made the SSU ACKs less frequent when possible

---
 core/java/src/net/i2p/CoreVersion.java             |  4 ++--
 history.txt                                        |  7 ++++++-
 initialNews.xml                                    |  4 ++--
 installer/install.xml                              |  2 +-
 news.xml                                           |  8 ++++----
 router/java/src/net/i2p/router/RouterVersion.java  |  6 +++---
 .../net/i2p/router/transport/udp/ACKSender.java    | 14 ++++++++++++--
 .../net/i2p/router/transport/udp/UDPTransport.java |  2 +-
 8 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/core/java/src/net/i2p/CoreVersion.java b/core/java/src/net/i2p/CoreVersion.java
index 8ec769dd85..2485f170e2 100644
--- a/core/java/src/net/i2p/CoreVersion.java
+++ b/core/java/src/net/i2p/CoreVersion.java
@@ -14,8 +14,8 @@ package net.i2p;
  *
  */
 public class CoreVersion {
-    public final static String ID = "$Revision: 1.60 $ $Date: 2006/04/23 16:06:13 $";
-    public final static String VERSION = "0.6.1.18";
+    public final static String ID = "$Revision: 1.61 $ $Date: 2006/05/09 16:17:19 $";
+    public final static String VERSION = "0.6.1.19";
 
     public static void main(String args[]) {
         System.out.println("I2P Core version: " + VERSION);
diff --git a/history.txt b/history.txt
index 950f754bfd..f0f1fdc471 100644
--- a/history.txt
+++ b/history.txt
@@ -1,4 +1,9 @@
-$Id: history.txt,v 1.477 2006-05-17 22:01:21 jrandom Exp $
+$Id: history.txt,v 1.478 2006-05-17 22:42:57 complication Exp $
+
+* 2006-05-18  0.6.1.19 released
+
+2006-05-18  jrandom
+    * Made the SSU ACKs less frequent when possible
 
 2006-05-17  Complication
     * Fix some oversights in my previous changes:
diff --git a/initialNews.xml b/initialNews.xml
index e22b524583..55ec571303 100644
--- a/initialNews.xml
+++ b/initialNews.xml
@@ -1,5 +1,5 @@
-<i2p.news date="$Date: 2006/04/15 02:58:12 $">
- <i2p.release version="0.6.1.18" date="2006/05/09" minVersion="0.6"
+<i2p.news date="$Date: 2006/05/09 16:17:17 $">
+ <i2p.release version="0.6.1.19" date="2006/05/18" minVersion="0.6"
               anonurl="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/i2p/i2pupdate.sud"
               publicurl="http://dev.i2p.net/i2p/i2pupdate.sud"
               anonannouncement="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/pipermail/i2p/2005-September/000878.html" 
diff --git a/installer/install.xml b/installer/install.xml
index 95db45d544..1ce4282c19 100644
--- a/installer/install.xml
+++ b/installer/install.xml
@@ -4,7 +4,7 @@
 
     <info>
         <appname>i2p</appname>
-        <appversion>0.6.1.18</appversion>
+        <appversion>0.6.1.19</appversion>
         <authors>
             <author name="I2P" email="support@i2p.net"/>
         </authors>
diff --git a/news.xml b/news.xml
index 5d5842fdf3..55b45e4c0f 100644
--- a/news.xml
+++ b/news.xml
@@ -1,5 +1,5 @@
-<i2p.news date="$Date: 2006/05/09 16:17:17 $">
- <i2p.release version="0.6.1.18" date="2006/05/09" minVersion="0.6"
+<i2p.news date="$Date: 2006/05/09 21:38:42 $">
+ <i2p.release version="0.6.1.19" date="2006/05/18" minVersion="0.6"
               anonurl="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/i2p/i2pupdate.sud"
               publicurl="http://dev.i2p.net/i2p/i2pupdate.sud"
               anonannouncement="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/pipermail/i2p/2005-September/000878.html" 
@@ -12,11 +12,11 @@
 &#149;
 2006-05-09: 0.6.1.18 <a href="http://dev.i2p/pipermail/i2p/2006-May/001287.html">released</a>
 with changes to help reduce periodism, congestion and lease failure.
-<br>
+<br />
 &#149;
 2006-05-09:
 <a href="http://dev.i2p/pipermail/i2p/2006-May/001288.html">status notes</a>
 and
 <a href="http://www.i2p/meeting179">meeting log</a>
-<br>
+<br />
 </i2p.news>
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index fce369b148..9d6fa3eccd 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
  *
  */
 public class RouterVersion {
-    public final static String ID = "$Revision: 1.417 $ $Date: 2006-05-17 22:00:49 $";
-    public final static String VERSION = "0.6.1.18";
-    public final static long BUILD = 6;
+    public final static String ID = "$Revision: 1.418 $ $Date: 2006-05-17 22:42:57 $";
+    public final static String VERSION = "0.6.1.19";
+    public final static long BUILD = 0;
     public static void main(String args[]) {
         System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
         System.out.println("Router ID: " + RouterVersion.ID);
diff --git a/router/java/src/net/i2p/router/transport/udp/ACKSender.java b/router/java/src/net/i2p/router/transport/udp/ACKSender.java
index a6a494205d..d0bdc33d35 100644
--- a/router/java/src/net/i2p/router/transport/udp/ACKSender.java
+++ b/router/java/src/net/i2p/router/transport/udp/ACKSender.java
@@ -22,7 +22,7 @@ public class ACKSender implements Runnable {
     private boolean _alive;
     
     /** how frequently do we want to send ACKs to a peer? */
-    static final int ACK_FREQUENCY = 100;
+    static final int ACK_FREQUENCY = 200;
     
     public ACKSender(RouterContext ctx, UDPTransport transport) {
         _context = ctx;
@@ -60,6 +60,16 @@ public class ACKSender implements Runnable {
         }
     }
     
+    private long ackFrequency(long timeSinceACK, long rtt) {
+        // if we are actively pumping lots of data to them, we can depend upon
+        // the unsentACKThreshold to figure out when to send an ACK instead of
+        // using the timer, so we can set the timeout/frequency higher
+        if (timeSinceACK < 2*1000)
+            return Math.max(rtt/2, 500);
+        else
+            return ACK_FREQUENCY;
+    }
+    
     public void run() {
         while (_alive) {
             PeerState peer = null;
@@ -70,7 +80,7 @@ public class ACKSender implements Runnable {
                     for (int i = 0; i < _peersToACK.size(); i++) {
                         PeerState cur = (PeerState)_peersToACK.get(i);
                         long wanted = cur.getWantedACKSendSince();
-                        long delta = wanted + ACK_FREQUENCY - now;
+                        long delta = wanted + ackFrequency(now-cur.getLastACKSend(), cur.getRTT()) - now;
                         if ( ( (wanted > 0) && (delta < 0) ) || (cur.unsentACKThresholdReached()) ) {
                             _peersToACK.remove(i);
                             peer = cur;
diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
index c91119972e..7a757c9187 100644
--- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
+++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
@@ -153,7 +153,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
         _needsRebuild = true;
         
         _context.statManager().createRateStat("udp.alreadyConnected", "What is the lifetime of a reestablished session", "udp", new long[] { 60*1000, 10*60*1000, 60*60*1000, 24*60*60*1000 });
-        _context.statManager().createRateStat("udp.droppedPeer", "How long ago did we receive from a dropped peer (duration == session lifetime", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
+        _context.statManager().createRateStat("udp.droppedPeer", "How long ago did we receive from a dropped peer (duration == session lifetime", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
         _context.statManager().createRateStat("udp.droppedPeerInactive", "How long ago did we receive from a dropped peer (duration == session lifetime)", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
         _context.statManager().createRateStat("udp.statusOK", "How many times the peer test returned OK", "udp", new long[] { 5*60*1000, 20*60*1000, 60*60*1000, 24*60*60*1000 });
         _context.statManager().createRateStat("udp.statusDifferent", "How many times the peer test returned different IP/ports", "udp", new long[] { 5*60*1000, 20*60*1000, 60*60*1000, 24*60*60*1000 });
-- 
GitLab