forked from I2P_Developers/i2p.i2p
MLab: Switch to name server that supports SSL
swingemu cleanups
This commit is contained in:
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user