diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java index 29fca6969..bb7a763fe 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java @@ -63,6 +63,8 @@ public class I2PTunnelConnectClient extends I2PTunnelHTTPClientBase implements R "HTTP/1.1 405 Bad Method\r\n"+ "Content-Type: text/html; charset=iso-8859-1\r\n"+ "Cache-control: no-cache\r\n"+ + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n"+ "

I2P ERROR: METHOD NOT ALLOWED

"+ "The request uses a bad protocol. "+ @@ -72,6 +74,8 @@ public class I2PTunnelConnectClient extends I2PTunnelHTTPClientBase implements R "HTTP/1.1 403 Access Denied\r\n"+ "Content-Type: text/html; charset=iso-8859-1\r\n"+ "Cache-control: no-cache\r\n"+ + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n"+ "

I2P ERROR: REQUEST DENIED

"+ "Your browser is misconfigured. Do not use the proxy to access the router console or other localhost destinations.
"; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 8c865ea85..74fcaccb1 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -91,6 +91,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 403 Access Denied\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: REQUEST DENIED

" + "You attempted to connect to a non-I2P website or location.
"; @@ -112,6 +114,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 503 Service Unavailable\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: No outproxy found

" + "Your request was for a site outside of I2P, but you have no " + @@ -121,6 +125,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 409 Conflict\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: Destination key conflict

" + "The addresshelper link you followed specifies a different destination key " + @@ -136,6 +142,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 404 Not Found\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: Helper key not resolvable.

" + "The helper key you put for i2paddresshelper= is not resolvable. " + @@ -146,6 +154,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 409 New Address\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

New Host Name with Address Helper

" + "The address helper link you followed is for a new host name that is not in your address book. " + @@ -157,6 +167,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 403 Bad Protocol\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: NON-HTTP PROTOCOL

" + "The request uses a bad protocol. " + @@ -166,6 +178,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 403 Bad URI\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: INVALID REQUEST URI

" + "The request URI is invalid, and probably contains illegal characters. " + @@ -175,6 +189,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 403 Access Denied\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: REQUEST DENIED

" + "Your browser is misconfigured. Do not use the proxy to access the router console or other localhost destinations.
"; @@ -183,6 +199,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "HTTP/1.1 403 SSL Rejected\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: SSL to I2P address rejected

" + "SSL for to .i2p addresses denied by configuration." + @@ -1159,6 +1177,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn try { out.write(("HTTP/1.1 301 Address Helper Accepted\r\n" + "Location: " + uri + "\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n").getBytes("UTF-8")); } catch (IOException ioe) { // ignore @@ -1384,6 +1404,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn private final static String ERR_HELPER_DISABLED = "HTTP/1.1 403 Disabled\r\n" + "Content-Type: text/plain\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "Address helpers disabled"; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java index 726e7358e..5824f1fc3 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java @@ -63,6 +63,8 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem "HTTP/1.1 407 Proxy Authentication Required\r\n" + "Content-Type: text/html; charset=UTF-8\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.5\r\n" + // try to get a UTF-8-encoded response back for the password "Proxy-Authenticate: "; // put the auth type and realm in between @@ -78,6 +80,8 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem "HTTP/1.1 503 Service Unavailable\r\n"+ "Content-Type: text/html; charset=iso-8859-1\r\n"+ "Cache-control: no-cache\r\n"+ + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n"+ "

I2P ERROR: No outproxy found

"+ "Your request was for a site outside of I2P, but you have no "+ @@ -87,6 +91,8 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem "HTTP/1.1 503 Service Unavailable\r\n" + "Content-Type: text/html; charset=iso-8859-1\r\n" + "Cache-control: no-cache\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n" + "

I2P ERROR: DESTINATION NOT FOUND

" + "That I2P Destination was not found. Perhaps you pasted in the " + diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java index c40d2e0e3..2d70caed0 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java @@ -36,15 +36,28 @@ public abstract class LocalHTTPServer { private final static String ERR_404 = "HTTP/1.1 404 Not Found\r\n"+ "Content-Type: text/plain\r\n"+ + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n"+ "HTTP Proxy local file not found"; private final static String ERR_ADD = "HTTP/1.1 409 Bad\r\n"+ "Content-Type: text/plain\r\n"+ + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n"+ "Add to addressbook failed - bad parameters"; + private final static String OK = + "HTTP/1.1 200 OK\r\n" + + "Content-Type: text/plain\r\n" + + "Cache-Control: max-age=86400\r\n" + + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ + "\r\n"+ + "I2P HTTP proxy OK"; + /** * Very simple web server. * @@ -72,7 +85,7 @@ public abstract class LocalHTTPServer { //System.err.println("targetRequest: \"" + targetRequest + "\""); // a home page message for the curious... if (targetRequest.equals("/")) { - out.write(("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nCache-Control: max-age=86400\r\n\r\nI2P HTTP proxy OK").getBytes("UTF-8")); + out.write(OK.getBytes("UTF-8")); out.flush(); return; } @@ -103,7 +116,7 @@ public abstract class LocalHTTPServer { else type = "text/html"; out.write("HTTP/1.1 200 OK\r\nContent-Type: ".getBytes("UTF-8")); out.write(type.getBytes("UTF-8")); - out.write("\r\nCache-Control: max-age=86400\r\n\r\n".getBytes("UTF-8")); + out.write("\r\nCache-Control: max-age=86400\r\nConnection: close\r\nProxy-Connection: close\r\n\r\n".getBytes("UTF-8")); FileUtil.readFile(filename, themesDir.getAbsolutePath(), out); return; } @@ -181,6 +194,8 @@ public abstract class LocalHTTPServer { tbook = book; out.write(("HTTP/1.1 200 OK\r\n"+ "Content-Type: text/html; charset=UTF-8\r\n"+ + "Connection: close\r\n"+ + "Proxy-Connection: close\r\n"+ "\r\n"+ ""+ "" + _("Redirecting to {0}", host) + "\n" + diff --git a/history.txt b/history.txt index f3f620c2d..54502face 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,12 @@ +2015-05-04 zzz + * i2ptunnel: + - Close input stream when HTTP client decompressor + terminates (ticket #1506) + - Add Connection: close headers to errors and proxy.i2p responses + where it was missing (ticket #1531) + 2015-05-03 zzz + * Console: Add floodfill configuration form to /configadvanced * Router: Allow class M to become floodfill; add bandwidth classes P and X (ticket #1447) * SusiDNS: Add export button diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 31c35f8c3..ea17ad55f 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 14; + public final static long BUILD = 15; /** for example "-test" */ public final static String EXTRA = "";