Changeset 135f8c1


Ignore:
Timestamp:
Jul 11, 2009 10:32:29 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
429bd0a
Parents:
7b7a590e (diff), 1a247d8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '565f0421784f8f71177ebf0bd682750f98bce67b'

and 'e9067362adb090ff1e3d8ae327fb313ded00e9c6'

Files:
22 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r7b7a590e r135f8c1  
    513513                String name = (String)entry.getKey();
    514514                String baseURL = (String)entry.getValue();
    515                 if (!baseURL.startsWith(announce))
     515                if (!(baseURL.startsWith(announce) || // vvv hack for non-b64 announce in list vvv
     516                      (announce.startsWith("http://lnQ6yoBT") && baseURL.startsWith("http://tracker2.postman.i2p/"))))
    516517                    continue;
    517518                int e = baseURL.indexOf('=');
  • apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java

    r7b7a590e r135f8c1  
    1010    public static final String PROP_THEME_NAME = "routerconsole.theme";
    1111    private static final String BASE = "/themes/console/";
     12    private static final String FORCE = "classic";
    1213
    13     public String getTheme() {
     14    public String getTheme(String userAgent) {
    1415        String url = BASE;
    15         String theme = _context.getProperty(PROP_THEME_NAME);
    16         if (theme != null)
    17             url += theme + "/";
     16        if (userAgent != null && userAgent.contains("MSIE")) {
     17            url += FORCE + "/";
     18        } else {
     19            String theme = _context.getProperty(PROP_THEME_NAME);
     20            if (theme != null)
     21                url += theme + "/";
     22        }
    1823        return url;
    1924    }
  • apps/routerconsole/jsp/css.jsp

    r7b7a590e r135f8c1  
    1818<jsp:useBean class="net.i2p.router.web.CSSHelper" id="cssHelper" scope="request" />
    1919<jsp:setProperty name="cssHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    20 <link href="<%=cssHelper.getTheme()%>console.css" rel="stylesheet" type="text/css" />
     20<link href="<%=cssHelper.getTheme(request.getHeader("User-Agent"))%>console.css" rel="stylesheet" type="text/css" />
  • history.txt

    r7b7a590e r135f8c1  
    66                                     
    772009-07-07 dr|z3d
     82009-07-07  dr|z3d
     92009-07-11 zzz
     10    * Build Handler: Drop rather than reject requests when near
     11      conn limits and the next hop is not connected, to reduce
     12      connection congestion
     13    * Console: Force IE to the classic theme
     14    * I2PSnark:
     15      - Bring back details links for Postman2 B64 torrents
     16    * I2PTunnel:
     17      - Make reduce-on-idle the default for all the shared clients
     18        for new installs (15m)
     19    * Profile Organizer:
     20      - Allow NTCP-only peers in inbound tunnels
     21    * Transports:
     22      - Move from a single connection limit threshold (80%) to
     23        two (75% and 87%), and only start rejecting tunnels
     24        at the higher threshold, to increase build success
     25      - Move some limit methods from the transports to TransportImpl
     26      - Add limit methods with a threshold argument
     27      - Increase default SSU conn limits a little more
     28
     292009-07-07  dr|z3d
    830    * Introducing 2 new console themes (light & dark), in addition
    931      to changes to the console navigation; navbar now resides in
  • installer/resources/i2ptunnel.config

    r7b7a590e r135f8c1  
    1111tunnel.0.option.inbound.nickname=shared clients
    1212tunnel.0.option.outbound.nickname=shared clients
     13tunnel.0.option.i2cp.reduceIdleTime=900000
     14tunnel.0.option.i2cp.reduceOnIdle=true
     15tunnel.0.option.i2cp.reduceQuantity=1
    1316tunnel.0.option.i2p.streaming.connectDelay=1000
    1417tunnel.0.startOnLoad=true
     
    2629tunnel.1.option.inbound.nickname=shared clients
    2730tunnel.1.option.outbound.nickname=shared clients
     31tunnel.1.option.i2cp.reduceIdleTime=900000
     32tunnel.1.option.i2cp.reduceOnIdle=true
     33tunnel.1.option.i2cp.reduceQuantity=1
    2834tunnel.1.option.i2p.streaming.connectDelay=1000
    2935tunnel.1.option.i2p.streaming.maxWindowSize=16
     
    4248tunnel.2.option.inbound.nickname=shared clients
    4349tunnel.2.option.outbound.nickname=shared clients
     50tunnel.2.option.i2cp.reduceIdleTime=900000
     51tunnel.2.option.i2cp.reduceOnIdle=true
     52tunnel.2.option.i2cp.reduceQuantity=1
    4453tunnel.2.startOnLoad=false
    4554
     
    7180tunnel.4.option.inbound.nickname=shared clients
    7281tunnel.4.option.outbound.nickname=shared clients
     82tunnel.4.option.i2cp.reduceIdleTime=900000
     83tunnel.4.option.i2cp.reduceOnIdle=true
     84tunnel.4.option.i2cp.reduceQuantity=1
    7385tunnel.4.option.i2p.streaming.connectDelay=1000
    7486tunnel.4.startOnLoad=true
     
    8698tunnel.5.option.inbound.nickname=shared clients
    8799tunnel.5.option.outbound.nickname=shared clients
     100tunnel.5.option.i2cp.reduceIdleTime=900000
     101tunnel.5.option.i2cp.reduceOnIdle=true
     102tunnel.5.option.i2cp.reduceQuantity=1
    88103tunnel.5.option.i2p.streaming.connectDelay=1000
    89104tunnel.5.startOnLoad=true
  • readme.html

    r7b7a590e r135f8c1  
    7676<a href="http://forum.i2p2.de/">I2P discussion forum</a>, or swing by #i2p or
    7777#i2p-chat on IRC at <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>, irc.postman.i2p or irc.freshcoffee.i2p (they're linked together).</p>
    78 
    79 <p><b>As a note, you can change this page by editing the file "docs/readme.html"</b></p>
    8078</div>
  • readme_de.html

    r7b7a590e r135f8c1  
    7373  <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>, irc.postman.i2p
    7474  oder irc.freshcoffee.i2p (die verbunden sind).</p>
    75 
    76 <p><b>&Uuml;brigens, diese Seite kannst Du &auml;ndern indem Du "docs/readme_de.html" editierst</b></p>
  • readme_fr.html

    r7b7a590e r135f8c1  
    3838
    3939<p>Soyez patient - i2p peut s'av&eacute;rer lent &agrave; d&eacute;marrer la premi&egrave;re fois car il recherche des pairs. Si, apr&egrave;s 30 minutes, votre Actives: connect&eacute;/r&eacute;cent compte moins de 10 pairs connect&eacute;s, vous devez ouvrir le port 8887 sur votre pare-feu pour avoir une meilleure connection. Si vous ne pouvez acc&eacute;der &agrave; aucun eepsite (m&ecirc;me <a href="http://www.i2p2.i2p/">www.i2p2.i2p</a>), soyez s&ucirc;r que votre navigateur utilise bien le proxy localhost sur le port 4444. Vous pouvez aussi faire part de votre d&eacute;marche sur le <a href="http://www.i2p2.i2p/">site web I2P</a>, poster des message sur le <a href="http://forum.i2p/">forum de discussion</a>, ou passer par #i2p ou #i2p-chat sur IRC sur le serveur <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>, irc.postman.i2p ou irc.freshcoffee.i2p (ils sont li&eacute;s).</p>
    40 
    41 <p><b>Comme vous pouvez le remarquer, il suffit d'&eacute;diter la page "docs/readme.html" pour changer la page d'acceuil</b></p>
  • readme_nl.html

    r7b7a590e r135f8c1  
    5757<a href="http://forum.i2p/">I2P discussie forum</a>, of kom langs bij #i2p of
    5858#i2p-chat op IRC bij de kanalen <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>, irc.postman.i2p of irc.freshcoffee.i2p (ze linken allemaal door naar elkaar).</p>
    59 
    60 <p><b>Als extra informatie, je kan deze pagina wijzigen door het bestand "docs/readme_nl.html" aan te passen.</b></p>
  • readme_sv.html

    r7b7a590e r135f8c1  
    9999href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>, irc.postman.i2p
    100100eller irc.freshcoffee.i2p (de &auml;r alla sammankopplade).</p>
    101 
    102 <p><b>Du kan f&ouml;r&auml;ndra denh&auml;r sidan genom att &auml;ndra i filen
    103 "docs/readme_sv.html"</b></p>
  • readme_zh.html

    r7b7a590e r135f8c1  
    2525
    2626<p>±£³ÖÄÍÐÄ - I2P µÚÒ»´ÎÆô¶¯Ê±ÐèÒªËÑË÷½Úµã£¬¿ÉÄܱȽϻºÂý¡£Èç¹û30·ÖÖÓºó£¬ÄúµÄ»î¶¯½Úµã(Active:ÒÑÁ¬½Ó/нüÁ¬½Ó) ¼ÆÊýÈÔÔÚ 10 ¸ö½ÚµãÒÔÏÂ, ÇëÔÚ·À»ðǽÖдò¿ª 8887 ¶Ë¿Ú¸ÄÉÆÁ¬½ÓÐÔÄÜ¡£Èç¹ûÄú¸ù±¾ÎÞ·¨´ò¿ªÈκÎEEPSITE(ÉõÖÁ <a href="http://www.i2p2.i2p/">www.i2p2.i2p</a>)£¬¼ì²éÄúµÄä¯ÀÀÆ÷´úÀíÉèÖÃÊÇ·ñΪ±¾µØµÄ localhost:4444¡£ÄãÒ²¿ÉÒԲ鿴 <a href="http://www.i2p2.i2p/">I2P ÍøÕ¾</a> ÉϵÄÐÅÏ¢, ÔÚ <a href="http://forum.i2p2.de/">I2P ÂÛ̳</a> Öз¢Ìû, À´ <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a> , irc.postman.i2p »ò irc.freshcoffee.i2p É쵀 #i2p »ò #i2p-chat Á½¸öIRCƵµÀ×ø×ø¡£ (ÕâЩ·þÎñÆ÷ÉϵÄÕâÁ½¸öƵµÀÊÇÏàͨµÄ)¡£</p>
    27 
    28 <p><B>Ìáʾ£¬Äú¿ÉÒÔͨ¹ý±à¼­ &quot;docs/readme_zh.html&quot; Ð޸ı¾Ò³Ãæ¡£</B></p>
  • router/java/src/net/i2p/router/CommSystemFacade.java

    r7b7a590e r135f8c1  
    3535    public int countActivePeers() { return 0; }
    3636    public int countActiveSendPeers() { return 0; }
    37     public boolean haveInboundCapacity() { return true; }
    38     public boolean haveOutboundCapacity() { return true; }
     37    public boolean haveInboundCapacity(int pct) { return true; }
     38    public boolean haveOutboundCapacity(int pct) { return true; }
    3939    public boolean haveHighOutboundCapacity() { return true; }
    4040    public List getMostRecentErrorMessages() { return Collections.EMPTY_LIST; }
  • router/java/src/net/i2p/router/networkdb/reseed/ReseedChecker.java

    r7b7a590e r135f8c1  
    1616 *  Also, as this is now called from PersistentDataStore, not from the
    1717 *  routerconsole, we can get started as soon as the netdb has read
    18  *  the netDb/ directory, not when the console starts,
    19 router/java/src/net/i2p/router/networkdb/eseed/ReseedChecker.java
     18 *  the netDb/ directory, not when the console starts.
    2019 */
    2120public class ReseedChecker {
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java

    r7b7a590e r135f8c1  
    542542                    else {
    543543                        RouterAddress ra = info.getTargetAddress("SSU");
    544                         // Definitely don't want peers with no SSU address at all
     544                        // peers with no SSU address at all are fine.
     545                        // as long as they have NTCP
    545546                        if (ra == null) {
    546                             l.add(peer);
     547                            if (info.getTargetAddress("NTCP") == null)
     548                                l.add(peer);
    547549                            continue;
    548550                        }
  • router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java

    r7b7a590e r135f8c1  
    7171    public int countActiveSendPeers() { return (_manager == null ? 0 : _manager.countActiveSendPeers()); }
    7272    @Override
    73     public boolean haveInboundCapacity() { return (_manager == null ? false : _manager.haveInboundCapacity()); }
    74     @Override
    75     public boolean haveOutboundCapacity() { return (_manager == null ? false : _manager.haveOutboundCapacity()); }
     73    public boolean haveInboundCapacity(int pct) { return (_manager == null ? false : _manager.haveInboundCapacity(pct)); }
     74    @Override
     75    public boolean haveOutboundCapacity(int pct) { return (_manager == null ? false : _manager.haveOutboundCapacity(pct)); }
    7676    @Override
    7777    public boolean haveHighOutboundCapacity() { return (_manager == null ? false : _manager.haveHighOutboundCapacity()); }
  • router/java/src/net/i2p/router/transport/Transport.java

    r7b7a590e r135f8c1  
    4545    public String getStyle();
    4646   
     47    public int countPeers();   
    4748    public int countActivePeers();   
    4849    public int countActiveSendPeers();
    4950    public boolean haveCapacity();
    50     public boolean haveHighCapacity();
     51    public boolean haveCapacity(int pct);
    5152    public Vector getClockSkews();
    5253    public List getMostRecentErrorMessages();
  • router/java/src/net/i2p/router/transport/TransportImpl.java

    r7b7a590e r135f8c1  
    7979
    8080    /**
    81      * How many peers can we talk to right now?
    82      *
     81     * How many peers are we connected to?
     82     * For NTCP, this is the same as active,
     83     * but SSU actually looks at idle time for countActivePeers()
     84     */
     85    public int countPeers() { return countActivePeers(); }
     86    /**
     87     * How many peers active in the last few minutes?
    8388     */
    8489    public int countActivePeers() { return 0; }
     
    109114        // increase limit for SSU, for now
    110115        if (style.equals("udp"))
    111             def = def * 4 / 3;
     116            def = def * 3 / 2;
    112117        return _context.getProperty("i2np." + style + ".maxConnections", def);
    113118    }
    114119
     120    private static final int DEFAULT_CAPACITY_PCT = 75;
    115121    /**
    116122     * Can we initiate or accept a connection to another peer, saving some margin
    117123     */
    118     public boolean haveCapacity() { return true; }
     124    public boolean haveCapacity() {
     125        return haveCapacity(DEFAULT_CAPACITY_PCT);
     126    }
     127
     128    /** @param pct are we under x% 0-100 */
     129    public boolean haveCapacity(int pct) {
     130        return countPeers() < getMaxConnections() * pct / 100;
     131    }
    119132
    120133    /**
  • router/java/src/net/i2p/router/transport/TransportManager.java

    r7b7a590e r135f8c1  
    207207      * Is at least one transport below its outbound connection limit + some margin
    208208      * Use for throttling in the router.
     209      *
     210      * @param pct percent of limit 0-100
    209211      */
    210     public boolean haveOutboundCapacity() {
    211         for (int i = 0; i < _transports.size(); i++) {
    212             if (((Transport)_transports.get(i)).haveCapacity())
     212    public boolean haveOutboundCapacity(int pct) {
     213        for (int i = 0; i < _transports.size(); i++) {
     214            if (((Transport)_transports.get(i)).haveCapacity(pct))
    213215                return true;
    214216        }
     
    216218    }
    217219   
     220    private static final int HIGH_CAPACITY_PCT = 50;
    218221    /**
    219222      * Are all transports well below their outbound connection limit
     
    224227            return false;
    225228        for (int i = 0; i < _transports.size(); i++) {
    226             if (!((Transport)_transports.get(i)).haveHighCapacity())
     229            if (!((Transport)_transports.get(i)).haveCapacity(HIGH_CAPACITY_PCT))
    227230                return false;
    228231        }
     
    233236      * Is at least one transport below its inbound connection limit + some margin
    234237      * Use for throttling in the router.
     238      *
     239      * @param pct percent of limit 0-100
    235240      */
    236     public boolean haveInboundCapacity() {
    237         for (int i = 0; i < _transports.size(); i++) {
    238             if (_transports.get(i).getCurrentAddress() != null && _transports.get(i).haveCapacity())
     241    public boolean haveInboundCapacity(int pct) {
     242        for (int i = 0; i < _transports.size(); i++) {
     243            if (_transports.get(i).getCurrentAddress() != null && _transports.get(i).haveCapacity(pct))
    239244                return true;
    240245        }
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    r7b7a590e r135f8c1  
    322322    }
    323323
    324     @Override
    325     public boolean haveCapacity() {
    326         return countActivePeers() < getMaxConnections() * 4 / 5;
    327     }
    328 
    329     public boolean haveHighCapacity() {
    330         return countActivePeers() < getMaxConnections() / 2;
    331     }
    332 
    333324    /** queue up afterSend call, which can take some time w/ jobs, etc */
    334325    void sendComplete(OutNetMessage msg) { _finisher.add(msg); }
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r7b7a590e r135f8c1  
    13361336
    13371337    @Override
     1338    public int countPeers() {
     1339        synchronized (_peersByIdent) {
     1340            return _peersByIdent.size();
     1341        }
     1342    }
     1343
     1344    @Override
    13381345    public int countActivePeers() {
    13391346        long now = _context.clock().now();
     
    13771384        synchronized (_peersByIdent) {
    13781385            return _peersByIdent.size() < getMaxConnections();
    1379         }
    1380     }
    1381 
    1382     @Override
    1383     public boolean haveCapacity() {
    1384         synchronized (_peersByIdent) {
    1385             return _peersByIdent.size() < getMaxConnections() * 4 / 5;
    1386         }
    1387     }
    1388 
    1389     public boolean haveHighCapacity() {
    1390         synchronized (_peersByIdent) {
    1391             return _peersByIdent.size() < getMaxConnections() / 2;
    13921386        }
    13931387    }
  • router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java

    r7b7a590e r135f8c1  
    254254    }
    255255   
     256    /*******  may be used for congestion control later...
     257    public int getParticipatingInboundGatewayCount() {
     258        return _inboundGateways.size();
     259    }
     260    *******/
     261   
    256262    /** what is the date/time on which the last non-locally-created tunnel expires? */
    257263    public long getLastParticipatingExpiration() { return _lastParticipatingExpiration; }
  • router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java

    r7b7a590e r135f8c1  
    6666        _context.statManager().createRateStat("tunnel.rejectOverloaded", "How long we had to wait before processing the request (when it was rejected)", "Tunnels", new long[] { 60*1000, 10*60*1000 });
    6767        _context.statManager().createRateStat("tunnel.acceptLoad", "Delay before processing the accepted request", "Tunnels", new long[] { 60*1000, 10*60*1000 });
     68        _context.statManager().createRateStat("tunnel.dropConnLimits", "Drop instead of reject due to conn limits", "Tunnels", new long[] { 60*1000, 10*60*1000 });
    6869        _context.statManager().createRateStat("tunnel.dropLoad", "How long we had to wait before finally giving up on an inbound request (period is queue count)?", "Tunnels", new long[] { 60*1000, 10*60*1000 });
    6970        _context.statManager().createRateStat("tunnel.dropLoadDelay", "How long we had to wait before finally giving up on an inbound request?", "Tunnels", new long[] { 60*1000, 10*60*1000 });
     
    467468    }
    468469   
    469     private static final String PROP_REJECT_NONPARTICIPANT = "router.participantOnly";
    470470    private void handleReq(RouterInfo nextPeerInfo, BuildMessageState state, BuildRequestRecord req, Hash nextPeer) {
    471471        long ourId = req.readReceiveTunnelId();
     
    511511         */
    512512        if (response == 0 &&
    513             ((isInGW && ! _context.commSystem().haveInboundCapacity()) ||
    514              (isOutEnd && ! _context.commSystem().haveOutboundCapacity()))) {
     513            ((isInGW && ! _context.commSystem().haveInboundCapacity(87)) ||
     514             (isOutEnd && ! _context.commSystem().haveOutboundCapacity(87)))) {
    515515                _context.throttle().setTunnelStatus("Rejecting tunnels: Connection limit");
    516516                response = TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
     
    568568                                                     recvDelay + " as " +
    569569                                                     (isOutEnd ? "outbound endpoint" : isInGW ? "inbound gw" : "participant"));
     570        }
     571
     572        // Connection congestion control:
     573        // If we rejected the request, are near our conn limits, and aren't connected to the next hop,
     574        // just drop it.
     575        if (response != 0 &&
     576            (! _context.routerHash().equals(nextPeer)) &&
     577            (! _context.commSystem().haveOutboundCapacity(75)) &&
     578            (! _context.commSystem().isEstablished(nextPeer))) {
     579            _context.statManager().addRateData("tunnel.dropConnLimits", 1, 0);
     580            return;
    570581        }
    571582
Note: See TracChangeset for help on using the changeset viewer.