Changeset c1afbd3
- Timestamp:
- Nov 11, 2015 1:48:38 PM (5 years ago)
- Branches:
- master
- Children:
- 37a4fcb
- Parents:
- 1451dc6
- Location:
- router/java/src/net/i2p/router/transport/udp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java
r1451dc6 rc1afbd3 30 30 import net.i2p.util.I2PThread; 31 31 import net.i2p.util.Log; 32 import net.i2p.util.VersionComparator; 32 33 33 34 /** … … 127 128 private static final int DATA_MESSAGE_TIMEOUT = 10*1000; 128 129 130 /** 131 * Java I2P has always parsed the length of the extended options field, 132 * but i2pd hasn't recognized it until this release. 133 * No matter, the options weren't defined until this release anyway. 134 */ 135 private static final String VERSION_ALLOW_EXTENDED_OPTIONS = "0.9.24"; 136 137 129 138 public EstablishmentManager(RouterContext ctx, UDPTransport transport) { 130 139 _context = ctx; … … 357 366 return; 358 367 } 368 boolean allowExtendedOptions = VersionComparator.comp(toRouterInfo.getVersion(), 369 VERSION_ALLOW_EXTENDED_OPTIONS) >= 0; 359 370 state = new OutboundEstablishState(_context, maybeTo, to, 360 toIdentity, 371 toIdentity, allowExtendedOptions, 361 372 sessionKey, addr, _transport.getDHFactory()); 362 373 OutboundEstablishState oldState = _outboundStates.putIfAbsent(to, state); … … 478 489 // Only offer for an IPv4 session. 479 490 // TODO if already we have their RI, only offer if they need it (no 'C' cap) 491 // TODO if extended options, only if they asked for it 480 492 if (_transport.canIntroduce() && state.getSentPort() >= 1024 && 481 493 state.getSentIP().length == 4) { -
router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java
r1451dc6 rc1afbd3 57 57 private final RemoteHostId _claimedAddress; 58 58 private final RouterIdentity _remotePeer; 59 private final boolean _allowExtendedOptions; 59 60 private final SessionKey _introKey; 60 61 private final Queue<OutNetMessage> _queuedMessages; … … 113 114 public OutboundEstablishState(RouterContext ctx, RemoteHostId claimedAddress, 114 115 RemoteHostId remoteHostId, 115 RouterIdentity remotePeer, SessionKey introKey, UDPAddress addr, 116 RouterIdentity remotePeer, boolean allowExtendedOptions, 117 SessionKey introKey, UDPAddress addr, 116 118 DHSessionKeyBuilder.Factory dh) { 117 119 _context = ctx; … … 126 128 _claimedAddress = claimedAddress; 127 129 _remoteHostId = remoteHostId; 130 _allowExtendedOptions = allowExtendedOptions; 128 131 _remotePeer = remotePeer; 129 132 _introKey = introKey; … … 158 161 /** @return -1 if unset */ 159 162 public long getIntroNonce() { return _introductionNonce; } 163 164 /** @since 0.9.24 */ 165 public boolean isExtendedOptionsAllowed() { return _allowExtendedOptions; } 160 166 161 167 /** -
router/java/src/net/i2p/router/transport/udp/PacketBuilder.java
r1451dc6 rc1afbd3 785 785 public UDPPacket buildSessionRequestPacket(OutboundEstablishState state) { 786 786 // TODO 787 // boolean ext = state.isExtendedOptionsAllowed(); 788 // if (ext) 787 789 //byte[] options = new byte[3]; 788 790 //UDPPacket packet = buildPacketHeader(SESSION_REQUEST_FLAG_BYTE, options);
Note: See TracChangeset
for help on using the changeset viewer.