forked from I2P_Developers/i2p.i2p
Update:
- Stub out support for clearnet su3 updating - PartialEepGet and SSLEepGet tweaks to support clearnet update - Remove proxy, key, and url config from /configupdate - More URI checks in UpdateRunner - Add su3 mime type - Move advanced setting to HelperBase
This commit is contained in:
@ -11,6 +11,9 @@ import net.i2p.I2PAppContext;
|
||||
* Fetch exactly the first 'size' bytes into a stream
|
||||
* Anything less or more will throw an IOException
|
||||
* No retries, no min and max size options, no timeout option
|
||||
* If the server does not return a Content-Length header of the correct size,
|
||||
* the fetch will fail.
|
||||
*
|
||||
* Useful for checking .sud versions
|
||||
*
|
||||
* @since 0.7.12
|
||||
@ -19,7 +22,13 @@ import net.i2p.I2PAppContext;
|
||||
public class PartialEepGet extends EepGet {
|
||||
long _fetchSize;
|
||||
|
||||
/** @param size fetch exactly this many bytes */
|
||||
/**
|
||||
* Instantiate an EepGet that will fetch exactly size bytes when fetch() is called.
|
||||
*
|
||||
* @param proxyHost use null or "" for no proxy
|
||||
* @param proxyPort use 0 for no proxy
|
||||
* @param size fetch exactly this many bytes
|
||||
*/
|
||||
public PartialEepGet(I2PAppContext ctx, String proxyHost, int proxyPort,
|
||||
OutputStream outputStream, String url, long size) {
|
||||
// we're using this constructor:
|
||||
@ -88,7 +97,8 @@ public class PartialEepGet extends EepGet {
|
||||
}
|
||||
|
||||
private static void usage() {
|
||||
System.err.println("PartialEepGet [-p 127.0.0.1:4444] [-l #bytes] url");
|
||||
System.err.println("PartialEepGet [-p 127.0.0.1:4444] [-l #bytes] url\n" +
|
||||
" (use -p :0 for no proxy)");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -103,9 +103,39 @@ public class SSLEepGet extends EepGet {
|
||||
* @since 0.8.2
|
||||
*/
|
||||
public SSLEepGet(I2PAppContext ctx, OutputStream outputStream, String url, SSLState state) {
|
||||
this(ctx, null, outputStream, url, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* A new SSLEepGet with a new SSLState
|
||||
* @since 0.9.9
|
||||
*/
|
||||
public SSLEepGet(I2PAppContext ctx, String outputFile, String url) {
|
||||
this(ctx, outputFile, url, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param state an SSLState retrieved from a previous SSLEepGet with getSSLState(), or null.
|
||||
* This makes repeated fetches from the same host MUCH faster,
|
||||
* and prevents repeated key store loads even for different hosts.
|
||||
* @since 0.9.9
|
||||
*/
|
||||
public SSLEepGet(I2PAppContext ctx, String outputFile, String url, SSLState state) {
|
||||
this(ctx, outputFile, null, url, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* outputFile, outputStream: One null, one non-null
|
||||
*
|
||||
* @param state an SSLState retrieved from a previous SSLEepGet with getSSLState(), or null.
|
||||
* This makes repeated fetches from the same host MUCH faster,
|
||||
* and prevents repeated key store loads even for different hosts.
|
||||
* @since 0.9.9
|
||||
*/
|
||||
private SSLEepGet(I2PAppContext ctx, String outputFile, OutputStream outputStream, String url, SSLState state) {
|
||||
// we're using this constructor:
|
||||
// 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) {
|
||||
super(ctx, false, null, -1, 0, -1, -1, null, outputStream, url, true, null, null);
|
||||
super(ctx, false, null, -1, 0, -1, -1, outputFile, outputStream, url, true, null, null);
|
||||
if (state != null && state.context != null)
|
||||
_sslContext = state.context;
|
||||
else
|
||||
|
Reference in New Issue
Block a user