From cb930a7ab5f14f340e8f064198d7fd67ab2d49f1 Mon Sep 17 00:00:00 2001
From: jrandom <jrandom>
Date: Thu, 2 Dec 2004 00:27:27 +0000
Subject: [PATCH] * 2004-12-01  0.4.2.2 released 2004-12-01  jrandom     *
 Fixed a stupid typo that inadvertantly allowed persistent HTTP      
 connections to work (thanks duck!)     * Make sure we override the inactivity
 timeout too

---
 .../i2p/i2ptunnel/I2PTunnelHTTPClient.java    | 23 +++++++++++++------
 history.txt                                   |  9 +++++++-
 installer/install.xml                         |  2 +-
 .../src/net/i2p/router/RouterVersion.java     |  4 ++--
 4 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
index da713ae49c..9e74f5fe41 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
@@ -147,15 +147,20 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
 
     private static final int DEFAULT_READ_TIMEOUT = 60*1000;
     
+    
     /** 
      * create the default options (using the default timeout, etc)
      *
      */
     protected I2PSocketOptions getDefaultOptions() {
-        I2PSocketOptions opts = super.getDefaultOptions();
         Properties defaultOpts = getTunnel().getClientOptions();
         if (!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT))
-            opts.setReadTimeout(DEFAULT_READ_TIMEOUT);
+            defaultOpts.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, ""+DEFAULT_READ_TIMEOUT);
+        if (!defaultOpts.contains("i2p.streaming.inactivityTimeout"))
+            defaultOpts.setProperty("i2p.streaming.inactivityTimeout", ""+DEFAULT_READ_TIMEOUT);
+        I2PSocketOptions opts = sockMgr.buildOptions(defaultOpts);
+        if (!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT))
+            opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
         return opts;
     }
     
@@ -164,14 +169,18 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
      *
      */
     protected I2PSocketOptions getDefaultOptions(Properties overrides) {
-        I2PSocketOptions opts = super.getDefaultOptions(overrides);
         Properties defaultOpts = getTunnel().getClientOptions();
         defaultOpts.putAll(overrides);
-        if (!defaultOpts.containsKey(I2PSocketOptions.PROP_READ_TIMEOUT))
-            opts.setConnectTimeout(DEFAULT_READ_TIMEOUT);
+        if (!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT))
+            defaultOpts.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, ""+DEFAULT_READ_TIMEOUT);
+        if (!defaultOpts.contains("i2p.streaming.inactivityTimeout"))
+            defaultOpts.setProperty("i2p.streaming.inactivityTimeout", ""+DEFAULT_READ_TIMEOUT);
+        I2PSocketOptions opts = sockMgr.buildOptions(defaultOpts);
+        if (!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT))
+            opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
         return opts;
     }
-    
+
     private static long __requestId = 0;
     protected void clientConnectionRun(Socket s) {
         OutputStream out = null;
@@ -348,7 +357,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
                 }
                 
                 if (line.length() == 0) {
-                    newRequest.append("User-Agent: MYOB/6.66 (AN/ON)");
+                    newRequest.append("User-Agent: MYOB/6.66 (AN/ON)\r\n");
                     newRequest.append("Connection: close\r\n\r\n");
                     break;
                 } else {
diff --git a/history.txt b/history.txt
index 86fce2247e..b3352233e5 100644
--- a/history.txt
+++ b/history.txt
@@ -1,4 +1,11 @@
-$Id: history.txt,v 1.90 2004/11/30 18:41:52 jrandom Exp $
+$Id: history.txt,v 1.91 2004/12/01 17:31:56 jrandom Exp $
+
+* 2004-12-01  0.4.2.2 released
+
+2004-12-01  jrandom
+    * Fixed a stupid typo that inadvertantly allowed persistent HTTP 
+      connections to work (thanks duck!)
+    * Make sure we override the inactivity timeout too
 
 * 2004-12-01  0.4.2.1 released
 
diff --git a/installer/install.xml b/installer/install.xml
index 4ecb5d6790..8fa21dfb0a 100644
--- a/installer/install.xml
+++ b/installer/install.xml
@@ -4,7 +4,7 @@
 
     <info>
         <appname>i2p</appname>
-        <appversion>0.4.2.1</appversion>
+        <appversion>0.4.2.2</appversion>
         <authors>
             <author name="I2P" email="support@i2p.net"/>
         </authors>
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index e2173aa8be..6228f95e50 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -15,8 +15,8 @@ import net.i2p.CoreVersion;
  *
  */
 public class RouterVersion {
-    public final static String ID = "$Revision: 1.95 $ $Date: 2004/11/30 18:41:51 $";
-    public final static String VERSION = "0.4.2.1";
+    public final static String ID = "$Revision: 1.96 $ $Date: 2004/12/01 17:31:56 $";
+    public final static String VERSION = "0.4.2.2";
     public final static long BUILD = 0;
     public static void main(String args[]) {
         System.out.println("I2P Router version: " + VERSION);
-- 
GitLab