propagate from branch 'i2p.i2p' (head 3d9f6d9555224cc3277ca10fd9409c83422758eb)

to branch 'i2p.i2p.zzz.jetty6' (head 0212d710e5a4eb30249201015f045d43f44650cb)
This commit is contained in:
zzz
2012-02-29 14:37:02 +00:00
38 changed files with 6014 additions and 5195 deletions

View File

@ -60,6 +60,14 @@ public abstract class I2PTunnelTask extends EventDispatcherImpl {
public abstract boolean close(boolean forced);
/**
* For tasks that don't call I2PTunnel.addSession() directly
* @since 0.8.13
*/
public void connected(I2PSession session) {
getTunnel().addSession(session);
}
public void disconnected(I2PSession session) {
routerDisconnected();
getTunnel().removeSession(session);

View File

@ -107,6 +107,7 @@ import net.i2p.util.Log;
try {
ByteArrayInputStream in = new ByteArrayInputStream(key);
_session = client.createSession(in, tunnel.getClientOptions());
connected(_session);
} catch(Exception exc) {
throw new RuntimeException("failed to create session", exc);
}

View File

@ -103,6 +103,7 @@ public class I2PTunnelUDPServerBase extends I2PTunnelTask implements Source, Sin
try {
_session = client.createSession(privData, getTunnel().getClientOptions());
connected(_session);
} catch(I2PSessionException exc) {
throw new RuntimeException("failed to create session", exc);
}

View File

@ -342,7 +342,8 @@ public class IndexBean {
String pk = cur.getPrivKeyFile();
if (pk == null)
pk = _privKeyFile;
if (pk != null && pk.startsWith("i2ptunnel") && pk.endsWith("-privKeys.dat")) {
if (pk != null && pk.startsWith("i2ptunnel") && pk.endsWith("-privKeys.dat") &&
((!isClient(cur.getType())) || cur.getPersistentClientKey())) {
File pkf = new File(_context.getConfigDir(), pk);
if (pkf.exists()) {
String name = cur.getName();

View File

@ -1,25 +0,0 @@
package net.i2p.i2ptunnel.web;
/**
* A temporary data holder for the wizard pages
*
* Warning - This class is not part of the i2ptunnel API, and at some point
* it will be moved from the jar to the war.
* Usage by classes outside of i2ptunnel.war is deprecated.
*/
public class WizardBean extends EditBean {
private boolean _isClient;
public WizardBean() { super(); }
/**
* Whether the tunnel being set up is a client tunnel or not.
* @since 0.8.13
*/
public void setIsClient(String isClient) {
_isClient = Boolean.valueOf(isClient);
}
/** @since 0.8.13 */
public boolean getIsClient() {
return _isClient;
}
}