Changeset 6caa1c3


Ignore:
Timestamp:
Dec 11, 2011 5:22:28 PM (9 years ago)
Author:
sponge <sponge@…>
Branches:
master
Children:
032b7d8
Parents:
929d471
Message:

HTTP server tunnel, use log.WARN for 3 first minutes. (closes #460)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java

    r929d471 r6caa1c3  
    4747    private static final String[] SERVER_SKIPHEADERS = {SERVER_HEADER};
    4848    private static final long HEADER_TIMEOUT = 60*1000;
     49    private static final long START_INTERVAL = (60 * 1000) * 3;
     50    private long _startedOn = 0L;
    4951
    5052    private final static byte[] ERR_UNAVAILABLE =
     
    8183        getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000 });
    8284    }
     85
     86    @Override
     87    public void startRunning() {
     88        super.startRunning();
     89        _startedOn = getTunnel().getContext().clock().now();
     90        // Would be better if this was set when the inbound tunnel becomes alive.
     91    }
     92
    8393
    8494    /**
     
    169179                socket.close();
    170180            } catch (IOException ioe) {}
    171             if (_log.shouldLog(Log.ERROR))
    172                 _log.error("Error connecting to HTTP server " + remoteHost + ':' + remotePort, ex);
     181            // Don't complain too early, Jetty may not be ready.
     182            int level = getTunnel().getContext().clock().now() - _startedOn > START_INTERVAL ? Log.ERROR : Log.WARN;
     183            if (_log.shouldLog(level))
     184                _log.log(level, "Error connecting to HTTP server " + remoteHost + ':' + remotePort, ex);
    173185        } catch (IOException ex) {
    174186            try {
  • history.txt

    r929d471 r6caa1c3  
     12011-12-11 sponge
     2  * HTTP server tunnel, use log.WARN for 3 first minutes. (closes #460)
     3
    142011-12-10 kytv
    25  * Replace eepget's whitelist of accepted characters with the
Note: See TracChangeset for help on using the changeset viewer.