diff --git a/apps/routerconsole/java/src/com/vuze/plugins/mlab/MLabRunner.java b/apps/routerconsole/java/src/com/vuze/plugins/mlab/MLabRunner.java index dabe31188307564e3fc9b7c7b8a788e3be90dc75..85abaa9bc40b80682fe40ef6d962289b102f49a1 100644 --- a/apps/routerconsole/java/src/com/vuze/plugins/mlab/MLabRunner.java +++ b/apps/routerconsole/java/src/com/vuze/plugins/mlab/MLabRunner.java @@ -38,6 +38,7 @@ import net.minidev.json.parser.ParseException; import net.i2p.I2PAppContext; import net.i2p.data.DataHelper; import net.i2p.util.EepGet; +import net.i2p.util.SSLEepGet; import net.i2p.util.I2PAppThread; import net.i2p.util.Log; @@ -49,9 +50,9 @@ import net.i2p.util.Log; public class MLabRunner { // ns.measurementlab.net does not support https // use ndt_ssl for test over ssl? but Tcpbw100 doesn't support it - private static final String NS_URL = "http://ns.measurementlab.net/ndt?format=json"; + //private static final String NS_URL = "http://ns.measurementlab.net/ndt?format=json"; + private static final String NS_URL_SSL = "https://mlab-ns.appspot.com/ndt?format=json"; private static final long NS_TIMEOUT = 20*1000; - private boolean test_active; private final I2PAppContext _context; private final Log _log; private final AtomicBoolean _running = new AtomicBoolean(); @@ -119,9 +120,10 @@ public class MLabRunner { // public EepGet(I2PAppContext ctx, boolean shouldProxy, String proxyHost, int proxyPort, // int numRetries, long minSize, long maxSize, String outputFile, OutputStream outputStream, // String url, boolean allowCaching, String etag, String postData) { - EepGet eepget = new EepGet(_context, false, null, 0, - 0, 2, 1024, null, baos, - NS_URL, false, null, null); + //EepGet eepget = new EepGet(_context, false, null, 0, + // 0, 2, 1024, null, baos, + // NS_URL, false, null, null); + EepGet eepget = new SSLEepGet(_context, baos, NS_URL_SSL); boolean ok = eepget.fetch(NS_TIMEOUT, NS_TIMEOUT, NS_TIMEOUT); if (!ok) throw new IOException("ns fetch failed"); diff --git a/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/JTextArea.java b/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/JTextArea.java index 6fa84e91c4d2b74e2cb09fcceb0b64cdbdce5b79..8c5f141e8383a1cfd88abee8baff401c16c9b0ab 100644 --- a/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/JTextArea.java +++ b/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/JTextArea.java @@ -33,7 +33,7 @@ JTextArea extends Component { private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(Tcpbw100.class); - private String text = ""; + private final StringBuilder text = new StringBuilder(); public JTextArea( @@ -41,7 +41,7 @@ JTextArea int a, int b ) { - text = str; + text.append(str); } public void @@ -50,13 +50,13 @@ JTextArea { if (_log.shouldWarn()) _log.warn(str.trim()); - text += str; + text.append(str); } public String getText() { - return( text ); + return text.toString(); } public void diff --git a/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/StyledDocument.java b/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/StyledDocument.java index 846bacf631af051732336cddedb7023a2bde2f2b..d3a21bad23cb9fff412206f94724ad241ac7e2b4 100644 --- a/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/StyledDocument.java +++ b/apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/StyledDocument.java @@ -32,12 +32,12 @@ public class StyledDocument { private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(Tcpbw100.class); - public String str = ""; + private final StringBuilder text = new StringBuilder(); public int getLength() { - return( str.length()); + return text.length(); } public void @@ -50,6 +50,6 @@ StyledDocument { if (_log.shouldWarn()) _log.warn(s.trim()); - str += s; + text.append(s); } }