Changeset 8096e4f6


Ignore:
Timestamp:
Jun 17, 2015 4:00:53 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8d9cced
Parents:
036b777 (diff), 627f707 (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:

propagate from branch 'i2p.i2p.zzz.multisess' (head 655a0c2bbd50625c804b8de8c809b40ed63f53f4)

to branch 'i2p.i2p' (head b977ab50209475c0e74825f361924e05dbd470c7)

Files:
1 added
1 deleted
57 edited

Legend:

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

    r036b777 r8096e4f6  
    17391739        synchronized (_snarks) {
    17401740            for (Snark snark : _snarks.values()) {
    1741                 torrents.add(new SHA1Hash(snark.getMetaInfo().getInfoHash()));
     1741                torrents.add(new SHA1Hash(snark.getInfoHash()));
    17421742            }
    17431743            synchronized (_configLock) {
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcInboundFilter.java

    r036b777 r8096e4f6  
    4848            output=local.getOutputStream();
    4949        } catch (IOException e) {
    50             if (_log.shouldLog(Log.ERROR))
    51                 _log.error("IrcInboundFilter: no streams",e);
     50            if (_log.shouldLog(Log.WARN))
     51                _log.warn("IrcInboundFilter: no streams",e);
    5252            return;
    5353        }
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcOutboundFilter.java

    r036b777 r8096e4f6  
    4848            output=remote.getOutputStream();
    4949        } catch (IOException e) {
    50             if (_log.shouldLog(Log.ERROR))
    51                 _log.error("IrcOutboundFilter: no streams",e);
     50            if (_log.shouldLog(Log.WARN))
     51                _log.warn("IrcOutboundFilter: no streams",e);
    5252            return;
    5353        }
  • apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java

    r036b777 r8096e4f6  
    276276        return _status;
    277277    }
    278    
    279     public String checkAvailable(UpdateType type, long maxWait) {
    280         return checkAvailable(type, "", maxWait);
    281     }
    282278
    283279    /**
     
    285281     *  Blocking.
    286282     *  An available update may still have a constraint or lack sources.
     283     *  @param type the UpdateType of this request
     284     *  @return new version or null if nothing newer is available
     285     *  @since 0.9.21
     286     */
     287    public String checkAvailable(UpdateType type) {
     288        return checkAvailable(type, "", DEFAULT_CHECK_TIME);
     289    }
     290
     291    /**
     292     *  Is an update available?
     293     *  Blocking.
     294     *  An available update may still have a constraint or lack sources.
     295     *  @param type the UpdateType of this request
     296     *  @param maxWait max time to block
     297     *  @return new version or null if nothing newer is available
     298     */
     299    public String checkAvailable(UpdateType type, long maxWait) {
     300        return checkAvailable(type, "", maxWait);
     301    }
     302
     303    /**
     304     *  Is an update available?
     305     *  Blocking.
     306     *  An available update may still have a constraint or lack sources.
     307     *  @param type the UpdateType of this request
     308     *  @param id id of this request
    287309     *  @param maxWait max time to block
    288310     *  @return new version or null if nothing newer is available
  • core/java/src/net/i2p/update/UpdateManager.java

    r036b777 r8096e4f6  
    122122     */
    123123    public boolean notifyComplete(UpdateTask task, String actualVersion, File file);
     124   
     125    /**
     126     *  Is an update available?
     127     *  Blocking.
     128     *  An available update may still have a constraint or lack sources.
     129     *  @param type the UpdateType of this request
     130     *  @return new version or null if nothing newer is available
     131     *  @since 0.9.21
     132     */
     133    public String checkAvailable(UpdateType type);
     134   
     135    /**
     136     *  Is an update available?
     137     *  Blocking.
     138     *  An available update may still have a constraint or lack sources.
     139     *  @param type the UpdateType of this request
     140     *  @param maxWait max time to block
     141     *  @return new version or null if nothing newer is available
     142     *  @since 0.9.21
     143     */
     144    public String checkAvailable(UpdateType type, long maxWait);
     145   
     146    /**
     147     *  Is an update available?
     148     *  Blocking.
     149     *  An available update may still have a constraint or lack sources.
     150     *  @param type the UpdateType of this request
     151     *  @param maxWait max time to block
     152     *  @param id id of this request
     153     *  @return new version or null if nothing newer is available
     154     *  @since 0.9.21
     155     */
     156    public String checkAvailable(UpdateType type, String id, long maxWait);
     157   
     158    /**
     159     *  Is a router update being downloaded?
     160     *  @return true iff router update is being downloaded
     161     *  @since 0.9.21
     162     */
     163    public boolean isUpdateInProgress();
     164   
     165    /**
     166     *  Is a router update being downloaded?
     167     *  @param type the UpdateType of this request
     168     *  @return true iff router update is being downloaded
     169     *  @since 0.9.21
     170     */
     171    public boolean isUpdateInProgress(UpdateType type);
     172   
     173    /**
     174     *  Is a router update being downloaded?
     175     *  @param type the UpdateType of this request
     176     *  @param id of this request
     177     *  @return true iff router update is being downloaded
     178     *  @since 0.9.21
     179     */
     180    public boolean isUpdateInProgress(UpdateType type, String id);
     181    /**
     182     *  Non-blocking. Does not check.
     183     *  Fails if check or update already in progress.
     184     *  If returns true, then call isUpdateInProgress() in a loop
     185     *  @param type the UpdateType of this request   
     186     *  @return true if task started
     187     *  @since 0.9.21
     188     */
     189    public boolean update(UpdateType type);
     190   
     191    /**
     192     *  Non-blocking. Does not check.
     193     *  Fails if check or update already in progress.
     194     *  If returns true, then call isUpdateInProgress() in a loop
     195     *  @param type the UpdateType of this request   
     196     *  @param id id of this request
     197     *  @return true if task started
     198     *  @since 0.9.21
     199     */
     200    public boolean update(UpdateType type, String id);
     201   
     202    /**
     203     *  Non-blocking. Does not check.
     204     *  Fails if check or update already in progress.
     205     *  If returns true, then call isUpdateInProgress() in a loop
     206     *  @param type the UpdateType of this request   
     207     *  @param maxTime not honored by all Updaters
     208     *  @return true if task started
     209     *  @since 0.9.21
     210     */
     211    public boolean update(UpdateType type, long maxTime);
     212   
     213    /**
     214     *  Non-blocking. Does not check.
     215     *  Fails if check or update already in progress.
     216     *  If returns true, then call isUpdateInProgress() in a loop
     217     *  @param type the UpdateType of this request   
     218     *  @param maxTime not honored by all Updaters
     219     *  @param id id of this request
     220     *  @return true if task started
     221     *  @since 0.9.21
     222     */
     223    public boolean update(UpdateType type, String id, long maxTime);
     224   
     225    /**
     226     *  The status on any update current or last finished.
     227     *  @return status or ""
     228     */
     229    public String getStatus();
    124230
    125231    /**
  • core/java/src/net/i2p/util/ResettableGZIPInputStream.java

    r036b777 r8096e4f6  
    111111            if (inf.finished()) {
    112112                verifyFooter();
    113                 inf.reset(); // so it doesn't bitch about missing data...
     113                inf.reset(); // so it doesn't complain about missing data...
    114114                _complete = true;
    115115            }
  • debian/apparmor/i2p

    r036b777 r8096e4f6  
    5252  # 'm' is needed by the I2P-Bote plugin
    5353  /{,lib/live/mount/overlay/}tmp/                         rwm,
     54  owner /{,lib/live/mount/overlay/}tmp/hsperfdata_i2psvc/ rwk,
     55  owner /{,lib/live/mount/overlay/}tmp/hsperfdata_i2psvc/** rw,
     56  owner /{,lib/live/mount/overlay/}tmp/wrapper[0-9]*.tmp   rwk,
     57  owner /{,lib/live/mount/overlay/}tmp/wrapper[0-9]*.tmp/** rw,
    5458  owner /{,lib/live/mount/overlay/}tmp/i2p-daemon/        rwm,
    5559  owner /{,lib/live/mount/overlay/}tmp/i2p-daemon/**      rwklm,
     
    5761  # Prevent spamming the logs
    5862  deny /dev/tty                                           rw,
     63  deny /{,lib/live/mount/overlay/}var/tmp/                r,
    5964  deny @{PROC}/[0-9]*/fd/                                 r,
    6065  deny /usr/sbin/                                         r,
  • debian/control

    r036b777 r8096e4f6  
    1313 ,dh-apparmor
    1414 ,gettext
    15  ,libgmp3-dev
     15 ,libgmp-dev (>= 2:5.0.5)
    1616# uncomment the next line for official builds
    1717# ,libservice-wrapper-java
  • debian/i2p.init

    r036b777 r8096e4f6  
    3333NICE=0
    3434I2PUSER="i2psvc"
    35 USE_AA="yes"
    3635
    3736I2P_ARGS="/etc/i2p/wrapper.config \
     
    6867fi
    6968
     69case "$CONFINE_WITH_APPARMOR" in
     70    [NnFf]*)
     71        USE_AA="no"
     72        ;;
     73    *)
     74        USE_AA="yes"
     75        ;;
     76esac
     77
    7078case "$RUN_DAEMON" in
    7179    [NnFf]*)
     
    8492do_start()
    8593{
     94    [ ! -z $ULIMIT ] && ulimit -n $ULIMIT
    8695    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null 2>&1 \
    8796        || return 1
  • debian/i2p.postinst

    r036b777 r8096e4f6  
    77
    88conffile="/etc/default/i2p"
    9 #systemdservice="/lib/systemd/system/i2p.service"
     9systemdservice="/lib/systemd/system/i2p.service"
    1010
    1111# Source debconf library -- we have a Depends line
     
    2626            echo "RUN_DAEMON=" >> $conffile
    2727            echo "I2PUSER=" >> $conffile
     28            echo "ULIMIT=" >> $conffile
    2829            echo "CONFINE_WITH_APPARMOR=" >> $conffile
    2930            echo "# The next value is also wrapper.java.maxmemory in /etc/i2p/wrapper.config" >> $conffile
     
    5051        test -z "$MEMORYLIMIT" || grep -Eq '^ *MEMORYLIMIT=' $conffile || \
    5152            echo "MEMORYLIMIT=" >> $conffile
     53        test -z "$ULIMIT" || grep -Eq '^ *ULIMIT=' $conffile || \
     54            echo "ULIMIT=" >> $conffile
    5255        test -z "$CONFINE_WITH_APPARMOR" || grep -Eq '^ *CONFINE_WITH_APPARMOR=' $conffile || \
    5356            echo "CONFINE_WITH_APPARMOR=" >> $conffile
     
    5861        fi
    5962
    60 
    61 
    6263        sed -e "s/^ *RUN_DAEMON=.*/RUN_DAEMON=\"$RUN_DAEMON\"/" \
    6364            -e "s/^ *I2PUSER=.*/I2PUSER=\"$I2PUSER\"/" \
     
    6768        mv -f $conffile.tmp $conffile
    6869
    69 #        if [ -e "$systemdservice" ]; then
    70 #            sed -e "s/User=.*/User=$I2PUSER/" < "$systemdservice" > "$systemdservice.tmp"
    71 #            mv -f "$systemdservice.tmp" "$systemdservice"
    72 #            chmod 0644 -f "$systemdservice"
    73 #            if grep -q 'systemd' /proc/1/comm > /dev/null 2>&1; then
    74 #                systemctl --system daemon-reload
    75 #                if [ $RUN_DAEMON = 'true' ]; then
    76 #                    systemctl enable i2p.service
    77 #                else
    78 #                    systemctl disable i2p.service
    79 #                fi
    80 #            fi
    81 #        fi
     70        if [ -e "$systemdservice" ]; then
     71            sed -e "s/User=.*/User=$I2PUSER/" < "$systemdservice" > "$systemdservice.tmp"
     72            mv -f "$systemdservice.tmp" "$systemdservice"
     73            chmod 0644 -f "$systemdservice"
     74            if grep -q 'systemd' /proc/1/comm > /dev/null 2>&1; then
     75                systemctl --system daemon-reload
     76                if [ $RUN_DAEMON = 'true' ]; then
     77                    systemctl enable i2p.service
     78                else
     79                    systemctl disable i2p.service
     80                fi
     81            fi
     82        fi
    8283
    8384        sed -e "s/^ *wrapper\.java\.maxmemory=.*/wrapper\.java\.maxmemory=$MEMORYLIMIT/" \
  • debian/i2p.service

    r036b777 r8096e4f6  
     1# It's not recommended to modify this file because it will be
     2# overwritten during package upgrades.  If you want to make changes, the
     3# best way is to create a file "/etc/systemd/system/i2p.service.d/foo.conf"
     4# and make your changes there. This file will be parsed after the file
     5# i2p.service itself is parsed.
     6#
     7# For more info about custom unit files, see systemd.unit(5) or
     8# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
     9
     10# For example, if you want to increase I2P's open-files-limit to 10000,
     11# you need to increase systemd's LimitNOFILE setting, so create a file named
     12# "/etc/systemd/system/i2p.service.d/limits.conf" containing:
     13#       [Service]
     14#       LimitNOFILE=10000
     15
     16# Don't forget to reload systemd daemon after you change unit configuration:
     17# root> systemctl --system daemon-reload
     18
    119[Unit]
    220Description=load-balanced unspoofable packet switching network
    3 After=network.target
     21After=local-fs.target network.target time-sync.target
    422
    523[Service]
    624Type=forking
    725EnvironmentFile=/etc/default/i2p
     26RuntimeDirectory=i2p
     27RuntimeDirectoryMode=750
     28PIDFile=/run/i2p/i2p.pid
    829Environment="I2P_ARGS=/etc/i2p/wrapper.config \
    930 wrapper.java.additional.1=-DloggerFilenameOverride=/var/log/i2p/log-router-@.txt \
     
    1738User=i2psvc
    1839PermissionsStartOnly=true
    19 ExecStartPre=/bin/mkdir -p /run/i2p /tmp/i2p-daemon
     40AppArmorProfile=system_i2p
     41ExecStartPre=/bin/mkdir -p /tmp/i2p-daemon
    2042ExecStartPre=/bin/chown -R ${I2PUSER}:${I2PUSER} /var/log/i2p /run/i2p /tmp/i2p-daemon
    2143ExecStartPre=/bin/chmod 750 /var/log/i2p
    2244ExecStart=/usr/sbin/wrapper "$I2P_ARGS"
    23 ExecStopPost=/bin/rm -rf /run/i2p /tmp/i2p-daemon
     45ExecStopPost=/bin/rm -rf /run/i2p
    2446
    2547[Install]
  • history.txt

    r036b777 r8096e4f6  
     12015-06-13 zzz
     2 * i2psnark: Fix NPE (ticket #1602)
     3 * NetDB:
     4   - Improve routing of DatabaseStoreMessage acks
     5   - Send our own RI unsolicited in reply if we aren't floodfill
     6   - Don't ack or flood a store of an unknown type
     7 * PeerTestJob: Don't generate zero reply token
     8 * Tunnels: More checks of messages received down exploratory tunnels
     9
     102015-06-08 dg
     11 * Language fixes
     12 * Make netDb.storeFloodNew graphable for testing (#1195)
     13 * Directly connect to nearby floodfills to share our RI
     14   to speed up integration of new floodfills (#1195)
     15 * Silence Irc{Inbound,Outbound}Filter warnings about 'no streams'
     16   when we can't connect to an IRC server. Change to WARN.
     17
     182015-06-07 zzz
     19 * Logs: Correct wrapper.config location when running as a service
     20 * NetDB: Fix early NPE
     21 * SSU: Possible fix for NPE in establisher
     22
     232015-06-06 zzz
     24 * Console: Add indication of current ff status on /configadvanced,
     25   change immediately when config changes, force republish
     26
    1272015-06-06 str4d
    228 * newsxml: Don't use XXX for parsing dates on Android
     
    43484374      to eliminate races with ReadConfigJob
    43494375  * Tunnels:
    4350     - When a peer is shitlisted, fail all our tunnels where
     4376    - When a peer is banlisted, fail all our tunnels where
    43514377      that peer is the adjacent hop. In particular this
    43524378      will remove outbound tunnels when we can't contact
     
    486748932011-09-30 zzz
    48684894  * logs.jsp: Add wrapper version
    4869   * Shitlist: Shorten time
     4895  * Banlist: Shorten time
    48704896  * Wrapper: Update armv7 to 3.5.12
    48714897
     
    49584984
    495949852011-09-08 zzz
    4960   * Blocklist: Include IP in shitlist reason
     4986  * Blocklist: Include IP in banlist reason
    49614987  * Ministreaming: Drop old classes replaced by streaming
    49624988    years ago.
     
    71307156      - Store and report UDP clock skews even for large values, so
    71317157        a badly skewed local clock will be reported to the console
    7132       - Don't shitlist for NTCP clock skew if we don't know what time it is
     7158      - Don't banlist for NTCP clock skew if we don't know what time it is
    71337159      - If NTP hasn't worked yet, have NTCP or SSU update the clock one time
    71347160      - Include failed clock skew in NTCP skew vector if there aren't many connections
     
    74927518    * build: Take two test scripts out of the installer
    74937519    * i2psnark: Bye TPB
    7494     * Shitlist: Fix bug from two checkins ago, all were forever
     7520    * Banlist: Fix bug from two checkins ago, all were forever
    74957521
    749675222009-11-14 zzz
     
    75077533    * Console: Some colon cleansing
    75087534    * FloodfillPeerSelector: Adjustments
    7509     * Shitlist: Move HTML renderer to router console,
     7535    * Banlist: Move HTML renderer to router console,
    75107536      add cause parameter for ease of translation,
    75117537      tag all causes
     
    78557881    * Ministreaming: Cleanups, deprecation, move demos out of the lib
    78567882    * netdb.jsp: Flags for leases
    7857     * NTCP: Clean up clock skew shitlist message
     7883    * NTCP: Clean up clock skew banlist message
    78587884    * profiles.jsp:
    78597885      - Rename the Failing column
     
    78617887    * readme*html: localhost -> 127.0.0.1
    78627888    * Router: Don't do some things when we are shutting down
    7863     * Shitlist: Clean up expire message
     7889    * Banlist: Clean up expire message
    78647890    * Stats:
    78657891      - Fix BufferedStatsLog so it works at all
     
    79277953        2) It randomly dies after a while
    79287954    * Console:
    7929       - Rename the shitlist and the blocklist
     7955      - Rename the banlist and the blocklist
    79307956      - Try to reduce servlet problems on iframe
    79317957      - Select server or client icon for local dests
     
    86628688        Existing installs can get files with 'ant updaterWIthGeoIP'
    86638689        or in the console docs bundle 'ant consoleDocs'
    8664       - Use flags for shitlist and peers.jsp too
     8690      - Use flags for banlist and peers.jsp too
    86658691      - Tweak tunnels.jsp to show class letters
    86668692      - Hide in-progress details on tunnels.jsp
     
    91439169
    914491702009-02-07 zzz
    9145     * ClientConnectionRunner, Shitlist, TunnelDispatcher:
     9171    * ClientConnectionRunner, Banlist, TunnelDispatcher:
    91469172      Update using concurrent
    91479173    * Streaming ConnectionHandler: Bound SYN queue and
     
    92919317        FloodfillPeerSelector sorts more keys, so that
    92929318        exploration works well
    9293     * Shitlist: Reduce max time to 30m (was 60m)
     9319    * Banlist: Reduce max time to 30m (was 60m)
    92949320    * Streaming:
    92959321      - Reduce default initial window size from 12 to 6,
     
    92979323         and try to limit initial packet loss
    92989324      - Reduce fast retransmit threshold from 3 to 2
    9299     * Transport: Don't shitlist a peer if we are at our
     9325    * Transport: Don't banlist a peer if we are at our
    93009326      connection limit
    93019327
     
    942194472008-11-21 zzz
    94229448    * Cache DNS and negative DNS for 5m (was 1m and forever)
    9423     * Delay shitlist cleaner at startup
     9449    * Delay banlist cleaner at startup
    94249450    * Strip wrapper properties from client config
    94259451    * Define multiple cert type
     
    96299655    * help.jsp: Add link to German FAQ
    96309656    * tunnels.jsp: Fix inactive participating count
    9631     * SearchReplyJob: Don't look up references to shitlisted peers
     9657    * SearchReplyJob: Don't look up references to banlisted peers
    96329658    * TunnelPeerSelector: Avoid a peer for 20s after a reject or timeout
    96339659
     
    96929718    * EepGet command line: Fix byte counts after a failed resume
    96939719    * NTCP: Mark unreachable on outbound connection timeout
    9694     * Shitlist: Fix partial shitlisting (still unused though)
     9720    * Banlist: Fix partial banlisting (still unused though)
    96959721    * Summary Bar: Warn if firewalled and floodfill
    96969722    * Throttle: Combine current and last bw measurement,
     
    97369762    * Floodfill Peer Selector:
    97379763      - Avoid peers whose netdb is old, or have a recent failed store,
    9738         or are forever-shitlisted
     9764        or are forever-banlisted
    97399765
    974097662008-07-30 zzz
    97419767    * Blocklists:
    97429768      - New, disabled by default, except for blocking of
    9743         forever-shitlisted peers. See source for instructions
     9769        forever-banlisted peers. See source for instructions
    97449770        and file format.
    97459771    * Transport - Reject peers from inbound connections:
    97469772      - Check IP against blocklist
    9747       - Check router hash against forever-shitlist, then block IP
     9773      - Check router hash against forever-banlist, then block IP
    97489774
    974997752008-07-16 zzz
     
    97779803      - Clean up toString()
    97789804    * SSU:
    9779       - Try to pick better introducers by checking shitlist,
     9805      - Try to pick better introducers by checking banlist,
    97809806        wasUnreachable list, failing list, and idle times
    97819807      - To keep introducer connections up and valid,
     
    986498902008-06-07 zzz
    98659891    * NetDb: Tweak some logging on lease problems
    9866     * Shitlist:
    9867       - Add shitlistForever() and isShitlistedForever(), unused for now
     9892    * Banlist:
     9893      - Add banlistForever() and isBanlistedForever(), unused for now
    98689894      - Sort the HTML output by router hash
    98699895    * netdb.jsp:
     
    99079933    * Logging: Move common WARN output to DEBUG so we can ask users to
    99089934        set the default log level to WARN without massive spewage
    9909     * ProfileOrganizer: Restrict !isSelectable() (i.e. shitlisted) peers from the High Capacity tier,
     9935    * ProfileOrganizer: Restrict !isSelectable() (i.e. banlisted) peers from the High Capacity tier,
    99109936      not just the Fast tier, since we don't use them for tunnels anyway
    99119937    * SAM: Add some compiler flexibility to two obscure makefiles
     
    1007010096    * Reachability:
    1007110097      - Track unreachable peers persistently
    10072         (i.e. separately from shitlist, and not cleared when they contact us)
     10098        (i.e. separately from banlist, and not cleared when they contact us)
    1007310099      - Exclude detected unreachable peers from inbound tunnels
    1007410100      - Exclude detected unreachable peers from selected leases
     
    10078101042008-04-16 zzz
    1007910105    * SSU/Reachability:
    10080       - Extend shitlist time from 4-8m to 40-60m
    10081       - Add some shitlist logging
    10082       - Don't shitlist twice when unreachable on all transports
     10106      - Extend banlist time from 4-8m to 40-60m
     10107      - Add some banlist logging
     10108      - Don't banlist twice when unreachable on all transports
    1008310109      - Exclude netDb-listed unreachable peers from inbound tunnels;
    1008410110        this won't help much since there are very few of these now
     
    1008610112        0.6.1.10 transition
    1008710113      - Track and display UDP connection direction on peers.jsp
    10088       - Show shitlist status in-line on profiles.jsp
     10114      - Show banlist status in-line on profiles.jsp
    1008910115
    10090101162008-04-15 zzz
     
    10184102102008-03-14 zzz
    1018510211    * Floodfill Search:
    10186        - Prefer heard-from, unfailing, unshitlisted floodfill peers
     10212       - Prefer heard-from, unfailing, unbanlisted floodfill peers
    1018710213
    10188102142008-03-14 zzz
     
    1096910995      debugging purposes, publish the count of how many identities the
    1097010996      router has cycled through, though not the identities itself.
    10971     * Cleaned up the way the multitransport shitlisting worked, and
    10972       added per-transport shitlists
     10997    * Cleaned up the way the multitransport banlisting worked, and
     10998      added per-transport banlists
    1097310999    * When dropping a router reference locally, first fire a netDb
    1097411000      lookup for the entry
     
    1100011026
    11001110272006-07-14  jrandom
    11002     * Improve the multitransport shitlisting (thanks Complication!)
     11028    * Improve the multitransport banlisting (thanks Complication!)
    1100311029    * Allow routers with a capacity of 16-32KBps to be used in tunnels under
    1100411030      the default configuration (thanks for the stats Complication!)
     
    1102211048    * Adjust the Fortuna PRNG's pooling system to reduce contention on
    1102311049      refill with a background thread to refill the output buffer
    11024     * Add per-transport support for the shitlist
     11050    * Add per-transport support for the banlist
    1102511051    * Add a new async pumped tunnel gateway to reduce tunnel dispatcher
    1102611052      contention
     
    1109211118
    11093111192006-05-16  jrandom
    11094     * Further shitlist randomizations
     11120    * Further banlist randomizations
    1109511121    * Adjust the stats monitored for detecting cpu overload when dropping new
    1109611122      tunnel requests
     
    1130511331    * Cut down on subsequent streaming lib reset packets transmitted
    1130611332    * Use a larger MTU more often
    11307     * Allow netDb searches to query shitlisted peers, as the queries are
     11333    * Allow netDb searches to query banlisted peers, as the queries are
    1130811334      indirect.
    1130911335    * Add an option to disable non-floodfill netDb searches (non-floodfill
     
    1136711393    * Fix to the SSU IP detection code so we won't use introducers when we
    1136811394      don't need them (thanks Complication!)
    11369     * Add a brief shitlist to i2psnark so it doesn't keep on trying to reach
     11395    * Add a brief banlist to i2psnark so it doesn't keep on trying to reach
    1137011396      peers given to it
    1137111397    * Don't let netDb searches wander across too many peers
     
    1192611952
    11927119532005-12-14  jrandom
    11928     * Fix to drop peer references when we shitlist people again (thanks zzz!)
     11954    * Fix to drop peer references when we banlist people again (thanks zzz!)
    1192911955    * Further I2PSnark fixes to deal with arbitrary torrent info attributes
    1193011956      (thanks Complication!)
     
    1202512051
    12026120522005-11-30  jrandom
    12027     * Don't let the TCP transport alone shitlist a peer, since other
     12053    * Don't let the TCP transport alone banlist a peer, since other
    1202812054      transports may be working.  Also display whether TCP connections are
    1202912055      inbound or outbound on the peers page.
     
    1209312119      protection against trivial attackers, but should provide functional
    1209412120      improvement for people who have periodic IP changes, since their new
    12095       router address would not be shitlisted while their old one would be.
     12121      router address would not be banlisted while their old one would be.
    1209612122    * Added further infrastructure for restricted route operation, but its use
    1209712123      is not recommended.
     
    1224112267      low bandwidth peers.
    1224212268    * Improved failure handling in SSU with proactive reestablishment of
    12243       failing idle peers, and rather than shitlisting a peer who failed too
     12269      failing idle peers, and rather than banlisting a peer who failed too
    1224412270      much, drop the SSU session and allow a new attempt (which, if it fails,
    12245       will cause a shitlisting)
    12246     * Clarify the cause of the shitlist on the profiles page, and include
     12271      will cause a banlisting)
     12272    * Clarify the cause of the banlist on the profiles page, and include
    1224712273      bandwidth limiter info at the bottom of the peers page.
    1224812274
     
    1225712283    * Defer netDb searches for newly referenced peers until we actually want
    1225812284      them
    12259     * Ignore netDb references to peers on our shitlist
     12285    * Ignore netDb references to peers on our banlist
    1226012286    * Set the timeout for end to end client messages to the max delay after
    1226112287      finding the leaseSet, so we don't have as many expired messages floating
     
    1247212498      Thanks Complication (and anon)!
    1247312499    * Fixed the installer version string (thanks Frontier!)
    12474     * Added cleaner rejection of invalid IP addresses, shitlist those who send
     12500    * Added cleaner rejection of invalid IP addresses, banlist those who send
    1247512501      us invalid IP addresses, verify again that we are not sending invalid IP
    1247612502      addresses, and log an error if it happens. (Thanks Complication, ptm,
     
    1250012526    * Limit the number of inbound SSU sessions being built at once (using
    1250112527      half of the i2np.udp.maxConcurrentEstablish config prop)
    12502     * Don't shitlist on a message send failure alone (unless there aren't any
     12528    * Don't banlist on a message send failure alone (unless there aren't any
    1250312529      common transports).
    1250412530    * More careful bandwidth bursting
     
    1263712663    * More careful error handling with introductions (thanks dust!)
    1263812664    * Fix the forceIntroducers checkbox on config.jsp (thanks Complication!)
    12639     * Hide the shitlist on the summary so it doesn't confuse new users.
     12665    * Hide the banlist on the summary so it doesn't confuse new users.
    1264012666
    12641126672005-09-12  comwiz
     
    1274412770    * Catch errors with corrupt tunnel messages more gracefully (no need to
    1274512771      kill the thread and cause an OOM...)
    12746     * Don't skip shitlisted peers for netDb store messages, as they aren't
    12747       necessarily shitlisted by other people (though they probably are).
     12772    * Don't skip banlisted peers for netDb store messages, as they aren't
     12773      necessarily banlisted by other people (though they probably are).
    1274812774    * Adjust the netDb store per-peer timeout based on each particular peer's
    1274912775      profile (timeout = 4x their average netDb store response time)
     
    1278812814    * Don't overwrite the status with 'unknown' unless we haven't had a valid
    1278912815      status in a while.
    12790     * Make sure to avoid shitlisted peers for peer testing.
     12816    * Make sure to avoid banlisted peers for peer testing.
    1279112817    * When we get an unknown result to a peer test, try again soon afterwards.
    1279212818    * When a peer tells us that our address is different from what we expect,
     
    1279512821      result was not OK, accept their suggestion, but queue up a peer test for
    1279612822      later.
    12797     * Don't try to do a netDb store to a shitlisted peer, and adjust the way
     12823    * Don't try to do a netDb store to a banlisted peer, and adjust the way
    1279812824      we monitor netDb store progress (to clear up the high netDb.storePeers
    1279912825      stat)
     
    1342713453      2 means +/- 2, not +/- 1 (thanks dm!)
    1342813454    * Avoid an NPE on client disconnect
    13429     * Never select a shitlisted peer to participate in a tunnel
     13455    * Never select a banlisted peer to participate in a tunnel
    1343013456    * Have netDb store messages timeout after 10s, not the full 60s (duh)
    1343113457    * Keep session tags around for a little longer, just in case (grr)
     
    1427714303
    14278143042004-10-04  jrandom
    14279     * Update the shitlist to reject a peer for an exponentially increasing
     14305    * Update the banlist to reject a peer for an exponentially increasing
    1428014306      period of time (with an upper bounds of an hour).
    1428114307    * Various minor stat and debugging fixes
     
    1429114317
    14292143182004-10-02  jrandom
    14293     * Assure that we quickly fail messages bound for shitlisted peers.
     14319    * Assure that we quickly fail messages bound for banlisted peers.
    1429414320    * Address a race on startup where the first peer contacted could hang the
    1429514321      router (thanks Romster!)
  • installer/resources/certificates/ssl/i2p.mooo.com.crt

    r036b777 r8096e4f6  
    11-----BEGIN CERTIFICATE-----
    2 MIIDvjCCAyegAwIBAgICZhcwDQYJKoZIhvcNAQEFBQAwdTELMAkGA1UEBhMCVVMx
    3 DTALBgNVBAgMBG5vbmUxDTALBgNVBAcMBG5vbmUxDTALBgNVBAoMBG5vbmUxDTAL
    4 BgNVBAsMBG5vbmUxFTATBgNVBAMMDGkycC5tb29vLmNvbTETMBEGCSqGSIb3DQEJ
    5 ARYEbm9uZTAeFw0xMTEwMjMyMTM2NDFaFw0xOTEwMjMyMTM2NDFaMGYxCzAJBgNV
    6 BAYTAlVTMQ0wCwYDVQQIDARub25lMQ0wCwYDVQQKDARub25lMQ0wCwYDVQQLDARu
    7 b25lMRUwEwYDVQQDDAxpMnAubW9vby5jb20xEzARBgkqhkiG9w0BCQEWBG5vbmUw
    8 ggGPMA0GCSqGSIb3DQEBAQUAA4IBfAAwggF3AoIBbgMG1O7HRVa7UoiKbQTmKy5m
    9 x79Na8vjD3etcOwfc4TSenQFvn+GbAWkJwKpM8uvOcgj1CxNeHWdSaeTFH1OwJsw
    10 vl3leJ7clMdo3hpQDhPeGzBLyOiWwFHVn15YKa9xcM7S9Op5Q6rKBHUyyx1vGSz+
    11 /NBmkktpI6rcGFfP3ISRL0auR+db+adWv4TS6W8YiwQIVZNbSlKP6FNO9Mv1kxQZ
    12 KoHPn8vT/LtAh1fcI6ryBuy3F5oHfbGumIwsS5dpowryFxQzwg5vtMA7AMCMKyXv
    13 hP/W6OuaaEP5MCIxkWjQs35gOYa8eF1dLoy3AD9yVVhoNrA8Bc5FnVFJ32Qv7agy
    14 qRY85cXBA6hT/Qzs/wWwp7WrrnZuifaSv/u/Ayi5vX42/bf86PSM2IRNIESoA98A
    15 NFz4U2KGq9s1K2JbkQmnFy8IU0w7CMq6PvNEm/uNjSk6OE1rcCXML+EuX0zmXy8d
    16 PjRbLzC9csSg2CqMtQIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQf
    17 Fh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUdjuOczdG
    18 hUpYzH0UXqKrOleT8GkwHwYDVR0jBBgwFoAU+SKWC49cM5sCodv89AFin3pkS0Yw
    19 DQYJKoZIhvcNAQEFBQADgYEAKYyWlDIStjjbn/ZzVScKR174I8whTbdqrX/vp9dr
    20 2hMv5m4F+aswX4Jr58WneKg2LvRaL6xEhoL7OAQ6aB/7xVSpDjIrrBLZd513NAam
    21 X6bOPYJ6IH7Vw9ClFY3AlfzsNlgRMXno7rySKKzhg24kusNwKDH2yCphZy4BgjMn
    22 y6A=
     2MIIDvTCCAqWgAwIBAgIJAOeW0ejPrHimMA0GCSqGSIb3DQEBCwUAMHUxCzAJBgNV
     3BAYTAlVTMQ0wCwYDVQQIDARub25lMQ0wCwYDVQQHDARub25lMQ0wCwYDVQQKDARu
     4b25lMQ0wCwYDVQQLDARub25lMRUwEwYDVQQDDAxpMnAubW9vby5jb20xEzARBgkq
     5hkiG9w0BCQEWBG5vbmUwHhcNMTUwMjA4MTczMzA5WhcNMTkwMzE5MTczMzA5WjB1
     6MQswCQYDVQQGEwJVUzENMAsGA1UECAwEbm9uZTENMAsGA1UEBwwEbm9uZTENMAsG
     7A1UECgwEbm9uZTENMAsGA1UECwwEbm9uZTEVMBMGA1UEAwwMaTJwLm1vb28uY29t
     8MRMwEQYJKoZIhvcNAQkBFgRub25lMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
     9CgKCAQEAqxej7oRl9GOb8benIBCENrJXoow1iWhI9M+2nU0SaonrCDql5M2YMlwd
     10HzYUWtFbRjz2NinjB0fgFq9cfzHfr1Sc8k/OeGg1jvNfqt8wWo9tryQNjiHtDQUZ
     116lQ5T13I+lj0CBasowgbApKQfrYjvaeuTaVYTfP8IVA60hoUQ+sy9JN+Unsx3/0Y
     12PLLd98+bT27qYuBNRB1g/ifUTd9Wosj2PevGBlCxYDaUjmCG4Q8kcQr87KvM6RTu
     133AV61s/Wyy1j2YemlGG/ZhJ44YnlVMSu1vTjt9HInVf3lRRx/+RzbQO3lqeVC8LC
     14Bq3KbSlfJVx4vHslfHwBFw9A4rmD1QIDAQABo1AwTjAdBgNVHQ4EFgQUsSUvX0ED
     15yivB67iksVwZ+b8vLtQwHwYDVR0jBBgwFoAUsSUvX0EDyivB67iksVwZ+b8vLtQw
     16DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAde4wts7Q8TylFEc38ftJ
     172f285fFIR7P1SSbBcHPK2eBwLEg0zJyFrCeiHuEpPrn+d5GqL2zOskjfcESGmDBT
     18aFajj8jPBJj/AmpkdWJG6a1YKro5tu9wrlenGwHOHu2/Cl0IJvafxrOs2x4G+2Nl
     195Hcw/FIy8mK7eIch4pACfi0zNMZ6KMCKfX9bxPrQo78WdBfVjbrIBlgyOQJ5NJEF
     20JlWvS7Butv7eERi4I2huN5VRJSCFzjbuO+tjP3I8IB6WgdBmTeqq8ObtXRgahBuD
     21ZmkvqVSfIzK5JN4GjO8FOdCBomuwm9A92kgmAptwQwAHM9qCDJpH8L07/7poxlGb
     22iA==
    2323-----END CERTIFICATE-----
  • installer/resources/deletelist.txt

    r036b777 r8096e4f6  
    9696certificates/ssl/ieb9oopo.mooo.com2.crt
    9797certificates/ssl/netdb.i2p2.no2.crt
     98certificates/ssl/i2p.mooo.com2.crt
  • router/java/src/net/i2p/data/i2np/DataMessage.java

    r036b777 r8096e4f6  
    5050        curIndex += 4;
    5151        if (size > MAX_SIZE)
    52             throw new I2NPMessageException("wtf, size=" + size);
     52            throw new I2NPMessageException("too large msg, size=" + size);
    5353        _data = new byte[(int)size];
    5454        System.arraycopy(data, curIndex, _data, 0, (int)size);
  • router/java/src/net/i2p/data/i2np/DeliveryInstructions.java

    r036b777 r8096e4f6  
    358358        offset += getAdditionalInfo(rv, offset);
    359359        if (offset != additionalSize)
    360             //_log.log(Log.CRIT, "wtf, additionalSize = " + additionalSize + ", offset = " + offset);
    361             throw new IllegalStateException("wtf, additionalSize = " + additionalSize + ", offset = " + offset);
     360            //_log.log(Log.CRIT, "size mismatch, additionalSize = " + additionalSize + ", offset = " + offset);
     361            throw new IllegalStateException("size mismatch, additionalSize = " + additionalSize + ", offset = " + offset);
    362362        return rv;
    363363    }
  • router/java/src/net/i2p/data/i2np/I2NPMessageReader.java

    r036b777 r8096e4f6  
    165165                        cancelRunner();
    166166                    } catch (Exception e) {
    167                         _log.log(Log.CRIT, "wtf, error reading", e);
     167                        _log.log(Log.CRIT, "error reading msg!", e);
    168168                        _listener.readError(I2NPMessageReader.this, e);
    169169                        _listener.disconnected(I2NPMessageReader.this);
  • router/java/src/net/i2p/data/i2np/TunnelGatewayMessage.java

    r036b777 r8096e4f6  
    6363            throw new IllegalStateException();
    6464        if (msg == null)
    65             throw new IllegalArgumentException("wtf, dont set me to null");
     65            throw new IllegalArgumentException("dont set me to null!");
    6666        _msg = msg;
    6767    }
     
    138138        //_msg = handler.lastRead();
    139139        //if (_msg == null)
    140         //    throw new I2NPMessageException("wtf, message read has no payload?");
     140        //    throw new I2NPMessageException("impossible? message read has no payload?!");
    141141
    142142        // NEW WAY save lots of effort at the IBGW by reading as an UnknownI2NPMessage instead
  • router/java/src/net/i2p/data/i2np/UnknownI2NPMessage.java

    r036b777 r8096e4f6  
    4949        if (type != _type) throw new I2NPMessageException("Message type is incorrect for this message");
    5050        if (dataSize > MAX_SIZE)
    51             throw new I2NPMessageException("wtf, size=" + dataSize);
     51            throw new I2NPMessageException("size mismatch, too big, size=" + dataSize);
    5252        _data = new byte[dataSize];
    5353        System.arraycopy(data, offset, _data, 0, dataSize);
  • router/java/src/net/i2p/data/router/RouterInfo.java

    r036b777 r8096e4f6  
    309309    protected byte[] getBytes() throws DataFormatException {
    310310        if (_byteified != null) return _byteified;
    311         if (_identity == null) throw new DataFormatException("Router identity isn't set? wtf!");
     311        if (_identity == null) throw new DataFormatException("Router identity isn't set?!");
    312312
    313313        //long before = Clock.getInstance().now();
  • router/java/src/net/i2p/router/Banlist.java

    r036b777 r8096e4f6  
    163163    public boolean banlistRouter(Hash peer, String reason, String reasonCode, String transport, long expireOn) {
    164164        if (peer == null) {
    165             _log.error("wtf, why did we try to banlist null?", new Exception("banfaced"));
     165            _log.error("why did we try to banlist null?", new Exception("banfaced"));
    166166            return false;
    167167        }
    168168        if (peer.equals(_context.routerHash())) {
    169             _log.error("wtf, why did we try to banlist ourselves?", new Exception("banfaced"));
     169            _log.error("why did we try to banlist ourselves?", new Exception("banfaced"));
    170170            return false;
    171171        }
  • router/java/src/net/i2p/router/JobQueue.java

    r036b777 r8096e4f6  
    592592                _context.clock().removeUpdateListener(this);
    593593                if (_log.shouldLog(Log.ERROR))
    594                     _log.error("wtf, pumper killed", t);
     594                    _log.error("pumper killed?!", t);
    595595            }
    596596        }
  • router/java/src/net/i2p/router/JobQueueRunner.java

    r036b777 r8096e4f6  
    118118                //    System.gc();
    119119            } catch (Throwable t) {
    120                 _log.log(Log.CRIT, "WTF, error running?", t);
     120                _log.log(Log.CRIT, "error running?", t);
    121121            }
    122122        }
  • router/java/src/net/i2p/router/Router.java

    r036b777 r8096e4f6  
    853853            SigningPrivateKey key = _context.keyManager().getSigningPrivateKey();
    854854            if (key == null) {
    855                 _log.log(Log.CRIT, "Internal error - signing private key not known?  wtf");
     855                _log.log(Log.CRIT, "Internal error - signing private key not known? Impossible?");
    856856                return;
    857857            }
  • router/java/src/net/i2p/router/RouterVersion.java

    r036b777 r8096e4f6  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 2;
     21    public final static long BUILD = 5;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/dummy/VMCommSystem.java

    r036b777 r8096e4f6  
    123123                _ctx.inNetMessagePool().add(msg, null, _from);
    124124            } catch (Exception e) {
    125                 _log.error("wtf, error reading/formatting a VM message?", e);
     125                _log.error("Error reading/formatting a VM message? Something is not right...", e);
    126126            }
    127127        }
  • router/java/src/net/i2p/router/message/SendMessageDirectJob.java

    r036b777 r8096e4f6  
    4444    private long _searchOn;
    4545   
     46    /**
     47     * @param toPeer may be ourselves
     48     */
    4649    public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority) {
    4750        this(ctx, message, toPeer, null, null, null, null, timeoutMs, priority);
    4851    }
    4952
    50     public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) {
     53    /**
     54     * @param toPeer may be ourselves
     55     * @param onSuccess may be null
     56     * @param onFail may be null
     57     * @param selector be null
     58     */
     59    public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess,
     60                                Job onFail, MessageSelector selector, int timeoutMs, int priority) {
    5161        this(ctx, message, toPeer, null, onSuccess, onFail, selector, timeoutMs, priority);
    5262    }
    5363
    54     public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, Job onSend, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) {
     64    /**
     65     * @param toPeer may be ourselves
     66     * @param onSend may be null
     67     * @param onSuccess may be null
     68     * @param onFail may be null
     69     * @param selector be null
     70     */
     71    public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, Job onSend, ReplyJob onSuccess,
     72                                Job onFail, MessageSelector selector, int timeoutMs, int priority) {
    5573        super(ctx);
    5674        _log = getContext().logManager().getLog(SendMessageDirectJob.class);
     
    5977        if (timeoutMs < 10*1000) {
    6078            if (_log.shouldLog(Log.WARN))
    61                 _log.warn("Very little time given [" + timeoutMs + "], resetting to 5s", new Exception("stingy bastard"));
     79                _log.warn("Very little time given [" + timeoutMs + "], resetting to 5s", new Exception("stingy caller!"));
    6280            _expiration = ctx.clock().now() + 10*1000;
    6381        } else {
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodfillDatabaseStoreMessageHandler.java

    r036b777 r8096e4f6  
    2929        _facade = facade;
    3030        // following are for HFDSMJ
    31         context.statManager().createRateStat("netDb.storeHandled", "How many netDb store messages have we handled?", "NetworkDatabase", new long[] { 60*60*1000l });
     31        context.statManager().createRateStat("netDb.storeHandled", "How many netDb store messages have we handled?", "NetworkDatabase", new long[] { 60*1000, 60*60*1000l });
    3232        context.statManager().createRateStat("netDb.storeLeaseSetHandled", "How many leaseSet store messages have we handled?", "NetworkDatabase", new long[] { 60*60*1000l });
    3333        context.statManager().createRateStat("netDb.storeRouterInfoHandled", "How many routerInfo store messages have we handled?", "NetworkDatabase", new long[] { 60*60*1000l });
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java

    r036b777 r8096e4f6  
    77import net.i2p.data.router.RouterAddress;
    88import net.i2p.data.router.RouterInfo;
     9import net.i2p.router.Job;
    910import net.i2p.router.JobImpl;
    1011import net.i2p.router.Router;
     
    5657                getContext().router().eventLog().addEvent(EventLog.NOT_FLOODFILL);
    5758            }
    58             getContext().router().rebuildRouterInfo();
     59            getContext().router().rebuildRouterInfo(true);
     60            Job routerInfoFlood = new FloodfillRouterInfoFloodJob(getContext(), _facade);
     61            if(getContext().router().getUptime() < 5*60*1000) {
     62                // Needed to prevent race if router.floodfillParticipant=true (not auto)
     63                routerInfoFlood.getTiming().setStartAfter(getContext().clock().now() + 5*60*1000);
     64                getContext().jobQueue().addJob(routerInfoFlood);
     65                if(_log.shouldLog(Log.DEBUG)) {
     66                    _log.logAlways(Log.DEBUG, "Deferring our FloodfillRouterInfoFloodJob run because of low uptime.");
     67                }
     68            } else {
     69                routerInfoFlood.runJob();
     70                if(_log.shouldLog(Log.DEBUG)) {
     71                    _log.logAlways(Log.DEBUG, "Running FloodfillRouterInfoFloodJob");
     72                }
     73            }
    5974        }
    6075        if (_log.shouldLog(Log.INFO))
     
    6277        int delay = (REQUEUE_DELAY / 2) + getContext().random().nextInt(REQUEUE_DELAY);
    6378        // there's a lot of eligible non-floodfills, keep them from all jumping in at once
    64         // To do: somehow assess the size of the network to make this adaptive?
     79        // TODO: somehow assess the size of the network to make this adaptive?
    6580        if (!ff)
    6681            delay *= 4; // this was 7, reduced for moar FFs --zab
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java

    r036b777 r8096e4f6  
    4141     *  4 as of 0.9.2; 3 as of 0.9.9
    4242     */
    43     private static final int MAX_TO_FLOOD = 3;
     43    public static final int MAX_TO_FLOOD = 3;
    4444   
    4545    private static final int FLOOD_PRIORITY = OutNetMessage.PRIORITY_NETDB_FLOOD;
     
    130130    @Override
    131131    public void publish(RouterInfo localRouterInfo) throws IllegalArgumentException {
    132         if (localRouterInfo == null) throw new IllegalArgumentException("wtf, null localRouterInfo?");
     132        if (localRouterInfo == null) throw new IllegalArgumentException("impossible: null localRouterInfo?");
    133133        // should this be after super? why not publish locally?
    134134        if (_context.router().isHidden()) return; // DE-nied!
  • router/java/src/net/i2p/router/networkdb/kademlia/HandleFloodfillDatabaseStoreMessageJob.java

    r036b777 r8096e4f6  
    1515import net.i2p.data.Hash;
    1616import net.i2p.data.LeaseSet;
     17import net.i2p.data.TunnelId;
    1718import net.i2p.data.router.RouterAddress;
    1819import net.i2p.data.router.RouterIdentity;
     
    2021import net.i2p.data.i2np.DatabaseStoreMessage;
    2122import net.i2p.data.i2np.DeliveryStatusMessage;
     23import net.i2p.data.i2np.TunnelGatewayMessage;
     24import net.i2p.router.Job;
    2225import net.i2p.router.JobImpl;
     26import net.i2p.router.OutNetMessage;
    2327import net.i2p.router.RouterContext;
    2428import net.i2p.router.TunnelInfo;
     29import net.i2p.router.message.SendMessageDirectJob;
    2530import net.i2p.util.Log;
    2631
     
    3540    private Hash _fromHash;
    3641    private final FloodfillNetworkDatabaseFacade _facade;
    37 
    38     public HandleFloodfillDatabaseStoreMessageJob(RouterContext ctx, DatabaseStoreMessage receivedMessage, RouterIdentity from, Hash fromHash, FloodfillNetworkDatabaseFacade facade) {
     42    private final static int REPLY_TIMEOUT = 60*1000;
     43    private final static int MESSAGE_PRIORITY = OutNetMessage.PRIORITY_NETDB_REPLY;
     44
     45    /**
     46     * @param receivedMessage must never have reply token set if it came down a tunnel
     47     */
     48    public HandleFloodfillDatabaseStoreMessageJob(RouterContext ctx, DatabaseStoreMessage receivedMessage,
     49                                                  RouterIdentity from, Hash fromHash,
     50                                                  FloodfillNetworkDatabaseFacade facade) {
    3951        super(ctx);
    4052        _log = ctx.logManager().getLog(getClass());
     
    137149                if (getContext().routerHash().equals(key)) {
    138150                    //getContext().statManager().addRateData("netDb.storeLocalRouterInfoAttempt", 1, 0);
     151                    // This is initiated by PeerTestJob from another peer
    139152                    // throw rather than return, so that we send the ack below (prevent easy attack)
    140153                    dontBlamePeer = true;
     
    171184                _log.error("Invalid DatabaseStoreMessage data type - " + entry.getType()
    172185                           + ": " + _message);
     186            // don't ack or flood
     187            return;
    173188        }
    174189       
     
    176191        getContext().statManager().addRateData("netDb.storeRecvTime", recvEnd-recvBegin);
    177192       
    178         // ack even if invalid or unsupported
     193        // ack even if invalid
     194        // in particular, ack our own RI (from PeerTestJob)
    179195        // TODO any cases where we shouldn't?
    180196        if (_message.getReplyToken() > 0)
    181             sendAck();
     197            sendAck(key);
    182198        long ackEnd = System.currentTimeMillis();
    183199       
     
    216232                //else if (!_message.getRouterInfo().isHidden())
    217233                long floodEnd = System.currentTimeMillis();
    218                 getContext().statManager().addRateData("netDb.storeFloodNew", floodEnd-floodBegin);
     234                getContext().statManager().addRateData("netDb.storeFloodNew", floodEnd-floodBegin, 60*1000);
    219235            } else {
    220236                // don't flood it *again*
     
    224240    }
    225241   
    226     private void sendAck() {
     242    private void sendAck(Hash storedKey) {
    227243        DeliveryStatusMessage msg = new DeliveryStatusMessage(getContext());
    228244        msg.setMessageId(_message.getReplyToken());
     
    232248        // TODO we have no session to garlic wrap this with, needs new message
    233249        msg.setArrival(getContext().clock().now() - getContext().random().nextInt(3*1000));
    234         /*
    235         if (FloodfillNetworkDatabaseFacade.floodfillEnabled(getContext())) {
    236             // no need to do anything but send it where they ask
     250        // may be null
     251        TunnelId replyTunnel = _message.getReplyTunnel();
     252        // A store of our own RI, only if we are not FF
     253        DatabaseStoreMessage msg2;
     254        if (getContext().netDb().floodfillEnabled() ||
     255            storedKey.equals(getContext().routerHash())) {
     256            // don't send our RI if the store was our RI (from PeerTestJob)
     257            msg2 = null;
     258        } else {
     259            // we aren't ff, send a go-away message
     260            msg2 = new DatabaseStoreMessage(getContext());
     261            RouterInfo me = getContext().router().getRouterInfo();
     262            msg2.setEntry(me);
     263            if (_log.shouldWarn())
     264                _log.warn("Got a store w/ reply token, but we aren't ff: from: " + _from +
     265                          " fromHash: " + _fromHash + " msg: " + _message, new Exception());
     266        }
     267        Hash toPeer = _message.getReplyGateway();
     268        boolean toUs = getContext().routerHash().equals(toPeer);
     269        // to reduce connection congestion, send directly if connected already,
     270        // else through an exploratory tunnel.
     271        if (toUs && replyTunnel != null) {
     272            // if we are the gateway, act as if we received it
    237273            TunnelGatewayMessage tgm = new TunnelGatewayMessage(getContext());
    238274            tgm.setMessage(msg);
    239             tgm.setTunnelId(_message.getReplyTunnel());
     275            tgm.setTunnelId(replyTunnel);
    240276            tgm.setMessageExpiration(msg.getMessageExpiration());
    241            
    242             getContext().jobQueue().addJob(new SendMessageDirectJob(getContext(), tgm, _message.getReplyGateway(), 10*1000, 200));
     277            getContext().tunnelDispatcher().dispatch(tgm);
     278            if (msg2 != null) {
     279                TunnelGatewayMessage tgm2 = new TunnelGatewayMessage(getContext());
     280                tgm2.setMessage(msg2);
     281                tgm2.setTunnelId(replyTunnel);
     282                tgm2.setMessageExpiration(msg.getMessageExpiration());
     283                getContext().tunnelDispatcher().dispatch(tgm2);
     284            }
     285        } else if (toUs || getContext().commSystem().isEstablished(toPeer)) {
     286            Job send = new SendMessageDirectJob(getContext(), msg, toPeer, REPLY_TIMEOUT, MESSAGE_PRIORITY);
     287            send.runJob();
     288            if (msg2 != null) {
     289                Job send2 = new SendMessageDirectJob(getContext(), msg2, toPeer, REPLY_TIMEOUT, MESSAGE_PRIORITY);
     290                send2.runJob();
     291            }
    243292        } else {
    244          */
    245             TunnelInfo outTunnel = selectOutboundTunnel();
     293            // pick tunnel with endpoint closest to toPeer
     294            TunnelInfo outTunnel = getContext().tunnelManager().selectOutboundExploratoryTunnel(toPeer);
    246295            if (outTunnel == null) {
    247296                if (_log.shouldLog(Log.WARN))
    248297                    _log.warn("No outbound tunnel could be found");
    249298                return;
    250             } else {
    251                 getContext().tunnelDispatcher().dispatchOutbound(msg, outTunnel.getSendTunnelId(0),
    252                                                                  _message.getReplyTunnel(), _message.getReplyGateway());
    253             }
    254         //}
    255     }
    256 
    257     private TunnelInfo selectOutboundTunnel() {
    258         return getContext().tunnelManager().selectOutboundTunnel();
     299            }
     300            getContext().tunnelDispatcher().dispatchOutbound(msg, outTunnel.getSendTunnelId(0),
     301                                                             replyTunnel, toPeer);
     302            if (msg2 != null)
     303                getContext().tunnelDispatcher().dispatchOutbound(msg2, outTunnel.getSendTunnelId(0),
     304                                                                 replyTunnel, toPeer);
     305        }
    259306    }
    260307 
  • router/java/src/net/i2p/router/networkdb/kademlia/IterativeLookupJob.java

    r036b777 r8096e4f6  
    5959                    }
    6060                    if (peer.equals(from)) {
    61                         // wtf
     61                        // unusual
    6262                        invalidPeers++;
    6363                        continue;
  • router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java

    r036b777 r8096e4f6  
    647647            store(h, localLeaseSet);
    648648        } catch (IllegalArgumentException iae) {
    649             _log.error("wtf, locally published leaseSet is not valid?", iae);
     649            _log.error("locally published leaseSet is not valid?", iae);
    650650            throw iae;
    651651        }
  • router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java

    r036b777 r8096e4f6  
    485485                return fileDate > _knownDate + (60*60*1000);
    486486            } else {
    487                 // wtf - prevent injection from reseeding
     487                // safety measure - prevent injection from reseeding
    488488                _log.error("Prevented LS overwrite by RI " + _key + " from " + _routerFile);
    489489                return false;
  • router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java

    r036b777 r8096e4f6  
    9595        super(context);
    9696        if ( (key == null) || (key.getData() == null) )
    97             throw new IllegalArgumentException("Search for null key?  wtf");
     97            throw new IllegalArgumentException("Search for null key?");
    9898        _log = getContext().logManager().getLog(getClass());
    9999        _facade = facade;
     
    426426        TunnelInfo inTunnel = getContext().tunnelManager().selectInboundExploratoryTunnel(to);
    427427        if (inTunnel == null) {
    428             _log.warn("No tunnels to get search replies through!  wtf!");
     428            _log.warn("No tunnels to get search replies through!");
    429429            getContext().jobQueue().addJob(new FailedJob(getContext(), router));
    430430            return;
     
    437437        //RouterInfo inGateway = getContext().netDb().lookupRouterInfoLocally(inTunnel.getPeer(0));
    438438        //if (inGateway == null) {
    439         //    _log.error("We can't find the gateway to our inbound tunnel?! wtf");
     439        //    _log.error("We can't find the gateway to our inbound tunnel?!");
    440440        //    getContext().jobQueue().addJob(new FailedJob(getContext(), router));
    441441        //    return;
     
    449449        TunnelInfo outTunnel = getContext().tunnelManager().selectOutboundExploratoryTunnel(to);
    450450        if (outTunnel == null) {
    451             _log.warn("No tunnels to send search out through!  wtf!");
     451            _log.warn("No tunnels to send search out through! Impossible?");
    452452            getContext().jobQueue().addJob(new FailedJob(getContext(), router));
    453453            return;
  • router/java/src/net/i2p/router/networkdb/kademlia/SearchUpdateReplyFoundJob.java

    r036b777 r8096e4f6  
    102102        } else {
    103103            if (_log.shouldLog(Log.ERROR))
    104                 _log.error(getJobId() + ": WTF, reply job matched a strange message: " + message);
     104                _log.error(getJobId() + ": What?! Reply job matched a strange message: " + message);
    105105            return;
    106106        }
  • router/java/src/net/i2p/router/networkdb/kademlia/SingleLookupJob.java

    r036b777 r8096e4f6  
    4343            if (peer.equals(getContext().routerHash())) // us
    4444                continue;
    45             if (peer.equals(from)) // wtf
     45            if (peer.equals(from)) // unusual?
    4646                continue;
    4747            RouterInfo ri = getContext().netDb().lookupRouterInfoLocally(peer);
  • router/java/src/net/i2p/router/peermanager/CapacityCalculator.java

    r036b777 r8096e4f6  
    174174            case 60*60*1000: return .2;
    175175            case 24*60*60*1000: return .1;
    176             default: throw new IllegalArgumentException("wtf, period [" + period + "]???");
     176            default: throw new IllegalArgumentException("undefined period passed, period [" + period + "]???");
    177177        }
    178178    }
  • router/java/src/net/i2p/router/peermanager/PeerTestJob.java

    r036b777 r8096e4f6  
    2525 * database store message
    2626 *
    27  * TODO - What's the point? Disable this? See also notes in PeerManager.selectPeers()
     27 * TODO - What's the point? Disable this? See also notes in PeerManager.selectPeers().
     28 * TODO - Use something besides sending the peer's RI to itself?
    2829 */
    2930public class PeerTestJob extends JobImpl {
     
    8384    /**
    8485     * Retrieve a group of 0 or more peers that we want to test.
     86     * Returned list will not include ourselves.
    8587     *
    8688     * @return set of RouterInfo structures
     
    111113    /**
    112114     * Fire off the necessary jobs and messages to test the given peer
    113      *
     115     * The message is a store of the peer's RI to itself,
     116     * with a reply token.
    114117     */
    115118    private void testPeer(RouterInfo peer) {
    116119        TunnelInfo inTunnel = getInboundTunnelId();
    117120        if (inTunnel == null) {
    118             _log.warn("No tunnels to get peer test replies through!  wtf!");
     121            _log.warn("No tunnels to get peer test replies through!");
    119122            return;
    120123        }
     
    124127        if (inGateway == null) {
    125128            if (_log.shouldLog(Log.WARN))
    126                 _log.warn("We can't find the gateway to our inbound tunnel?! wtf");
     129                _log.warn("We can't find the gateway to our inbound tunnel?! Impossible?");
    127130            return;
    128131        }
     
    131134        long expiration = getContext().clock().now() + timeoutMs;
    132135
    133         long nonce = getContext().random().nextLong(I2NPMessage.MAX_ID_VALUE);
     136        long nonce = 1 + getContext().random().nextLong(I2NPMessage.MAX_ID_VALUE - 1);
    134137        DatabaseStoreMessage msg = buildMessage(peer, inTunnelId, inGateway.getIdentity().getHash(), nonce, expiration);
    135138       
    136139        TunnelInfo outTunnel = getOutboundTunnelId();
    137140        if (outTunnel == null) {
    138             _log.warn("No tunnels to send search out through!  wtf!");
     141            _log.warn("No tunnels to send search out through! Something is wrong...");
    139142            return;
    140143        }
     
    173176
    174177    /**
    175      * Build a message to test the peer with
     178     * Build a message to test the peer with.
     179     * The message is a store of the peer's RI to itself,
     180     * with a reply token.
    176181     */
    177182    private DatabaseStoreMessage buildMessage(RouterInfo peer, TunnelId replyTunnel, Hash replyGateway, long nonce, long expiration) {
  • router/java/src/net/i2p/router/startup/LoadRouterInfoJob.java

    r036b777 r8096e4f6  
    8484            // if we have a routerinfo but no keys, things go bad in a hurry:
    8585            // CRIT   ...rkdb.PublishLocalRouterInfoJob: Internal error - signing private key not known?  rescheduling publish for 30s
    86             // CRIT      net.i2p.router.Router         : Internal error - signing private key not known?  wtf
     86            // CRIT      net.i2p.router.Router         : Internal error - signing private key not known? Impossible?
    8787            // CRIT   ...sport.udp.EstablishmentManager: Error in the establisher java.lang.NullPointerException
    8888            // at net.i2p.router.transport.udp.PacketBuilder.buildSessionConfirmedPacket(PacketBuilder.java:574)
  • router/java/src/net/i2p/router/time/NtpClient.java

    r036b777 r8096e4f6  
    5656    private final static double SECONDS_1900_TO_EPOCH = 2208988800.0;
    5757    private final static int NTP_PORT = 123;
    58    
     58    private static final int DEFAULT_TIMEOUT = 10*1000;
     59
    5960    /**
    6061     * Query the ntp servers, returning the current time from first one we find
     
    8586     * @since 0.7.12
    8687     */
    87     public static long[] currentTimeAndStratum(String serverNames[]) {
     88    public static long[] currentTimeAndStratum(String serverNames[], int perServerTimeout) {
    8889        if (serverNames == null)
    8990            throw new IllegalArgumentException("No NTP servers specified");
     
    9394        Collections.shuffle(names);
    9495        for (int i = 0; i < names.size(); i++) {
    95             long[] rv = currentTimeAndStratum(names.get(i));
     96            long[] rv = currentTimeAndStratum(names.get(i), perServerTimeout);
    9697            if (rv != null && rv[0] > 0)
    9798                return rv;
     
    106107     */
    107108    public static long currentTime(String serverName) {
    108          long[] la = currentTimeAndStratum(serverName);
     109         long[] la = currentTimeAndStratum(serverName, DEFAULT_TIMEOUT);
    109110         if (la != null)
    110111             return la[0];
     
    117118     * @since 0.7.12
    118119     */
    119     private static long[] currentTimeAndStratum(String serverName) {
     120    private static long[] currentTimeAndStratum(String serverName, int timeout) {
    120121        DatagramSocket socket = null;
    121122        try {
     
    136137            // Get response
    137138            packet = new DatagramPacket(buf, buf.length);
    138             socket.setSoTimeout(10*1000);
     139            socket.setSoTimeout(timeout);
    139140            socket.receive(packet);
    140141
  • router/java/src/net/i2p/router/time/RouterTimestamper.java

    r036b777 r8096e4f6  
    4444    private static final int DEFAULT_CONCURRING_SERVERS = 3;
    4545    private static final int MAX_CONSECUTIVE_FAILS = 10;
     46    private static final int DEFAULT_TIMEOUT = 10*1000;
     47    private static final int SHORT_TIMEOUT = 5*1000;
    4648   
    4749    public static final String PROP_QUERY_FREQUENCY = "time.queryFrequencyMs";
     
    178180                                _log.debug("Querying servers " + servers);
    179181                            try {
    180                                 lastFailed = !queryTime(servers.toArray(new String[servers.size()]));
     182                                lastFailed = !queryTime(servers.toArray(new String[servers.size()]), SHORT_TIMEOUT);
    181183                            } catch (IllegalArgumentException iae) {
    182184                                if (!lastFailed && _log != null && _log.shouldWarn())
     
    193195                            _log.debug("Querying servers " + _servers);
    194196                        try {
    195                             lastFailed = !queryTime(_servers.toArray(new String[_servers.size()]));
     197                            lastFailed = !queryTime(_servers.toArray(new String[_servers.size()]), DEFAULT_TIMEOUT);
    196198                        } catch (IllegalArgumentException iae) {
    197199                            lastFailed = true;
     
    260262     * True if the time was queried successfully, false if it couldn't be
    261263     */
    262     private boolean queryTime(String serverList[]) throws IllegalArgumentException {
     264    private boolean queryTime(String serverList[], int perServerTimeout) throws IllegalArgumentException {
    263265        long found[] = new long[_concurringServers];
    264266        long now = -1;
     
    267269        _wellSynced = false;
    268270        for (int i = 0; i < _concurringServers; i++) {
    269             if (i > 0) {
    270                 // this delays startup when net is disconnected or the timeserver list is bad, don't make it too long
    271                 try { Thread.sleep(2*1000); } catch (InterruptedException ie) {}
    272             }
    273             long[] timeAndStratum = NtpClient.currentTimeAndStratum(serverList);
     271            //if (i > 0) {
     272            //    // this delays startup when net is disconnected or the timeserver list is bad, don't make it too long
     273            //    try { Thread.sleep(2*1000); } catch (InterruptedException ie) {}
     274            //}
     275            long[] timeAndStratum = NtpClient.currentTimeAndStratum(serverList, perServerTimeout);
    274276            now = timeAndStratum[0];
    275277            stratum = (int) timeAndStratum[1];
  • router/java/src/net/i2p/router/transport/GetBidsJob.java

    r036b777 r8096e4f6  
    5959        if (to.equals(us)) {
    6060            if (log.shouldLog(Log.ERROR))
    61                 log.error("wtf, send a message to ourselves?  nuh uh. msg = " + msg);
     61                log.error("send a message to ourselves?  nuh uh. msg = " + msg);
    6262            context.statManager().addRateData("transport.bidFailSelf", msg.getLifetime());
    6363            fail(context, msg);
  • router/java/src/net/i2p/router/transport/OutboundMessageRegistry.java

    r036b777 r8096e4f6  
    196196    private void registerPending(OutNetMessage msg, boolean allowEmpty) {
    197197        if ( (!allowEmpty) && (msg.getMessage() == null) )
    198                 throw new IllegalArgumentException("OutNetMessage doesn't contain an I2NPMessage? wtf");
     198                throw new IllegalArgumentException("OutNetMessage doesn't contain an I2NPMessage? Impossible?");
    199199        MessageSelector sel = msg.getReplySelector();
    200         if (sel == null) throw new IllegalArgumentException("No reply selector?  wtf");
     200        if (sel == null) throw new IllegalArgumentException("No reply selector? Impossible?");
    201201
    202202        if (!_activeMessages.add(msg))
  • router/java/src/net/i2p/router/transport/TransportImpl.java

    r036b777 r8096e4f6  
    374374                          + msg.getFailedTransports() + " and succeeding on " + getStyle());
    375375            if ( (allTime > 60*1000) && (sendSuccessful) ) {
    376                 // WTF!!@#
     376                // VERY slow
    377377                if (_log.shouldLog(Log.WARN))
    378                     _log.warn("WTF, more than a minute slow? " + msg.getMessageType()
     378                    _log.warn("Severe latency? More than a minute slow? " + msg.getMessageType()
    379379                              + " of id " + msg.getMessageId() + " (send begin on "
    380380                              + new Date(msg.getSendBegin()) + " / created on "
     
    498498        } else {
    499499            if (_log.shouldLog(Log.ERROR))
    500                 _log.error("WTF! Null listener! this = " + toString(), new Exception("Null listener"));
     500                _log.error("Null listener! this = " + toString(), new Exception("Null listener"));
    501501        }
    502502    }
  • router/java/src/net/i2p/router/transport/TransportManager.java

    r036b777 r8096e4f6  
    531531            throw new IllegalArgumentException("Null message?  no bidding on a null outNetMessage!");
    532532        if (_context.router().getRouterInfo().equals(msg.getTarget()))
    533             throw new IllegalArgumentException("WTF, bids for a message bound to ourselves?");
     533            throw new IllegalArgumentException("Bids for a message bound to ourselves?");
    534534
    535535        List<TransportBid> rv = new ArrayList<TransportBid>(_transports.size());
  • router/java/src/net/i2p/router/transport/ntcp/NTCPSendFinisher.java

    r036b777 r8096e4f6  
    101101                //_context.statManager().addRateData("ntcp.sendFinishTime", _context.clock().now() - _queued, 0);
    102102            } catch (Throwable t) {
    103                 _log.log(Log.CRIT, " wtf, afterSend borked", t);
     103                _log.log(Log.CRIT, " afterSend broken?", t);
    104104            }
    105105        }
  • router/java/src/net/i2p/router/transport/udp/ACKSender.java

    r036b777 r8096e4f6  
    169169                if (wanted < 0) {
    170170                    if (_log.shouldLog(Log.WARN))
    171                         _log.warn("wtf, why are we acking something they dont want?  remaining=" + remaining + ", peer=" + peer + ", bitfields=" + ackBitfields);
     171                        _log.warn("why are we acking something they dont want?  remaining=" + remaining + ", peer=" + peer + ", bitfields=" + ackBitfields);
    172172                    continue;
    173173                }
  • router/java/src/net/i2p/router/transport/udp/OutboundMessageFragments.java

    r036b777 r8096e4f6  
    179179        PeerState peer = state.getPeer();
    180180        if (peer == null)
    181             throw new RuntimeException("wtf, null peer for " + state);
     181            throw new RuntimeException("null peer for " + state);
    182182        peer.add(state);
    183183        add(peer);
  • router/java/src/net/i2p/router/tunnel/BatchedPreprocessor.java

    r036b777 r8096e4f6  
    371371        if (offset <= 0) {
    372372            StringBuilder buf = new StringBuilder(128);
    373             buf.append("wtf, written offset is ").append(offset);
     373            buf.append("uh? written offset is ").append(offset);
    374374            buf.append(" for ").append(startAt).append(" through ").append(sendThrough);
    375375            for (int i = startAt; i <= sendThrough; i++) {
  • router/java/src/net/i2p/router/tunnel/FragmentHandler.java

    r036b777 r8096e4f6  
    165165                _log.error("Corrupt fragment received: offset = " + offset, e);
    166166            _context.statManager().addRateData("tunnel.corruptMessage", 1, 1);
    167             // java.lang.IllegalStateException: wtf, don't get the completed size when we're not complete - null fragment i=0 of 1
     167            // java.lang.IllegalStateException: don't get the completed size when we're not complete - null fragment i=0 of 1
    168168            // at net.i2p.router.tunnel.FragmentedMessage.getCompleteSize(FragmentedMessage.java:194)
    169169            // at net.i2p.router.tunnel.FragmentedMessage.toByteArray(FragmentedMessage.java:223)
  • router/java/src/net/i2p/router/tunnel/FragmentedMessage.java

    r036b777 r8096e4f6  
    165165    public int getCompleteSize() {
    166166        if (!_lastReceived)
    167             throw new IllegalStateException("wtf, don't get the completed size when we're not complete");
     167            throw new IllegalStateException("don't get the completed size when we're not complete!");
    168168        if (_releasedAfter > 0) {
    169169             RuntimeException e = new RuntimeException("use after free in FragmentedMessage");
     
    176176            // NPE seen here, root cause unknown
    177177            if (ba == null)
    178                 throw new IllegalStateException("wtf, don't get the completed size when we're not complete - null fragment i=" + i + " of " + _highFragmentNum);
     178                throw new IllegalStateException("don't get the completed size when we're not complete! - null fragment i=" + i + " of " + _highFragmentNum);
    179179            size += ba.getValid();
    180180        }
  • router/java/src/net/i2p/router/tunnel/InboundGatewayProcessor.java

    r036b777 r8096e4f6  
    2121        boolean ok = super.process(orig, offset, length, null);
    2222        if (!ok)
    23             throw new RuntimeException("wtf, we are the gateway, how did it fail?");
     23            throw new RuntimeException("we are the gateway, how did it fail?");
    2424    }
    2525}
  • router/java/src/net/i2p/router/tunnel/InboundMessageDistributor.java

    r036b777 r8096e4f6  
    119119                        return;
    120120                    } else if (dsm.getReplyToken() != 0) {
    121                         if (_log.shouldLog(Log.WARN))
    122                             _log.warn("Dropping LS DSM w/ reply token down a tunnel for " + _client + ": " + msg);
     121                        _context.statManager().addRateData("tunnel.dropDangerousClientTunnelMessage", 1, type);
     122                        _log.error("Dropping LS DSM w/ reply token down a tunnel for " + _client + ": " + msg);
    123123                        return;
    124124                    } else {
     
    144144                    return;
    145145
     146            } // switch
     147        } else {
     148            // expl. tunnel
     149            switch (type) {
     150                case DatabaseStoreMessage.MESSAGE_TYPE:
     151                    DatabaseStoreMessage dsm = (DatabaseStoreMessage) msg;
     152                    if (dsm.getReplyToken() != 0) {
     153                        _context.statManager().addRateData("tunnel.dropDangerousExplTunnelMessage", 1, type);
     154                        _log.error("Dropping DSM w/ reply token down a expl. tunnel: " + msg);
     155                        return;
     156                    }
     157                    if (dsm.getEntry().getType() == DatabaseEntry.KEY_TYPE_LEASESET)
     158                        ((LeaseSet)dsm.getEntry()).setReceivedAsReply();
     159                    break;
     160
     161                case DatabaseSearchReplyMessage.MESSAGE_TYPE:
     162                case DeliveryStatusMessage.MESSAGE_TYPE:
     163                case GarlicMessage.MESSAGE_TYPE:
     164                case TunnelBuildReplyMessage.MESSAGE_TYPE:
     165                case VariableTunnelBuildReplyMessage.MESSAGE_TYPE:
     166                    // these are safe, handled below
     167                    break;
     168
     169                default:
     170                    _context.statManager().addRateData("tunnel.dropDangerousExplTunnelMessage", 1, type);
     171                    _log.error("Dropped dangerous message down expl tunnel: " + msg, new Exception("cause"));
     172                    return;
    146173            } // switch
    147174        } // client != null
     
    190217            if (outId == null) {
    191218                if (_log.shouldLog(Log.ERROR))
    192                     _log.error("wtf, outbound tunnel has no outboundId? " + out
     219                    _log.error("strange? outbound tunnel has no outboundId? " + out
    193220                               + " failing to distribute " + msg);
    194221                return;
  • router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java

    r036b777 r8096e4f6  
    212212                                              "Tunnels", RATES);
    213213        // following are for InboundMessageDistributor
    214         ctx.statManager().createRateStat("tunnel.dropDangerousClientTunnelMessage", "How many tunnel messages come down a client tunnel that we shouldn't expect (lifetime is the 'I2NP type')", "Tunnels", new long[] { 60*60*1000 });
     214        ctx.statManager().createRateStat("tunnel.dropDangerousClientTunnelMessage", "(lifetime is the I2NP type)", "Tunnels", new long[] { 60*60*1000 });
     215        ctx.statManager().createRateStat("tunnel.dropDangerousExplTunnelMessage", "(lifetime is the I2NP type)", "Tunnels", new long[] { 60*60*1000 });
    215216        ctx.statManager().createRateStat("tunnel.handleLoadClove", "When do we receive load test cloves", "Tunnels", new long[] { 60*60*1000 });
    216217        // following is for PumpedTunnelGateway
     
    631632     */
    632633    public void dispatchOutbound(I2NPMessage msg, TunnelId outboundTunnel, TunnelId targetTunnel, Hash targetPeer) {
    633         if (outboundTunnel == null) throw new IllegalArgumentException("wtf, null outbound tunnel?");
     634        if (outboundTunnel == null) throw new IllegalArgumentException("null outbound tunnel?");
    634635        long before = _context.clock().now();
    635636        TunnelGateway gw = _outboundGateways.get(outboundTunnel);
     
    678679        //if (dispatchTime > 1000) {
    679680        //    if (_log.shouldLog(Log.WARN))
    680         //        _log.warn("wtf, took " + dispatchTime + " to dispatch " + msg + " out " + outboundTunnel + " in " + gw);
     681        //        _log.warn("slow? took " + dispatchTime + " to dispatch " + msg + " out " + outboundTunnel + " in " + gw);
    681682        //}
    682683        //if (gw instanceof TunnelGatewayZeroHop)
  • router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java

    r036b777 r8096e4f6  
    353353                            _context.statManager().addRateData("tunnel.receiveRejectionCritical", 1);
    354354                    }
    355                     // penalize peer based on their bitchiness level
     355                    // penalize peer based on their reported error level
    356356                    _context.profileManager().tunnelRejected(peer, rtt, howBad);
    357357                    _context.messageHistory().tunnelParticipantRejected(peer, "peer rejected after " + rtt + " with " + howBad + ": " + cfg.toString());
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    r036b777 r8096e4f6  
    757757            Hash gw = tunnel.getPeer(0);
    758758            if ( (inId == null) || (gw == null) ) {
    759                 _log.error(toString() + ": wtf, tunnel has no inbound gateway/tunnelId? " + tunnel);
     759                _log.error(toString() + ": broken? tunnel has no inbound gateway/tunnelId? " + tunnel);
    760760                continue;
    761761            }
Note: See TracChangeset for help on using the changeset viewer.