propagate from branch 'i2p.i2p.zzz.test2' (head 6ccd9ca652057494bb2857e87636f18aadcd33f3)

to branch 'i2p.i2p' (head 376f751adc13923cdbf4f659c3f23ca957cf47b3)
This commit is contained in:
zzz
2014-09-23 13:06:36 +00:00
197 changed files with 4617 additions and 1989 deletions

View File

@@ -40,6 +40,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.lang.reflect.Constructor;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
@@ -256,7 +257,15 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
}
if (gui) {
new I2PTunnelGUI(this);
// removed from source, now in i2p.scripts
//new I2PTunnelGUI(this);
try {
Class<?> cls = Class.forName("net.i2p.i2ptunnel.I2PTunnelGUI");
Constructor<?> con = cls.getConstructor(I2PTunnel.class);
con.newInstance(this);
} catch (Throwable t) {
throw new UnsupportedOperationException("GUI is not available, try -cli", t);
}
} else if (cli) {
try {
System.out.println("Enter 'help' for help.");

View File

@@ -1,48 +0,0 @@
/* I2PTunnel is GPL'ed (with the exception mentioned in I2PTunnel.java)
* (c) 2003 - 2004 mihi
*/
package net.i2p.i2ptunnel;
import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.Frame;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* AWT gui since kaffe doesn't support swing yet
*/
public class I2PTunnelGUI extends Frame implements ActionListener, Logging {
TextField input;
TextArea log;
I2PTunnel t;
public I2PTunnelGUI(I2PTunnel t) {
super("I2PTunnel control panel");
this.t = t;
setLayout(new BorderLayout());
add("South", input = new TextField());
input.addActionListener(this);
Font font = new Font("Monospaced", Font.PLAIN, 12);
add("Center", log = new TextArea("", 20, 80, TextArea.SCROLLBARS_VERTICAL_ONLY));
log.setFont(font);
log.setEditable(false);
log("enter 'help' for help.");
pack();
setVisible(true);
}
public void log(String s) {
log.append(s + "\n");
}
public void actionPerformed(ActionEvent evt) {
log("I2PTunnel>" + input.getText());
t.runCommand(input.getText(), this);
log("---");
input.setText("");
}
}

View File

@@ -601,9 +601,12 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
return;
int status = ise != null ? ise.getStatus() : -1;
String error;
//TODO MessageStatusMessage.STATUS_SEND_FAILURE_UNSUPPORTED_ENCRYPTION
if (status == MessageStatusMessage.STATUS_SEND_FAILURE_NO_LEASESET) {
// We won't get this one unless it is treated as a hard failure
// in streaming. See PacketQueue.java
error = usingWWWProxy ? "nolsp" : "nols";
} else if (status == MessageStatusMessage.STATUS_SEND_FAILURE_UNSUPPORTED_ENCRYPTION) {
error = usingWWWProxy ? "encp" : "enc";
} else {
error = usingWWWProxy ? "dnfp" : "dnf";
}

View File

@@ -188,8 +188,7 @@ public class EditBean extends IndexBean {
/** @since 0.9.12 */
public boolean isSigTypeAvailable(int code) {
SigType type = SigType.getByCode(code);
return type != null && type.isAvailable();
return SigType.isAvailable(code);
}
/** @since 0.8.9 */