/** * @since 0.9.31 */ public boolean getUniversalTheming() { return _context.getBooleanProperty(RC_PROP_UNIVERSAL_THEMING); }
if (_context.getBooleanProperty(PROP_DISABLE_ADJUSTMENT)) { getLog().error("Clock adjustment disabled", new Exception()); } else { log.info("Initializing clock offset to " + offsetMs + "ms, Stratum " + stratum); _alreadyChanged = true; if (_context.getBooleanProperty(PROP_DISABLE_ADJUSTMENT)) { log.error("Clock adjustment disabled", new Exception()); } else {
/** @since 0.9.12 */ public boolean isAdvanced() { return _context.getBooleanProperty(PROP_ADVANCED); }
public boolean allowJS() { return !_context.getBooleanProperty(PROP_JS_DISABLED); }
public boolean allowCSS() { return !_context.getBooleanProperty(PROP_CSS_DISABLED); }
/** @since 0.8.2 */ static boolean canSetPerms() { if (!oneDotSix) return false; I2PAppContext ctx = I2PAppContext.getCurrentContext(); if (ctx == null) return true; return !ctx.getBooleanProperty("i2p.insecureFiles"); }
/** * Save memory by not creating stats unless they are required for router operation. * For backward compatibility of any external clients, always returns false if not in router context. * * @param statName ignored * @return true if the stat should be ignored. */ public boolean ignoreStat(String statName) { return _context.isRouterContext() && !_context.getBooleanProperty(PROP_STAT_FULL); }
private static void debugInit(I2PAppContext ctx) { if (!ctx.getBooleanProperty(PROP_PCAP)) return; synchronized(_pcapInitLock) { if (!_pcapInitialized) { try { pcapWriter = new PcapWriter(ctx, PCAP_FILE); } catch (java.io.IOException ioe) { System.err.println("pcap init ioe: " + ioe); } _pcapInitialized = true; } } } }
/** * Parse the config for anything we know about. * Also fill in the authorization properties if missing. */ private final Properties loadConfig(Properties opts) { Properties options = new Properties(); options.putAll(filter(opts)); // auto-add auth if required, not set in the options, and we are not in the same JVM if ((!_context.isRouterContext()) && _context.getBooleanProperty("i2cp.auth") && ((!opts.containsKey(PROP_USER)) || (!opts.containsKey(PROP_PW)))) { String configUser = _context.getProperty(PROP_USER); String configPW = _context.getProperty(PROP_PW); if (configUser != null && configPW != null) { options.setProperty(PROP_USER, configUser); options.setProperty(PROP_PW, configPW); } } if (options.getProperty(I2PClient.PROP_FAST_RECEIVE) == null) options.setProperty(I2PClient.PROP_FAST_RECEIVE, "true"); if (options.getProperty(I2PClient.PROP_RELIABILITY) == null) options.setProperty(I2PClient.PROP_RELIABILITY, "none"); return options; }
if (I2PAppContext.getGlobalContext().getBooleanProperty("i2np.allowLocal")) return true; if (addr.length == 4) {
int tunnelQuantity = mode == 2 ? getTunnelQuantityOut(tunnel, DFLT_QUANTITY) : getTunnelQuantity(tunnel, DFLT_QUANTITY); boolean advanced = _context.getBooleanProperty(PROP_ADVANCED); int maxQuantity = advanced ? MAX_ADVANCED_QUANTITY : (isClient(tunnel) ? MAX_CLIENT_QUANTITY : MAX_SERVER_QUANTITY);
return "Error - tunnels are not initialized yet"; if (!_context.getBooleanProperty(PROP_PW_ENABLE) && !haveNonce(_curNonce)) return _t("Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.")
sb.append("<li>").append(_t("Downstream")).append(": ") .append(toLong("GetCommonLinkProperties", "NewLayer1DownstreamMaxBitRate", serv)).append("bps"); if (_context.getBooleanProperty(PROP_ADVANCED)) { sb.append(DataHelper.escapeHTML(type)).append("<ul>"); if (_context.getBooleanProperty(PROP_ADVANCED)) { sb.append("<li>Actions"); listActions(serv, sb);
if (ctx.getBooleanProperty(PROP_DISABLE) || host.equals("localhost") || host.equals("127.0.0.1") ||
boolean useKeytool = I2PAppContext.getGlobalContext().getBooleanProperty("crypto.useExternalKeytool"); if (useKeytool) { if (altNames != null)
/** * Yes, the EepGet fetch() is done in here in next(). * * see java.util.Iterator#next() * @return non-null AddressBook (empty if the minimum delay has not been met, * or there is no proxy tunnel, or the fetch otherwise fails) */ public AddressBook next() { Subscription sub = this.subIterator.next(); if (sub.getLocation().startsWith("file:")) { // test only return new AddressBook(sub.getLocation().substring(5)); } else if (sub.getLastFetched() + this.delay < I2PAppContext.getGlobalContext().clock().now() && I2PAppContext.getGlobalContext().portMapper().getPort(PortMapper.SVC_HTTP_PROXY) >= 0 && !I2PAppContext.getGlobalContext().getBooleanProperty("i2p.vmCommSystem")) { //System.err.println("Fetching addressbook from " + sub.getLocation()); return new AddressBook(sub, this.proxyHost, this.proxyPort); } else { //System.err.println("Addressbook " + sub.getLocation() + " was last fetched " + // DataHelper.formatDuration(I2PAppContext.getGlobalContext().clock().now() - sub.getLastFetched()) + // " ago but the minimum delay is " + // DataHelper.formatDuration(this.delay)); return new AddressBook(Collections.<String, HostTxtEntry>emptyMap()); } }
((!context.isRouterContext()) && (!context.getBooleanProperty(PROP_FORCE))); raf = new RAIFile(f, true, !readOnly); bf = initExisting(raf);
/** * We found a non-SYN packet that was queued in the syn queue, * check to see if it has a home now, else drop it ... */ private void reReceivePacket(Packet packet) { Connection con = _manager.getConnectionByOutboundId(packet.getReceiveStreamId()); if (con != null) { // Send it through the packet handler again if (_log.shouldLog(Log.WARN)) _log.warn("Found con for queued non-syn packet: " + packet); // false -> don't requeue, fixes a race where a SYN gets dropped // between here and PacketHandler, causing the packet to loop forever.... _manager.getPacketHandler().receivePacketDirect(packet, false); } else { // log it here, just before we kill it - dest will be unknown if (I2PSocketManagerFull.pcapWriter != null && _context.getBooleanProperty(I2PSocketManagerFull.PROP_PCAP)) packet.logTCPDump(null); // goodbye if (_log.shouldLog(Log.WARN)) _log.warn("Did not find con for queued non-syn packet, dropping: " + packet); packet.releasePayload(); } }
private void receiveKnownCon(Connection con, Packet packet) { _context.getBooleanProperty(I2PSocketManagerFull.PROP_PCAP)) packet.logTCPDump(con); if (packet.isFlagSet(Packet.FLAG_ECHO)) {
_context.getBooleanProperty(I2PSocketManagerFull.PROP_PCAP)) packet.logTCPDump(null);