diff --git a/core/java/src/net/i2p/data/i2cp/RequestLeaseSetMessage.java b/core/java/src/net/i2p/data/i2cp/RequestLeaseSetMessage.java index 87a819e4f..630ee6e37 100644 --- a/core/java/src/net/i2p/data/i2cp/RequestLeaseSetMessage.java +++ b/core/java/src/net/i2p/data/i2cp/RequestLeaseSetMessage.java @@ -22,15 +22,15 @@ import net.i2p.data.Hash; import net.i2p.data.TunnelId; /** - * Defines the message a client sends to a router when destroying - * existing session. + * Defines the message a router sends to a client to request that + * a leaseset be created and signed. The reply is a CreateLeaseSetMessage. * * @author jrandom */ public class RequestLeaseSetMessage extends I2CPMessageImpl { public final static int MESSAGE_TYPE = 21; private SessionId _sessionId; - private List _endpoints; + private final List _endpoints; private Date _end; public RequestLeaseSetMessage() { @@ -101,9 +101,9 @@ public class RequestLeaseSetMessage extends I2CPMessageImpl { @Override protected byte[] doWriteMessage() throws I2CPMessageException, IOException { - if ((_sessionId == null) || (_endpoints == null)) + if (_sessionId == null) throw new I2CPMessageException("Unable to write out the message as there is not enough data"); - ByteArrayOutputStream os = new ByteArrayOutputStream(64); + ByteArrayOutputStream os = new ByteArrayOutputStream(256); try { _sessionId.writeBytes(os); DataHelper.writeLong(os, 1, _endpoints.size()); @@ -127,7 +127,7 @@ public class RequestLeaseSetMessage extends I2CPMessageImpl { @Override public String toString() { StringBuilder buf = new StringBuilder(); - buf.append("[RequestLeaseMessage: "); + buf.append("[RequestLeaseSetMessage: "); buf.append("\n\tSessionId: ").append(getSessionId()); buf.append("\n\tTunnels:"); for (int i = 0; i < getEndpoints(); i++) { @@ -140,8 +140,8 @@ public class RequestLeaseSetMessage extends I2CPMessageImpl { } private static class TunnelEndpoint { - private Hash _router; - private TunnelId _tunnelId; + private final Hash _router; + private final TunnelId _tunnelId; public TunnelEndpoint(Hash router, TunnelId id) { _router = router; diff --git a/core/java/src/net/i2p/data/i2cp/SessionStatusMessage.java b/core/java/src/net/i2p/data/i2cp/SessionStatusMessage.java index 8ac95d825..5ed81c2fd 100644 --- a/core/java/src/net/i2p/data/i2cp/SessionStatusMessage.java +++ b/core/java/src/net/i2p/data/i2cp/SessionStatusMessage.java @@ -17,8 +17,8 @@ import net.i2p.data.DataFormatException; import net.i2p.data.DataHelper; /** - * Defines the message a client sends to a router when destroying - * existing session. + * Defines the message a router sends to a client indicating the + * status of the session. * * @author jrandom */