Changeset 7e0654a


Ignore:
Timestamp:
Jun 17, 2013 7:57:59 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
25feb745
Parents:
00d1b75
Message:

in fast receive mode and the router doesn't require them.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/I2PSessionImpl.java

    r00d1b75 r7e0654a  
    4848import net.i2p.util.SimpleScheduler;
    4949import net.i2p.util.SimpleTimer;
     50import net.i2p.util.VersionComparator;
    5051
    5152/**
     
    138139    private boolean _isReduced;
    139140    private final boolean _fastReceive;
     141    private volatile boolean _routerSupportsFastReceive;
    140142
    141143    /**
     
    151153    private static final long MAX_SEND_WAIT = 10*1000;
    152154
    153     void dateUpdated() {
     155    private static final String MIN_FAST_VERSION = "0.9.4";
     156
     157    /** @param routerVersion as rcvd in the SetDateMessage, may be null for very old routers */
     158    void dateUpdated(String routerVersion) {
     159        _routerSupportsFastReceive = _context.isRouterContext() ||
     160                                     (routerVersion != null && routerVersion.length() > 0 &&
     161                                      VersionComparator.comp(routerVersion, MIN_FAST_VERSION) >= 0);
    154162        _dateReceived = true;
    155163        synchronized (_dateReceivedLock) {
     
    291299     */
    292300    public boolean getFastReceive() {
    293         return _fastReceive;
     301        return _fastReceive && _routerSupportsFastReceive;
    294302    }
    295303
  • core/java/src/net/i2p/client/MessagePayloadMessageHandler.java

    r00d1b75 r7e0654a  
    4545            // and we don't send this, the router will OOM as it has
    4646            // no cleaner for old messages.
    47             // TODO after 0.9.4 is out, check router version from handshake
     47            // Check router version from handshake
    4848            // and send it all the time if 0.9.3 or less
    4949            // (needs router version saving support in SetDateMessageHandler)
    50             //if (!session.getFastReceive()) {
     50            if (!session.getFastReceive()) {
    5151                ReceiveMessageEndMessage m = new ReceiveMessageEndMessage();
    5252                m.setMessageId(id);
    5353                m.setSessionId(msg.getSessionId());
    5454                session.sendMessage(m);
    55             //}
     55            }
    5656        } catch (DataFormatException dfe) {
    5757            session.propogateError("Error handling a new payload message", dfe);
  • core/java/src/net/i2p/client/SetDateMessageHandler.java

    r00d1b75 r7e0654a  
    3636            Clock.getInstance().setNow(msg.getDate().getTime());
    3737        // TODO - save router's version string for future reference
    38         session.dateUpdated();
     38        session.dateUpdated(msg.getVersion());
    3939    }
    4040}
  • history.txt

    r00d1b75 r7e0654a  
     12013-06-17 zzz
     2 * Console: Don't display 'unsupported' message when restart button clicked
     3 * I2CP: Don't send SendMessageEndMessages from client to router if
     4         in fast receive mode and the router doesn't require them.
     5 * NetDB:
     6   - Don't instantiate unused success job for republish LS
     7   - Add debug setting to encrypt RI lookups
     8 * NTCP: Extend interval for sending time sync messages
     9 * SusiMail: Fix classpath problem when started manually (ticket #957)
     10
    1112013-06-14 zzz
    212 * I2CP: Fix deserialization of new RVLSM; enable by default
  • router/java/src/net/i2p/router/RouterVersion.java

    r00d1b75 r7e0654a  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 9;
     21    public final static long BUILD = 10;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.