2005-11-29 zzz

* Added a link to orion's jump page on the 'key not found' error page.
This commit is contained in:
jrandom
2005-11-29 17:56:02 +00:00
committed by zzz
parent d8071296eb
commit 3d18bf870b
3 changed files with 20 additions and 7 deletions

View File

@ -490,17 +490,20 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
_log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest); _log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest);
String str; String str;
byte[] header; byte[] header;
boolean showAddrHelper = false;
if (usingWWWProxy) if (usingWWWProxy)
str = FileUtil.readTextFile("docs/dnfp-header.ht", 100, true); str = FileUtil.readTextFile("docs/dnfp-header.ht", 100, true);
else if(ahelper != 0) else if(ahelper != 0)
str = FileUtil.readTextFile("docs/dnfb-header.ht", 100, true); str = FileUtil.readTextFile("docs/dnfb-header.ht", 100, true);
else else {
str = FileUtil.readTextFile("docs/dnfh-header.ht", 100, true); str = FileUtil.readTextFile("docs/dnfh-header.ht", 100, true);
showAddrHelper = true;
}
if (str != null) if (str != null)
header = str.getBytes(); header = str.getBytes();
else else
header = ERR_DESTINATION_UNKNOWN; header = ERR_DESTINATION_UNKNOWN;
writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination); writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination, showAddrHelper);
s.close(); s.close();
return; return;
} }
@ -569,7 +572,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
} }
private static void writeErrorMessage(byte[] errMessage, OutputStream out, String targetRequest, private static void writeErrorMessage(byte[] errMessage, OutputStream out, String targetRequest,
boolean usingWWWProxy, String wwwProxy) throws IOException { boolean usingWWWProxy, String wwwProxy, boolean showAddrHelper) throws IOException {
if (out != null) { if (out != null) {
out.write(errMessage); out.write(errMessage);
if (targetRequest != null) { if (targetRequest != null) {
@ -581,6 +584,13 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
out.write(uri.getBytes()); out.write(uri.getBytes());
out.write("</a>".getBytes()); out.write("</a>".getBytes());
if (usingWWWProxy) out.write(("<br>WWW proxy: " + wwwProxy).getBytes()); if (usingWWWProxy) out.write(("<br>WWW proxy: " + wwwProxy).getBytes());
if (showAddrHelper) {
out.write("<br><br>Click below to try an address helper link:<br><br><a href=\"http://orion.i2p/jump/".getBytes());
out.write(uri.getBytes());
out.write("\">http://orion.i2p/jump/".getBytes());
out.write(uri.getBytes());
out.write("</a>".getBytes());
}
} }
out.write("</div><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes()); out.write("</div><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes());
out.write(new Date().toString().getBytes()); out.write(new Date().toString().getBytes());
@ -606,7 +616,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
header = str.getBytes(); header = str.getBytes();
else else
header = ERR_DESTINATION_UNKNOWN; header = ERR_DESTINATION_UNKNOWN;
writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy); writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy, false);
} catch (IOException ioe) { } catch (IOException ioe) {
_log.warn(getPrefix(requestId) + "Error writing out the 'destination was unknown' " + "message", ioe); _log.warn(getPrefix(requestId) + "Error writing out the 'destination was unknown' " + "message", ioe);
} }

View File

@ -1,4 +1,7 @@
$Id: history.txt,v 1.336 2005/11/29 07:46:34 jrandom Exp $ $Id: history.txt,v 1.337 2005/11/29 11:58:01 jrandom Exp $
2005-11-29 zzz
* Added a link to orion's jump page on the 'key not found' error page.
2005-11-29 jrandom 2005-11-29 jrandom
* Further Syndie UI cleanup * Further Syndie UI cleanup

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
* *
*/ */
public class RouterVersion { public class RouterVersion {
public final static String ID = "$Revision: 1.303 $ $Date: 2005/11/28 11:02:40 $"; public final static String ID = "$Revision: 1.304 $ $Date: 2005/11/29 11:58:02 $";
public final static String VERSION = "0.6.1.6"; public final static String VERSION = "0.6.1.6";
public final static long BUILD = 3; public final static long BUILD = 4;
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);