Changeset bdcad06


Ignore:
Timestamp:
Aug 8, 2009 2:29:18 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3dd3bf8
Parents:
2436ea11
Message:

EepHead?

Location:
core/java/src/net/i2p/util
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/EepGet.java

    r2436ea11 rbdcad06  
    2424 *        [-m markSize lineLen]
    2525 *        url
     26 *
     27 * Bug: a malformed url http://example.i2p (no trailing '/') fails cryptically
    2628 */
    2729public class EepGet {
    2830    private I2PAppContext _context;
    29     private Log _log;
    30     private boolean _shouldProxy;
     31    protected Log _log;
     32    protected boolean _shouldProxy;
    3133    private String _proxyHost;
    3234    private int _proxyPort;
    33     private int _numRetries;
     35    protected int _numRetries;
    3436    private long _minSize; // minimum and maximum acceptable response size, -1 signifies unlimited,
    3537    private long _maxSize; // applied both against whole responses and chunks
     
    3739    private OutputStream _outputStream;
    3840    /** url we were asked to fetch */
    39     private String _url;
     41    protected String _url;
    4042    /** the URL we actually fetch from (may differ from the _url in case of redirect) */
    41     private String _actualURL;
     43    protected String _actualURL;
    4244    private String _postData;
    4345    private boolean _allowCaching;
    44     private List _listeners;
     46    protected List _listeners;
    4547   
    4648    private boolean _keepFetching;
     
    4850    private OutputStream _proxyOut;
    4951    private InputStream _proxyIn;
    50     private OutputStream _out;
     52    protected OutputStream _out;
    5153    private long _alreadyTransferred;
    5254    private long _bytesTransferred;
    53     private long _bytesRemaining;
    54     private int _currentAttempt;
     55    protected long _bytesRemaining;
     56    protected int _currentAttempt;
    5557    private String _etag;
    5658    private String _lastModified;
     
    5860    private boolean _notModified;
    5961    private String _contentType;
    60     private boolean _transferFailed;
    61     private boolean _headersRead;
    62     private boolean _aborted;
     62    protected boolean _transferFailed;
     63    protected boolean _headersRead;
     64    protected boolean _aborted;
    6365    private long _fetchHeaderTimeout;
    6466    private long _fetchEndTime;
    65     private long _fetchInactivityTimeout;
    66     private int _redirects;
    67     private String _redirectLocation;
     67    protected long _fetchInactivityTimeout;
     68    protected int _redirects;
     69    protected String _redirectLocation;
    6870   
    6971    public EepGet(I2PAppContext ctx, String proxyHost, int proxyPort, int numRetries, String outputFile, String url) {
     
    215217    }
    216218   
    217     private static void usage() {
     219    protected static void usage() {
    218220        System.err.println("EepGet [-p 127.0.0.1:4444] [-n #retries] [-o outputFile] [-m markSize lineLen] [-t timeout] url");
    219221    }
     
    481483
    482484    /** return true if the URL was completely retrieved */
    483     private void doFetch(SocketTimeout timeout) throws IOException {
     485    protected void doFetch(SocketTimeout timeout) throws IOException {
    484486        _headersRead = false;
    485487        _aborted = false;
     
    626628    }
    627629
    628     private void readHeaders() throws IOException {
     630    protected void readHeaders() throws IOException {
    629631        String key = null;
    630632        StringBuilder buf = new StringBuilder(32);
     
    845847    private boolean isNL(byte b) { return (b == NL); }
    846848
    847     private void sendRequest(SocketTimeout timeout) throws IOException {
     849    protected void sendRequest(SocketTimeout timeout) throws IOException {
    848850        if (_outputStream != null) {
    849851            // We are reading into a stream supplied by a caller,
     
    893895    }
    894896   
    895     private String getRequest() throws IOException {
     897    protected String getRequest() throws IOException {
    896898        StringBuilder buf = new StringBuilder(512);
    897899        boolean post = false;
     
    964966        return _contentType;
    965967    }
    966 
    967968}
Note: See TracChangeset for help on using the changeset viewer.