2005-09-16 jrandom

* Added the i2p.exe and i2pinstall.exe for windows users, using launch4j.
    * Added runplain.sh for *nix/osx users having problems using the java
      service wrapper (called from the install dir as: sh runplain.sh)
    * Bundle susidns and syndie, with links on the top nav
    * Have I2PTunnelHTTPClient and I2PTunnelHTTPServer use the x-i2p-gzip
      content-encoding (if offered), reducing the payload size before it
      reaches the streaming lib.  The existing compression is at the i2cp
      level, so we've been packetizing 4KB of uncompressed data and then
      compressing those messages, rather than compressing and then packetizing
      4KB of compressed data.  This should reduce the number of round trips
      to fetch web pages substantially.
    * Adjust the startup and timing of the addressbook so that susidns always
      has config to work off, and expose a method for susidns to tell it to
      reload its config and rerun.
This commit is contained in:
jrandom
2005-09-16 04:12:24 +00:00
committed by zzz
parent 8c1895e04f
commit d89f589f2b
17 changed files with 396 additions and 46 deletions

View File

@ -36,6 +36,7 @@ import java.io.File;
*/ */
public class Daemon { public class Daemon {
public static final String VERSION = "2.0.3"; public static final String VERSION = "2.0.3";
private static final Daemon _instance = new Daemon();
/** /**
* Update the router and published address books using remote data from the * Update the router and published address books using remote data from the
@ -56,7 +57,7 @@ public class Daemon {
* @param log * @param log
* The log to write changes and conflicts to. * The log to write changes and conflicts to.
*/ */
public static void update(AddressBook master, AddressBook router, public void update(AddressBook master, AddressBook router,
File published, SubscriptionList subscriptions, Log log) { File published, SubscriptionList subscriptions, Log log) {
router.merge(master, true, null); router.merge(master, true, null);
Iterator iter = subscriptions.iterator(); Iterator iter = subscriptions.iterator();
@ -77,7 +78,7 @@ public class Daemon {
* @param home * @param home
* The directory containing addressbook's configuration files. * The directory containing addressbook's configuration files.
*/ */
public static void update(Map settings, String home) { public void update(Map settings, String home) {
File masterFile = new File(home, (String) settings File masterFile = new File(home, (String) settings
.get("master_addressbook")); .get("master_addressbook"));
File routerFile = new File(home, (String) settings File routerFile = new File(home, (String) settings
@ -104,7 +105,7 @@ public class Daemon {
.get("proxy_host"), Integer.parseInt((String) settings.get("proxy_port"))); .get("proxy_host"), Integer.parseInt((String) settings.get("proxy_port")));
Log log = new Log(logFile); Log log = new Log(logFile);
Daemon.update(master, router, published, subscriptions, log); update(master, router, published, subscriptions, log);
} }
/** /**
@ -118,6 +119,10 @@ public class Daemon {
* others are ignored. * others are ignored.
*/ */
public static void main(String[] args) { public static void main(String[] args) {
_instance.run(args);
}
public void run(String[] args) {
String settingsLocation = "config.txt"; String settingsLocation = "config.txt";
Map settings = new HashMap(); Map settings = new HashMap();
String home; String home;
@ -151,19 +156,36 @@ public class Daemon {
File settingsFile = new File(homeFile, settingsLocation); File settingsFile = new File(homeFile, settingsLocation);
settings = ConfigParser.parse(settingsFile, defaultSettings);
// wait
try {
Thread.currentThread().sleep(5*60*1000);
} catch (InterruptedException ie) {}
while (true) { while (true) {
settings = ConfigParser.parse(settingsFile, defaultSettings);
long delay = Long.parseLong((String) settings.get("update_delay")); long delay = Long.parseLong((String) settings.get("update_delay"));
if (delay < 1) { if (delay < 1) {
delay = 1; delay = 1;
} }
Daemon.update(settings, home); update(settings, home);
try { try {
Thread.sleep(delay * 60 * 60 * 1000); synchronized (this) {
wait(delay * 60 * 60 * 1000);
}
} catch (InterruptedException exp) { } catch (InterruptedException exp) {
} }
settings = ConfigParser.parse(settingsFile, defaultSettings);
}
}
/**
* Call this to get the addressbook to reread its config and
* refetch its subscriptions.
*/
public static void wakeup() {
synchronized (_instance) {
_instance.notifyAll();
} }
} }
} }

View File

@ -44,10 +44,10 @@ public class DaemonThread extends Thread {
* @see java.lang.Runnable#run() * @see java.lang.Runnable#run()
*/ */
public void run() { public void run() {
try { //try {
Thread.sleep(5 * 60 * 1000); // Thread.sleep(5 * 60 * 1000);
} catch (InterruptedException exp) { //} catch (InterruptedException exp) {
} //}
Daemon.main(this.args); Daemon.main(this.args);
} }
} }

View File

@ -8,36 +8,49 @@ package net.i2p.i2ptunnel;
* *
*/ */
import java.io.ByteArrayOutputStream; import java.io.*;
import java.io.IOException;
import java.io.FilterOutputStream;
import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.zip.GZIPInputStream;
import net.i2p.I2PAppContext;
import net.i2p.data.ByteArray; import net.i2p.data.ByteArray;
import net.i2p.util.ByteCache; import net.i2p.util.ByteCache;
import net.i2p.util.I2PThread;
import net.i2p.util.Log; import net.i2p.util.Log;
/** /**
* Simple stream for delivering an HTTP response to * Simple stream for delivering an HTTP response to
* the client, trivially filtered to make sure "Connection: close" * the client, trivially filtered to make sure "Connection: close"
* is always in the response. * is always in the response. Perhaps add transparent handling of the
* Content-encoding: x-i2p-gzip, adjusting the headers to say Content-encoding: identity?
* Content-encoding: gzip is trivial as well, but Transfer-encoding: chunked makes it
* more work than is worthwhile at the moment.
* *
*/ */
class HTTPResponseOutputStream extends FilterOutputStream { class HTTPResponseOutputStream extends FilterOutputStream {
private static final Log _log = new Log(HTTPResponseOutputStream.class); private I2PAppContext _context;
private Log _log;
private ByteCache _cache; private ByteCache _cache;
protected ByteArray _headerBuffer; protected ByteArray _headerBuffer;
private boolean _headerWritten; private boolean _headerWritten;
private byte _buf1[]; private byte _buf1[];
protected boolean _gzip;
private long _dataWritten;
private static final int CACHE_SIZE = 8*1024; private static final int CACHE_SIZE = 8*1024;
public HTTPResponseOutputStream(OutputStream raw) { public HTTPResponseOutputStream(OutputStream raw) {
super(raw); super(raw);
_context = I2PAppContext.getGlobalContext();
_context.statManager().createRateStat("i2ptunnel.http.compressionRatio", "ratio of compressed size to decompressed size after transfer", "i2ptunnel", new long[] { 60*1000, 30*60*1000 });
_context.statManager().createRateStat("i2ptunnel.http.compressed", "compressed size transferred", "i2ptunnel", new long[] { 60*1000, 30*60*1000 });
_context.statManager().createRateStat("i2ptunnel.http.expanded", "size transferred after expansion", "i2ptunnel", new long[] { 60*1000, 30*60*1000 });
_log = _context.logManager().getLog(getClass());
_cache = ByteCache.getInstance(8, CACHE_SIZE); _cache = ByteCache.getInstance(8, CACHE_SIZE);
_headerBuffer = _cache.acquire(); _headerBuffer = _cache.acquire();
_headerWritten = false; _headerWritten = false;
_gzip = false;
_dataWritten = 0;
_buf1 = new byte[1]; _buf1 = new byte[1];
} }
@ -51,6 +64,7 @@ class HTTPResponseOutputStream extends FilterOutputStream {
public void write(byte buf[], int off, int len) throws IOException { public void write(byte buf[], int off, int len) throws IOException {
if (_headerWritten) { if (_headerWritten) {
out.write(buf, off, len); out.write(buf, off, len);
_dataWritten += len;
return; return;
} }
@ -62,8 +76,11 @@ class HTTPResponseOutputStream extends FilterOutputStream {
if (headerReceived()) { if (headerReceived()) {
writeHeader(); writeHeader();
_headerWritten = true; _headerWritten = true;
if (i + 1 < len) // write out the remaining if (i + 1 < len) {
// write out the remaining
out.write(buf, off+i+1, len-i-1); out.write(buf, off+i+1, len-i-1);
_dataWritten += len-i-1;
}
return; return;
} }
} }
@ -128,7 +145,10 @@ class HTTPResponseOutputStream extends FilterOutputStream {
if ( (keyLen <= 0) || (valLen <= 0) ) if ( (keyLen <= 0) || (valLen <= 0) )
throw new IOException("Invalid header @ " + j); throw new IOException("Invalid header @ " + j);
String key = new String(_headerBuffer.getData(), lastEnd+1, keyLen); String key = new String(_headerBuffer.getData(), lastEnd+1, keyLen);
String val = new String(_headerBuffer.getData(), j+2, valLen); String val = new String(_headerBuffer.getData(), j+2, valLen).trim();
if (_log.shouldLog(Log.INFO))
_log.info("Response header [" + key + "] = [" + val + "]");
if ("Connection".equalsIgnoreCase(key)) { if ("Connection".equalsIgnoreCase(key)) {
out.write("Connection: close\n".getBytes()); out.write("Connection: close\n".getBytes());
@ -136,6 +156,8 @@ class HTTPResponseOutputStream extends FilterOutputStream {
} else if ("Proxy-Connection".equalsIgnoreCase(key)) { } else if ("Proxy-Connection".equalsIgnoreCase(key)) {
out.write("Proxy-Connection: close\n".getBytes()); out.write("Proxy-Connection: close\n".getBytes());
proxyConnectionSent = true; proxyConnectionSent = true;
} else if ( ("Content-encoding".equalsIgnoreCase(key)) && ("x-i2p-gzip".equalsIgnoreCase(val)) ) {
_gzip = true;
} else { } else {
out.write((key.trim() + ": " + val.trim() + "\n").getBytes()); out.write((key.trim() + ": " + val.trim() + "\n").getBytes());
} }
@ -152,13 +174,80 @@ class HTTPResponseOutputStream extends FilterOutputStream {
if (!proxyConnectionSent) if (!proxyConnectionSent)
out.write("Proxy-Connection: close\n".getBytes()); out.write("Proxy-Connection: close\n".getBytes());
out.write("\n".getBytes()); // end of the headers finishHeaders();
// done, shove off // done, shove off
if (_headerBuffer.getData().length == CACHE_SIZE) if (_headerBuffer.getData().length == CACHE_SIZE)
_cache.release(_headerBuffer); _cache.release(_headerBuffer);
else else
_headerBuffer = null; _headerBuffer = null;
if (_log.shouldLog(Log.INFO))
_log.info("After headers: gzip? " + _gzip);
if (shouldCompress()) {
beginProcessing();
}
}
protected boolean shouldCompress() { return _gzip; }
protected void finishHeaders() throws IOException {
out.write("\n".getBytes()); // end of the headers
}
protected void beginProcessing() throws IOException {
out.flush();
PipedInputStream pi = new PipedInputStream();
PipedOutputStream po = new PipedOutputStream(pi);
new I2PThread(new Pusher(pi, out), "HTTP decompresser").start();
out = po;
}
private class Pusher implements Runnable {
private InputStream _in;
private OutputStream _out;
public Pusher(InputStream in, OutputStream out) {
_in = in;
_out = out;
}
public void run() {
OutputStream to = null;
InternalGZIPInputStream in = null;
try {
long start = System.currentTimeMillis();
in = new InternalGZIPInputStream(_in);
byte buf[] = new byte[8192];
int read = -1;
while ( (read = in.read(buf)) != -1) {
if (_log.shouldLog(Log.INFO))
_log.info("Read " + read + " and writing it to the browser/streams");
_out.write(buf, 0, read);
}
if (_log.shouldLog(Log.INFO))
_log.info("Decompressed: " + _dataWritten + ", " + in.getTotalRead() + "/" + in.getTotalExpanded());
long end = System.currentTimeMillis();
long compressed = in.getTotalRead();
long expanded = in.getTotalExpanded();
double ratio = 0;
if (expanded > 0)
ratio = compressed/expanded;
_context.statManager().addRateData("i2ptunnel.http.compressionRatio", (int)(100d*ratio), end-start);
_context.statManager().addRateData("i2ptunnel.http.compressed", compressed, end-start);
_context.statManager().addRateData("i2ptunnel.http.expanded", expanded, end-start);
} catch (IOException ioe) {
if (_log.shouldLog(Log.WARN))
_log.warn("Error decompressing: " + _dataWritten + ", " + in.getTotalRead() + "/" + in.getTotalExpanded(), ioe);
} finally {
if (_out != null) try { _out.close(); } catch (IOException ioe) {}
}
}
}
private class InternalGZIPInputStream extends GZIPInputStream {
public InternalGZIPInputStream(InputStream in) throws IOException {
super(in);
}
public long getTotalRead() { return super.inf.getTotalIn(); }
public long getTotalExpanded() { return super.inf.getTotalOut(); }
} }
public static void main(String args[]) { public static void main(String args[]) {

View File

@ -369,6 +369,13 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
} }
if (line.length() == 0) { if (line.length() == 0) {
String ok = getTunnel().getContext().getProperty("i2ptunnel.gzip");
boolean gzip = true;
if (ok != null)
gzip = Boolean.valueOf(ok).booleanValue();
if (gzip)
newRequest.append("Accept-Encoding: x-i2p-gzip\r\n");
newRequest.append("User-Agent: MYOB/6.66 (AN/ON)\r\n"); newRequest.append("User-Agent: MYOB/6.66 (AN/ON)\r\n");
newRequest.append("Connection: close\r\n\r\n"); newRequest.append("Connection: close\r\n\r\n");
break; break;

View File

@ -3,14 +3,13 @@
*/ */
package net.i2p.i2ptunnel; package net.i2p.i2ptunnel;
import java.io.File; import java.io.*;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Socket; import java.net.Socket;
import java.net.SocketException; import java.net.SocketException;
import java.util.Iterator; import java.util.Iterator;
import java.util.Properties; import java.util.Properties;
import java.util.zip.GZIPOutputStream;
import net.i2p.I2PAppContext; import net.i2p.I2PAppContext;
import net.i2p.I2PException; import net.i2p.I2PException;
@ -24,7 +23,9 @@ import net.i2p.util.Log;
/** /**
* Simple extension to the I2PTunnelServer that filters the HTTP * Simple extension to the I2PTunnelServer that filters the HTTP
* headers sent from the client to the server, replacing the Host * headers sent from the client to the server, replacing the Host
* header with whatever this instance has been configured with. * header with whatever this instance has been configured with, and
* if the browser set Accept-encoding: x-i2p-gzip, gzip the http
* message body and set Content-encoding: x-i2p-gzip.
* *
*/ */
public class I2PTunnelHTTPServer extends I2PTunnelServer { public class I2PTunnelHTTPServer extends I2PTunnelServer {
@ -62,14 +63,35 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
try { try {
// give them 5 seconds to send in the HTTP request // give them 5 seconds to send in the HTTP request
socket.setReadTimeout(5*1000); socket.setReadTimeout(5*1000);
String modifiedHeader = getModifiedHeader(socket);
InputStream in = socket.getInputStream();
StringBuffer command = new StringBuffer(128);
Properties headers = readHeaders(in, command);
headers.setProperty("Host", _spoofHost);
headers.setProperty("Connection", "close");
String modifiedHeader = formatHeaders(headers, command);
//String modifiedHeader = getModifiedHeader(socket);
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("Modified header: [" + modifiedHeader + "]"); _log.debug("Modified header: [" + modifiedHeader + "]");
socket.setReadTimeout(readTimeout); socket.setReadTimeout(readTimeout);
Socket s = new Socket(remoteHost, remotePort); Socket s = new Socket(remoteHost, remotePort);
afterSocket = getTunnel().getContext().clock().now(); afterSocket = getTunnel().getContext().clock().now();
new I2PTunnelRunner(s, socket, slock, null, modifiedHeader.getBytes(), null); // instead of i2ptunnelrunner, use something that reads the HTTP
// request from the socket, modifies the headers, sends the request to the
// server, reads the response headers, rewriting to include Content-encoding: x-i2p-gzip
// if it was one of the Accept-encoding: values, and gzip the payload
String enc = headers.getProperty("Accept-encoding");
if (_log.shouldLog(Log.INFO))
_log.info("HTTP server encoding header: " + enc);
if ( (enc != null) && (enc.indexOf("x-i2p-gzip") >= 0) ) {
I2PThread req = new I2PThread(new CompressedRequestor(s, socket, modifiedHeader), "http compressor");
req.start();
} else {
new I2PTunnelRunner(s, socket, slock, null, modifiedHeader.getBytes(), null);
}
} catch (SocketException ex) { } catch (SocketException ex) {
try { try {
socket.close(); socket.close();
@ -88,17 +110,107 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
if ( (timeToHandle > 1000) && (_log.shouldLog(Log.WARN)) ) if ( (timeToHandle > 1000) && (_log.shouldLog(Log.WARN)) )
_log.warn("Took a while to handle the request [" + timeToHandle + ", socket create: " + (afterSocket-afterAccept) + "]"); _log.warn("Took a while to handle the request [" + timeToHandle + ", socket create: " + (afterSocket-afterAccept) + "]");
} }
private String getModifiedHeader(I2PSocket handleSocket) throws IOException {
InputStream in = handleSocket.getInputStream();
StringBuffer command = new StringBuffer(128);
Properties headers = readHeaders(in, command);
headers.setProperty("Host", _spoofHost);
headers.setProperty("Connection", "close");
return formatHeaders(headers, command);
}
private class CompressedRequestor implements Runnable {
private Socket _webserver;
private I2PSocket _browser;
private String _headers;
public CompressedRequestor(Socket webserver, I2PSocket browser, String headers) {
_webserver = webserver;
_browser = browser;
_headers = headers;
}
public void run() {
if (_log.shouldLog(Log.INFO))
_log.info("Compressed requestor running");
OutputStream serverout = null;
OutputStream browserout = null;
InputStream browserin = null;
InputStream serverin = null;
try {
serverout = _webserver.getOutputStream();
if (_log.shouldLog(Log.INFO))
_log.info("request headers: " + _headers);
serverout.write(_headers.getBytes());
browserin = _browser.getInputStream();
I2PThread sender = new I2PThread(new Sender(serverout, browserin, "server: browser to server"), "http compressed sender");
sender.start();
browserout = _browser.getOutputStream();
serverin = _webserver.getInputStream();
Sender s = new Sender(new CompressedResponseOutputStream(browserout), serverin, "server: server to browser");
if (_log.shouldLog(Log.INFO))
_log.info("Before pumping the compressed response");
s.run(); // same thread
if (_log.shouldLog(Log.INFO))
_log.info("After pumping the compressed response");
} catch (IOException ioe) {
if (_log.shouldLog(Log.WARN))
_log.warn("error compressing", ioe);
} finally {
if (browserout != null) try { browserout.close(); } catch (IOException ioe) {}
if (serverout != null) try { serverout.close(); } catch (IOException ioe) {}
if (browserin != null) try { browserin.close(); } catch (IOException ioe) {}
if (serverin != null) try { serverin.close(); } catch (IOException ioe) {}
}
}
}
private class Sender implements Runnable {
private OutputStream _out;
private InputStream _in;
private String _name;
public Sender(OutputStream out, InputStream in, String name) {
_out = out;
_in = in;
_name = name;
}
public void run() {
if (_log.shouldLog(Log.INFO))
_log.info(_name + ": Begin sending");
try {
byte buf[] = new byte[4096];
int read = 0;
int total = 0;
while ( (read = _in.read(buf)) != -1) {
if (_log.shouldLog(Log.INFO))
_log.info(_name + ": read " + read + " and sending through the stream");
_out.write(buf, 0, read);
total += read;
}
if (_log.shouldLog(Log.INFO))
_log.info(_name + ": Done sending: " + total);
_out.flush();
} catch (IOException ioe) {
if (_log.shouldLog(Log.WARN))
_log.warn("Error sending", ioe);
} finally {
if (_in != null) try { _in.close(); } catch (IOException ioe) {}
if (_out != null) try { _out.close(); } catch (IOException ioe) {}
}
}
}
private class CompressedResponseOutputStream extends HTTPResponseOutputStream {
public CompressedResponseOutputStream(OutputStream o) {
super(o);
}
protected boolean shouldCompress() { return true; }
protected void finishHeaders() throws IOException {
if (_log.shouldLog(Log.INFO))
_log.info("Including x-i2p-gzip as the content encoding in the response");
out.write("Content-encoding: x-i2p-gzip\n".getBytes());
super.finishHeaders();
}
protected void beginProcessing() throws IOException {
if (_log.shouldLog(Log.INFO))
_log.info("Beginning compression processing");
out.flush();
out = new GZIPOutputStream(out);
}
}
private String formatHeaders(Properties headers, StringBuffer command) { private String formatHeaders(Properties headers, StringBuffer command) {
StringBuffer buf = new StringBuffer(command.length() + headers.size() * 64); StringBuffer buf = new StringBuffer(command.length() + headers.size() * 64);
buf.append(command.toString()).append('\n'); buf.append(command.toString()).append('\n');
@ -133,6 +245,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
if (split <= 0) throw new IOException("Invalid HTTP header, missing colon [" + buf.toString() + "]"); if (split <= 0) throw new IOException("Invalid HTTP header, missing colon [" + buf.toString() + "]");
String name = buf.substring(0, split); String name = buf.substring(0, split);
String value = buf.substring(split+2); // ": " String value = buf.substring(split+2); // ": "
if ("Accept-encoding".equalsIgnoreCase(name))
name = "Accept-encoding";
headers.setProperty(name, value); headers.setProperty(name, value);
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("Read the header [" + name + "] = [" + value + "]"); _log.debug("Read the header [" + name + "] = [" + value + "]");

View File

@ -45,7 +45,7 @@ more information).</p>
<p>The router by default also includes human's public domain <a href="http://www.i2p.net/sam">SAM</a> bridge, <p>The router by default also includes human's public domain <a href="http://www.i2p.net/sam">SAM</a> bridge,
which other client applications (such the <a href="http://duck.i2p/i2p-bt/">bittorrent port</a>) can use. which other client applications (such the <a href="http://duck.i2p/i2p-bt/">bittorrent port</a>) can use.
There is also an optimized library for doing large number calculations - jbigi - which in turn uses the There is also an optimized library for doing large number calculations - jbigi - which in turn uses the
LGPL licensed <a href="http://swox.com/gmp/">GMP</a> library, tuned for various PC architectures. For LGPL licensed <a href="http://swox.com/gmp/">GMP</a> library, tuned for various PC architectures. Launchers for windows users are built with <a href="http://launch4j.sourceforge.net/">Launch4J</a>, and the installer is built with <a href="http://www.izforge.com/izpack/">IzPack</a>. For
details on other applications available, as well as their licenses, please see the details on other applications available, as well as their licenses, please see the
<a href="http://www.i2p.net/licenses">license policy</a>. Source for the I2P code and most bundled <a href="http://www.i2p.net/licenses">license policy</a>. Source for the I2P code and most bundled
client applications can be found on our <a href="http://www.i2p.net/download">download page</a>, and is client applications can be found on our <a href="http://www.i2p.net/download">download page</a>, and is

View File

@ -15,14 +15,16 @@
</div> </div>
<h4> <h4>
<a href="susimail/susimail">Susimail</a> |
<a href="susidns/">SusiDNS</a> |
<a href="syndie/">Syndie</a> |
<a href="i2ptunnel/">I2PTunnel</a> |
<a href="tunnels.jsp">Tunnels</a> | <a href="tunnels.jsp">Tunnels</a> |
<a href="profiles.jsp">Profiles</a> | <a href="profiles.jsp">Profiles</a> |
<a href="netdb.jsp">NetDB</a> | <a href="netdb.jsp">NetDB</a> |
<a href="logs.jsp">Logs</a> | <a href="logs.jsp">Logs</a> |
<a href="oldconsole.jsp">Internals</a> |
<a href="oldstats.jsp">Stats</a> | <a href="oldstats.jsp">Stats</a> |
<a href="i2ptunnel/" target="_blank">I2PTunnel</a> | <a href="oldconsole.jsp">Internals</a>
<a href="susimail/susimail" target="_blank">Susimail</a>
<jsp:useBean class="net.i2p.router.web.NavHelper" id="navhelper" scope="request" /> <jsp:useBean class="net.i2p.router.web.NavHelper" id="navhelper" scope="request" />
<jsp:setProperty name="navhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="navhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
<jsp:getProperty name="navhelper" property="clientAppLinks" /> <jsp:getProperty name="navhelper" property="clientAppLinks" />

View File

@ -12,7 +12,7 @@
</target> </target>
<target name="dist" depends="pkg, javadoc"> <target name="dist" depends="pkg, javadoc">
</target> </target>
<target name="build" depends="builddep, jar, buildWEB" /> <target name="build" depends="builddep, jar, buildWEB, buildexe" />
<target name="buildclean" depends="distclean, build" /> <target name="buildclean" depends="distclean, build" />
<target name="builddep"> <target name="builddep">
<!-- build *everything* here, but only once --> <!-- build *everything* here, but only once -->
@ -28,6 +28,7 @@
<ant dir="apps/routerconsole/java/" target="jar" /> <ant dir="apps/routerconsole/java/" target="jar" />
<ant dir="apps/addressbook/" target="war" /> <ant dir="apps/addressbook/" target="war" />
<ant dir="apps/susimail/" target="war" /> <ant dir="apps/susimail/" target="war" />
<ant dir="apps/susidns/src" target="all" />
<ant dir="apps/syndie/java/" target="jar" /> <!-- not pushed in the update... yet --> <ant dir="apps/syndie/java/" target="jar" /> <!-- not pushed in the update... yet -->
</target> </target>
<target name="buildWEB"> <target name="buildWEB">
@ -44,6 +45,20 @@
<copy file="apps/jetty/jettylib/xercesImpl.jar" todir="build/" /> <copy file="apps/jetty/jettylib/xercesImpl.jar" todir="build/" />
<copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" /> <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
</target> </target>
<target name="buildexe">
<jar destfile="./build/launchi2p.jar">
<manifest>
<attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
<attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-compiler.jar lib/jasper-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/ant.jar lib/xercesImpl.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar" />
</manifest>
</jar>
<!-- now the standalone launcher exe -->
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
<launch4j configFile="./installer/i2pstandalone.xml" />
<!-- thazzit -->
</target>
<target name="compile" /> <target name="compile" />
<target name="jar" depends="compile" > <target name="jar" depends="compile" >
<copy file="core/java/build/i2p.jar" todir="build/" /> <copy file="core/java/build/i2p.jar" todir="build/" />
@ -59,6 +74,7 @@
<copy file="installer/lib/jbigi/jbigi.jar" todir="build" /> <copy file="installer/lib/jbigi/jbigi.jar" todir="build" />
<copy file="apps/addressbook/dist/addressbook.war" todir="build/" /> <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
<copy file="apps/susimail/susimail.war" todir="build/" /> <copy file="apps/susimail/susimail.war" todir="build/" />
<copy file="apps/susidns/src/susidns.war" todir="build/" />
<copy file="apps/syndie/syndie.war" todir="build/" /> <copy file="apps/syndie/syndie.war" todir="build/" />
<copy file="apps/syndie/java/build/syndie.jar" todir="build/" /> <copy file="apps/syndie/java/build/syndie.jar" todir="build/" />
<copy file="apps/syndie/syndie.war" todir="build/" /> <copy file="apps/syndie/syndie.war" todir="build/" />
@ -99,6 +115,8 @@
</target> </target>
<target name="clean" depends="pkgclean" > <target name="clean" depends="pkgclean" >
<delete dir="./build" /> <delete dir="./build" />
<delete file="i2pinstall.exe" />
<delete file="i2p.exe" />
</target> </target>
<target name="distclean" depends="clean"> <target name="distclean" depends="clean">
<ant dir="core/java/" target="distclean" /> <ant dir="core/java/" target="distclean" />
@ -112,6 +130,7 @@
<ant dir="apps/routerconsole/java/" target="distclean" /> <ant dir="apps/routerconsole/java/" target="distclean" />
<ant dir="apps/addressbook/" target="distclean" /> <ant dir="apps/addressbook/" target="distclean" />
<ant dir="apps/susimail/" target="distclean" /> <ant dir="apps/susimail/" target="distclean" />
<ant dir="apps/susidns/src/" target="distclean" />
<ant dir="apps/systray/java/" target="distclean" /> <ant dir="apps/systray/java/" target="distclean" />
<ant dir="installer/java/" target="distclean" /> <ant dir="installer/java/" target="distclean" />
<delete> <delete>
@ -180,6 +199,8 @@
<copy file="build/routerconsole.jar" todir="pkg-temp/lib/" /> <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
<copy file="build/sam.jar" todir="pkg-temp/lib/" /> <copy file="build/sam.jar" todir="pkg-temp/lib/" />
<copy file="build/systray.jar" todir="pkg-temp/lib" /> <copy file="build/systray.jar" todir="pkg-temp/lib" />
<copy file="i2p.exe" todir="pkg-temp/" />
<copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
<copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" /> <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
<copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" /> <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
<copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" /> <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
@ -189,6 +210,7 @@
<copy file="build/routerconsole.war" todir="pkg-temp/webapps/" /> <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
<copy file="build/addressbook.war" todir="pkg-temp/webapps/" /> <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
<copy file="build/susimail.war" todir="pkg-temp/webapps/" /> <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
<copy file="build/susidns.war" todir="pkg-temp/webapps/" />
<copy file="build/syndie.war" todir="pkg-temp/webapps/" /> <copy file="build/syndie.war" todir="pkg-temp/webapps/" />
<copy file="installer/resources/clients.config" todir="pkg-temp/" /> <copy file="installer/resources/clients.config" todir="pkg-temp/" />
<copy file="installer/resources/eepget" todir="pkg-temp/" /> <copy file="installer/resources/eepget" todir="pkg-temp/" />
@ -268,6 +290,8 @@
<copy file="build/sam.jar" todir="pkg-temp/lib/" /> <copy file="build/sam.jar" todir="pkg-temp/lib/" />
<copy file="build/router.jar" todir="pkg-temp/lib/" /> <copy file="build/router.jar" todir="pkg-temp/lib/" />
<copy file="build/routerconsole.jar" todir="pkg-temp/lib/" /> <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
<copy file="i2p.exe" todir="pkg-temp/" />
<copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
<!-- for the i2p 0.5 release, push jetty 5.2.1 --> <!-- for the i2p 0.5 release, push jetty 5.2.1 -->
<!-- <!--
@ -288,6 +312,7 @@
<copy file="build/routerconsole.war" todir="pkg-temp/webapps/" /> <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
<copy file="build/addressbook.war" todir="pkg-temp/webapps/" /> <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
<copy file="build/susimail.war" todir="pkg-temp/webapps/" /> <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
<copy file="build/susidns.war" todir="pkg-temp/webapps/" />
<copy file="build/syndie.war" todir="pkg-temp/webapps/" /> <copy file="build/syndie.war" todir="pkg-temp/webapps/" />
<copy file="history.txt" todir="pkg-temp/" /> <copy file="history.txt" todir="pkg-temp/" />
<mkdir dir="pkg-temp/docs/" /> <mkdir dir="pkg-temp/docs/" />
@ -313,6 +338,17 @@
<manifest><attribute name="Main-Class" value="net.i2p.util.Exec" /></manifest> <manifest><attribute name="Main-Class" value="net.i2p.util.Exec" /></manifest>
</jar> </jar>
<izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" /> <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<ant target="installerexe" />
</target>
<target name="installerexe">
<!-- now the installer exe -->
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
<launch4j configFile="./installer/i2pinstaller.xml" />
<launch4j configFile="./installer/i2pstandalone.xml" />
<!-- thazzit -->
</target> </target>
<target name="test"> <target name="test">
<ant dir="core/java/" target="test" /> <ant dir="core/java/" target="test" />

View File

@ -1,4 +1,20 @@
$Id: history.txt,v 1.249 2005/09/13 18:02:44 jrandom Exp $ $Id: history.txt,v 1.250 2005/09/15 00:39:31 jrandom Exp $
2005-09-16 jrandom
* Added the i2p.exe and i2pinstall.exe for windows users, using launch4j.
* Added runplain.sh for *nix/osx users having problems using the java
service wrapper (called from the install dir as: sh runplain.sh)
* Bundle susidns and syndie, with links on the top nav
* Have I2PTunnelHTTPClient and I2PTunnelHTTPServer use the x-i2p-gzip
content-encoding (if offered), reducing the payload size before it
reaches the streaming lib. The existing compression is at the i2cp
level, so we've been packetizing 4KB of uncompressed data and then
compressing those messages, rather than compressing and then packetizing
4KB of compressed data. This should reduce the number of round trips
to fetch web pages substantially.
* Adjust the startup and timing of the addressbook so that susidns always
has config to work off, and expose a method for susidns to tell it to
reload its config and rerun.
2005-09-15 jrandom 2005-09-15 jrandom
* Error handling for failed intro packets (thanks red.hand!) * Error handling for failed intro packets (thanks red.hand!)

View File

@ -0,0 +1,20 @@
<launch4jConfig>
<headerType>0</headerType>
<jar>../install.jar</jar>
<outfile>../i2pinstall.exe</outfile>
<errTitle>I2P Installer</errTitle>
<chdir>.</chdir>
<customProcName>false</customProcName>
<!--<icon>SimpleApp.ico</icon>-->
<jre>
<minVersion>1.4.0</minVersion>
</jre>
<!--
<splash>
<file>splash.bmp</file>
<waitForWindow>true</waitForWindow>
<timeout>60</timeout>
<timeoutErr>true</timeoutErr>
</splash>
-->
</launch4jConfig>

View File

@ -0,0 +1,23 @@
<launch4jConfig>
<headerType>0</headerType>
<jar>../build/launchi2p.jar</jar>
<outfile>../i2p.exe</outfile>
<errTitle>I2P</errTitle>
<chdir>.</chdir>
<customProcName>false</customProcName>
<icon>resources/start.ico</icon>
<jre>
<minVersion>1.4.0</minVersion>
<!--
<minHeapSize>64</minHeapSize>
<maxHeapSize>64</maxHeapSize>
-->
<args>-Djava.library.path=. -DloggerFilenameOverride=logs/log-router-@.txt -Dorg.mortbay.http.Version.paranoid=true -Dorg.mortbay.util.FileResource.checkAliases=false</args>
</jre>
<splash>
<file>resources/i2plogo.bmp</file>
<waitForWindow>false</waitForWindow>
<timeout>10</timeout>
<timeoutErr>false</timeoutErr>
</splash>
</launch4jConfig>

View File

@ -4,7 +4,7 @@
<info> <info>
<appname>i2p</appname> <appname>i2p</appname>
<appversion>0.6.0.4</appversion> <appversion>0.6.0.5</appversion>
<authors> <authors>
<author name="I2P" email="support@i2p.net"/> <author name="I2P" email="support@i2p.net"/>
</authors> </authors>

View File

@ -64,6 +64,7 @@ rm -rf ./icons
rm -rf ./lib/wrapper rm -rf ./lib/wrapper
rm -f ./lib/*.dll rm -f ./lib/*.dll
rm -f ./*.bat rm -f ./*.bat
rm -f ./*.exe
./i2prouter start ./i2prouter start
exit 0 exit 0

View File

@ -0,0 +1,6 @@
export CP=. ; for j in lib/* ; do export CP=$CP:$j ; done;
JAVA=java
JAVAOPTS="-Djava.library.path=.:lib -DloggerFilenameOverride=logs/log-router-@.txt"
nohup $JAVA -cp $CP $JAVAOPTS net.i2p.router.RouterLaunch > /dev/null 2>&1 &
echo $! > router.pid

View File

@ -0,0 +1,14 @@
package net.i2p.router;
import java.io.*;
public class RouterLaunch {
public static void main(String args[]) {
try {
System.setOut(new PrintStream(new FileOutputStream("wrapper.log")));
} catch (IOException ioe) {
ioe.printStackTrace();
}
Router.main(args);
}
}

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
* *
*/ */
public class RouterVersion { public class RouterVersion {
public final static String ID = "$Revision: 1.235 $ $Date: 2005/09/13 18:02:40 $"; public final static String ID = "$Revision: 1.236 $ $Date: 2005/09/15 00:39:31 $";
public final static String VERSION = "0.6.0.5"; public final static String VERSION = "0.6.0.5";
public final static long BUILD = 10; public final static long BUILD = 11;
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);

View File

@ -33,7 +33,7 @@ class PeerTestState {
public synchronized long getNonce() { return _testNonce; } public synchronized long getNonce() { return _testNonce; }
public synchronized void setNonce(long nonce) { _testNonce = nonce; } public synchronized void setNonce(long nonce) { _testNonce = nonce; }
/** who are we? Alice, bob, or charlie? */ /** Are we Alice, bob, or Charlie. */
public synchronized short getOurRole() { return _ourRole; } public synchronized short getOurRole() { return _ourRole; }
public synchronized void setOurRole(short role) { _ourRole = role; } public synchronized void setOurRole(short role) { _ourRole = role; }
/** /**