API: Fix some client-side APIs to honor defaults in Properties;

add javadocs to specify where we do and don't (ticket #1491)
This commit is contained in:
zzz
2015-03-31 13:18:11 +00:00
parent 22c4149358
commit fadc624f7c
14 changed files with 116 additions and 39 deletions

View File

@@ -237,9 +237,12 @@ public class TunnelPoolSettings {
public Properties getUnknownOptions() { return _unknownOptions; }
/**
* Defaults in props are NOT honored.
* In-JVM client side must promote defaults to the primary map.
*
* @param prefix non-null
*/
public void readFromProperties(String prefix, Map<Object, Object> props) {
public void readFromProperties(String prefix, Properties props) {
for (Map.Entry<Object, Object> e : props.entrySet()) {
String name = (String) e.getKey();
String value = (String) e.getValue();

View File

@@ -161,6 +161,11 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi
_runner.disconnected();
}
/**
* Defaults in GetDateMessage options are NOT honored.
* Defaults are not serialized out-of-JVM, and the router does not recognize defaults in-JVM.
* Client side must promote defaults to the primary map.
*/
private void handleGetDate(GetDateMessage message) {
// sent by clients >= 0.8.7
String clientVersion = message.getVersion();
@@ -192,6 +197,9 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi
* sending the DisconnectMessage... but right now the client will send _us_ a
* DisconnectMessage in return, and not wait around for our DisconnectMessage.
* So keep it simple.
*
* Defaults in SessionConfig options are, in general, NOT honored.
* In-JVM client side must promote defaults to the primary map.
*/
private void handleCreateSession(CreateSessionMessage message) {
SessionConfig in = message.getSessionConfig();
@@ -459,6 +467,9 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi
*
* Note that this does NOT update the few options handled in
* ClientConnectionRunner.sessionEstablished(). Those can't be changed later.
*
* Defaults in SessionConfig options are, in general, NOT honored.
* In-JVM client side must promote defaults to the primary map.
*/
private void handleReconfigureSession(ReconfigureSessionMessage message) {
SessionConfig cfg = _runner.getConfig();