Changeset 9386270


Ignore:
Timestamp:
Jun 5, 2013 4:33:38 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
000ca7c
Parents:
f0886c5f
Message:

Save I2CP client version for future reference

Location:
router/java/src/net/i2p/router/client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/client/ClientConnectionRunner.java

    rf0886c5f r9386270  
    6868    /** user's config */
    6969    private SessionConfig _config;
     70    private String _clientVersion;
    7071    /** static mapping of MessageId to Payload, storing messages for retrieval */
    7172    private final Map<MessageId, Payload> _messages;
     
    178179    /** current client's config */
    179180    public SessionConfig getConfig() { return _config; }
     181
     182    /**
     183     *  The client version.
     184     *  @since 0.9.7
     185     */
     186    public void setClientVersion(String version) {
     187        _clientVersion = version;
     188    }
     189
     190    /**
     191     *  The client version.
     192     *  @return null if unknown or less than 0.8.7
     193     *  @since 0.9.7
     194     */
     195    public String getClientVersion() {
     196        return _clientVersion;
     197    }
     198
    180199    /** current client's sessionkeymanager */
    181200    public SessionKeyManager getSessionKeyManager() { return _sessionKeyManager; }
  • router/java/src/net/i2p/router/client/ClientMessageEventListener.java

    rf0886c5f r9386270  
    135135        // sent by clients >= 0.8.7
    136136        String clientVersion = message.getVersion();
    137         // TODO - save client's version string for future reference
     137        if (clientVersion != null)
     138            _runner.setClientVersion(clientVersion);
    138139        try {
    139140            // only send version if the client can handle it (0.8.7 or greater)
  • router/java/src/net/i2p/router/client/QueuedClientConnectionRunner.java

    rf0886c5f r9386270  
    11package net.i2p.router.client;
    22
     3import net.i2p.CoreVersion;
    34import net.i2p.data.i2cp.I2CPMessage;
    45import net.i2p.data.i2cp.I2CPMessageException;
     
    6970            throw new I2CPMessageException("I2CP write to queue failed");
    7071    }
    71    
     72
     73    /**
     74     *  Does nothing. Client version is the core version.
     75     *  @since 0.9.7
     76     */
     77    @Override
     78    public void setClientVersion(String version) {}
     79
     80    /**
     81     *  The client version.
     82     *  @return CoreVersion.VERSION
     83     *  @since 0.9.7
     84     */
     85    @Override
     86    public String getClientVersion() {
     87        return CoreVersion.VERSION;
     88    }
    7289}
Note: See TracChangeset for help on using the changeset viewer.